API not working with bearer token

Hi Team ,

We are using Sonarqube Community Edition Version 9.9.2.

When user tying to connect measurement and component in API using Bearer Token authentication is not working . But its working with Basic Auth with username and password .

This is the curl command user trying to connect for bearer token .

curl --location ‘https://sonarqube.pearson.com/api/measures/component?metricKeys=coverage%2Cbranch_coverage%2Cline_coverage&component=officehour-bfb-python&branch=feature%2FADPT-476’ \

Hi SonarQube Team,

I confirm this issue with EE 9.9.3
curl --header ‘Authorization: Bearer squ_XXX’ https://<sonarqube_hostname>/api/user_tokens/search does not work (results in 401) (access.log contains request also with 401)
curl -u squ_XXX: https://<sonarqube_hostname>/api/user_tokens/search works and returns sucessfully with response and 200
The token is the same just one time as request header with bearer token (not successful), the other time as basic auth (used as user as documented and empty pw, sucessful).

Hello all,

After deeper investigation, we found that Bearer authentication was implemented only in version 10.0 and upwards. For version 9.9 or under we do only accept HTTP basic auth or User token

You can find the documentation regarding authentication for version 9.9 here

Hope this answers your questions.



This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.