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

OAuth: Fix fallback to auto_assign_org_role setting for Azure AD OAuth when no role claims exists #34838

Merged
merged 2 commits into from May 28, 2021

Conversation

idafurjes
Copy link
Contributor

@idafurjes idafurjes commented May 27, 2021

What this PR does / why we need it:
Rather than fallback to Viewer role when no role claims exists, fixes so it fallback to auto_assign_org_role setting.

Which issue(s) this PR fixes:
Fixes #30555

Special notes for your reviewer:

Copy link
Member

@marefr marefr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, but left a comment.

pkg/login/social/azuread_oauth.go Outdated Show resolved Hide resolved
@idafurjes idafurjes marked this pull request as ready for review May 28, 2021 12:07
@idafurjes idafurjes requested a review from a team as a code owner May 28, 2021 12:07
@idafurjes idafurjes requested review from aknuds1 and removed request for a team May 28, 2021 12:07
Copy link
Member

@marefr marefr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great. LGTM

@idafurjes idafurjes added this to the 8.0.0-beta3 milestone May 28, 2021
@idafurjes idafurjes changed the title 30555:Assign correct role with environment variable GF_USERS_AUTO_ASS… Oauth: Assign correct role with environment variable GF_USERS_AUTO_ASS… May 28, 2021
@idafurjes idafurjes changed the title Oauth: Assign correct role with environment variable GF_USERS_AUTO_ASS… Oauth: Assign role from GF_USERS_AUTO_ASSIGN_ORG_ROLE for Azure AD Oauth May 28, 2021
@idafurjes idafurjes merged commit 48f6d6f into main May 28, 2021
@idafurjes idafurjes deleted the ida/30555_assign_role_env_var branch May 28, 2021 14:14
@marefr marefr added area/auth/oauth and removed backport A backport PR labels May 28, 2021
@marefr marefr changed the title Oauth: Assign role from GF_USERS_AUTO_ASSIGN_ORG_ROLE for Azure AD Oauth OAuth: Fix fallback to auto_assign_org_role setting for Azure AD OAuth when no role claims exists May 28, 2021
@marefr marefr added the old backport v8.0.x Mark PR for automatic backport to v8.0.x label May 28, 2021
grafanabot pushed a commit that referenced this pull request May 28, 2021
…uth (#34838)

* 30555:Assign correct role with environment variable GF_USERS_AUTO_ASSIGN_ORG_ROLE

* 30555:Remove unused condition

(cherry picked from commit 48f6d6f)
idafurjes added a commit that referenced this pull request May 31, 2021
…uth (#34838) (#34938)

* 30555:Assign correct role with environment variable GF_USERS_AUTO_ASSIGN_ORG_ROLE

* 30555:Remove unused condition

(cherry picked from commit 48f6d6f)

Co-authored-by: idafurjes <36131195+idafurjes@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Oauth users not being assigned correct role with environment variable GF_USERS_AUTO_ASSIGN_ORG_ROLE
3 participants