Found the resolution from this document: https://docs.sonarqube.org/latest/extend/web-api/
So, basic_auth with username is the token and password is NULL - such as weird approach from Sonar... On Tuesday, 2 February 2021 at 22:12:48 UTC+2 Nguyen Viet wrote: > Hi, > > I am trying to configure Prometheus to scrape metrics from SonarQube > Community version. > > The metrics are now exposed to https://sonarlink/api/prometheus/metrics > > My SonarQube is authenticated with SSO to Microsoft AD. I have tried > different authentication methods from basic user/pass, token but it does > not work. It returns “server returned HTTP status 401” > > - job_name: sonarqube > metrics_path: /api/prometheus/metrics > scrape_interval: 30s > scrape_timeout: 28s > scheme: https > static_configs: > - targets: [‘SOARQUBE.abc.com <http://soarqube.abc.com/>’] > tls_config: > insecure_skip_verify: true > basic_auth: > username: “[email protected]” > password: “password” > OR > > params: > bearer_token: [‘TOKENID’] > > Thank you for any suggestion! > -- You received this message because you are subscribed to the Google Groups "Prometheus Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/47c9a2c8-8ac9-46f8-b77d-ff860b7ee620n%40googlegroups.com.

