I am currently using SonarQube 9.9 LTS deployed on-prem.
We are working on the standardization of project keys and need to update the existing project keys (for ~10K projects) as part of this process. So, I wanted to do this via (api/projects/update_key) call.
I am using a token of an admin id which has administer system and administer project accesses.
I tried to update the project key via a python script which throw a 403 error message.
The below is a sample python script
base_url = "https://sonarqube.org.net/api/projects/update_key"
headers = {}
headers['Authorization'] = self.sonar_auth_token
data_params={"from":snq_project_key,"to":new_project_key}
response_update_key = requests.post(base_url, headers=headers, params=data_params, verify=False)
When I checked it in Postman, I got “Insufficient privileges” error message, if I am entering a user token generated as api key added to header as Private-Token for the same account where it got successful if I am passing basic authentication.
Could you please guide what I am missing?
Appreciate your help!