Skip to content

Commit

Permalink
Remove overrideWithMissingCustomEmailClaim
Browse files Browse the repository at this point in the history
Signed-off-by: Happy2C0de <46957159+Happy2C0de@users.noreply.github.com>
  • Loading branch information
Happy2C0de committed Sep 20, 2021
1 parent 616a1e9 commit 2aa6be1
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 21 deletions.
4 changes: 0 additions & 4 deletions connector/oidc/oidc.go
Original file line number Diff line number Diff line change
Expand Up @@ -314,10 +314,6 @@ func (c *oidcConnector) createIdentity(ctx context.Context, identity connector.I
if (!found || c.overrideClaimMapping) && c.emailKey != "" {
emailKey = c.emailKey
email, found = claims[emailKey].(string)
if !found && c.overrideClaimMapping {
// If override is enabled but claim was not found, empty string is preferred over fallback.
email, found = "", true
}
}

if !found && hasEmailScope {
Expand Down
17 changes: 0 additions & 17 deletions connector/oidc/oidc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,23 +110,6 @@ func TestHandleCallback(t *testing.T) {
"email_verified": true,
},
},
{
name: "overrideWithMissingCustomEmailClaim",
userIDKey: "", // not configured
userNameKey: "", // not configured
overrideClaimMapping: true,
emailKey: "custommail",
expectUserID: "subvalue",
expectUserName: "namevalue",
expectedEmailField: "",
token: map[string]interface{}{
// no "custommail" claim
"sub": "subvalue",
"name": "namevalue",
"email": "emailvalue",
"email_verified": true,
},
},
{
name: "email_verified not in claims, configured to be skipped",
insecureSkipEmailVerified: true,
Expand Down

0 comments on commit 2aa6be1

Please sign in to comment.