Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide better message for 401 codes #1293

Closed
andrei-epure-sonarsource opened this issue Jul 27, 2022 · 2 comments · Fixed by #1536
Closed

Provide better message for 401 codes #1293

andrei-epure-sonarsource opened this issue Jul 27, 2022 · 2 comments · Fixed by #1536

Comments

@andrei-epure-sonarsource
Copy link
Contributor

The following error message appears often on the community.:

The token you provided doesn’t have sufficient rights to check license

What it does

15:54:48.927 Downloading from http://SQ/api/server/version...
15:54:48.958 Checking validity of server license
15:54:48.958 Downloading from http://SQ/api/editions/is_valid_license...

However, if you look at the root causes of the community posts, it can be different issues, for example: user not providing a valid token at all (The problem was that I was using same name for Project and Token name.) - we can detect that.

Also, if the token is not good for authentication, we shouldn't give a message about the license.

In this whisper I suggested

In any case, if there’s an issue with authentication, we should provide a link to documentation around how to generate a token?

and @ganncamp said:

I found the particular error message in question in the Scanner for MSBuild repo & I’ve never seen this particular message before, i.e. I’ve never seen it outside the .NET context

@andrei-epure-sonarsource
Copy link
Contributor Author

@costin-zaharia-sonarsource
Copy link
Member

Link to internal thread related to using the license API in the scanner: https://discuss.sonarsource.com/t/usage-of-api-editions-is-valid-license-in-net-scanner/13670

@github-actions github-actions bot moved this from In progress to Review in progress in S4NET Kanban Mar 22, 2023
@github-actions github-actions bot moved this from Review in progress to Reviewer approved in S4NET Kanban Mar 22, 2023
S4NET Kanban automation moved this from Reviewer approved to Done Mar 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
S4NET Kanban
  
Done
Development

Successfully merging a pull request may close this issue.

5 participants