Skip to content

Commit

Permalink
Disable azuread roles sync
Browse files Browse the repository at this point in the history
  • Loading branch information
KamalGalrani authored Oct 25, 2023
1 parent 5e1b01b commit 65dbf41
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions pkg/login/social/azuread_oauth.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ func (s *SocialAzureAD) UserInfo(client *http.Client, token *oauth2.Token) (*Bas
return nil, errors.New("error getting user info: no email found in access token")
}

role := extractRole(claims, s.autoAssignOrgRole)
logger.Debug("AzureAD OAuth: extracted role", "email", email, "role", role)
/* role := extractRole(claims, s.autoAssignOrgRole)
logger.Debug("AzureAD OAuth: extracted role", "email", email, "role", role) */

groups, err := extractGroups(client, claims, token)
if err != nil {
Expand All @@ -87,7 +87,7 @@ func (s *SocialAzureAD) UserInfo(client *http.Client, token *oauth2.Token) (*Bas
Name: claims.Name,
Email: email,
Login: email,
Role: string(role),
Role: "", /* string(role), */
Groups: groups,
}, nil
}
Expand Down Expand Up @@ -117,7 +117,7 @@ func extractEmail(claims azureClaims) string {

return claims.Email
}

/*
func extractRole(claims azureClaims, autoAssignRole string) models.RoleType {
if len(claims.Roles) == 0 {
return models.RoleType(autoAssignRole)
Expand Down Expand Up @@ -146,7 +146,7 @@ func hasRole(roles []string, role models.RoleType) bool {
}
return false
}

*/
type getAzureGroupRequest struct {
SecurityEnabledOnly bool `json:"securityEnabledOnly"`
}
Expand Down

0 comments on commit 65dbf41

Please sign in to comment.