When I am running scanner using the global tool and below is the cmd
dotnet sonarscanner begin /k:“testprojectkey2token” /d:sonar.login=“admin” /d:sonar.password=“admin1”
Above cmd is running successfully. And the admin credential is used to login to sonarqube server.
And when I created a token in sonarqube server using admin credential, so I replace the cmd with
dotnet sonarscanner begin /k:“testprojectkey2token” /d:sonar.login=“token-generated”
And error display as: The token you provided doesn’t have sufficient rights to check license.
Thanks ! I wasn’t able to reproduce on my side. Do you have any specific setting on your instance that can forbid any token-based authentication maybe ?
Oops sorry. I mixed up with other post I created earlier.
Do you have any specific setting on your instance that can forbid any token-based authentication maybe ?
Not that I know.
Actually this happened to me earlier too.
Scanner can run when I use username together with password.
But is not working when I use the token generated.
If the SonarQube.Analysis.xml is set with the credential as above, then the scanner will only work when username + password provided.
If the SonarQube.Analysis.xml is set using token in the login attribute instead of username + password, then the scanner will work when token is provided.