API v2 not works with Local WsClient (Error 404)

Hi,

We have a plugin developed in Java and when we try to access the v2 API using a local WsClient it does not work, it gives a 404 error.

WsClientFactories.getLocal().newClient(request.localConnector());

For example to the endpoint

/api/v2/users-management/users

But if we access the endpoint from a browser, it returns the data correctly

It also works when we create a WsClient with URL and Token.

WsClientFactories.getDefault().newClient(HttpConnector.newBuilder().url(SONARQUBE_URL).token(SONARQUBE_TOKEN).build());

That could be happening?

Thanks in advance.

Best regards

Hi @juanvibolufer

Indeed, I reproduced the issue locally and experienced the same behavior.

Thanks for raising this to our attention. I created a ticket in our backlog to take care of this issue: [SONAR-22503] - Jira . For now it is planned for 10.7 version of SonarQube but this can change depending on our internal priorities.

Hi @Lukasz_Jarocki ,

Thanks for the reply.

I’m waiting for the patch to this problem. :wink:

Best regards.

1 Like