Skip to content

Commit

Permalink
Merge pull request #3319 from gmgigi96/fix-oidc-custom-claims
Browse files Browse the repository at this point in the history
Fix oidc provider crash when custom claims are provided
  • Loading branch information
gmgigi96 authored Oct 6, 2022
2 parents c26f6a9 + d5fa595 commit 6d7e9b0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions changelog/unreleased/oidc-fix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Bugfix: Fix oidc provider crash when custom claims are provided

https://github.com/cs3org/reva/pull/3319

4 changes: 4 additions & 0 deletions pkg/auth/manager/oidc/oidc.go
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,10 @@ func (am *mgr) resolveUser(ctx context.Context, claims map[string]interface{}) e
)

uid, gid := am.getUserID(claims)
if uid != 0 && gid != 0 {
claims[am.c.UIDClaim] = uid
claims[am.c.GIDClaim] = gid
}

if len(am.oidcUsersMapping) > 0 {
claim = "username"
Expand Down

0 comments on commit 6d7e9b0

Please sign in to comment.