Github authentication is not working for some users

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
    SonarQube v9.9.5 (build 90363)
  • how is SonarQube deployed: zip, Docker, Helm
    Helm
  • what are you trying to achieve
    We have integrated sonarqube with github authentication, some users can log in without any problem, but some of them cannot login at all with this error:
You're not authorized to access this page. Please contact the administrator.

Reason: 'USER' must be a member of at least one organization: 'xxx', 'yyy', 'zzz'
  • what have you tried so far to achieve this

Do not share screenshots of logs – share the text itself (bonus points for being well-formatted)!

Hey there.

Under your global Administration > Authentication > GitHub, you appear to have configured sonar.auth.github.organizations which will limit who can login to your SonarQube server.

Either you need to add an organization this user belongs to, or add the user to one of the organizations you’ve specified in this setting.

Hi Colin
Thanks for your reply, these users are the member of at least one of these organizations

Hey @yasharne

I finally got around to reproducing this and I ran into an issue – maybe it’s the same one as you, maybe not.

What I discovered was that one of the following two things must be true:

  • The GitHub Application that I’m using for authentication is installed on the organization I listed for sonar.auth.github.organizations
  • Or I must be a public member of an organization listed in sonar.auth.github.organizations

Surprisingly (to me) a user can manage this for themselves in GitHub