简体   繁体   中英

SonarQube api api/project_analyses/search fails with 403 "msg": "Insufficient privileges" yet API key user is admin

I am accessing the SonarQube API through API key as described in https://docs.sonarqube.org/latest/extension-guide/web-api/

  • A call to /api/components/search_projects works.
  • A call to /api/project_analyses/search?project=PJ fails with http error code 403

If I log into the web interface with that user, I can browse the statistics. In fact Chromes F12 debug shows that it's calling the same api function /api/project_analyses/search yet with session cookie, xrfs-token etc. and the call succeeds.

What am I missing to be able to retrieve project statistics through the API?

The token used is created by the user which has sufficient permission for the project PJ

You need to check the permission and generate new token accordingly.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM