Skip to content
Snippets Groups Projects
Commit 419db81c authored by Happy2C0de's avatar Happy2C0de
Browse files

Remove overrideWithMissingCustomEmailClaim

parent 55605751
No related branches found
No related tags found
No related merge requests found
...@@ -314,10 +314,6 @@ func (c *oidcConnector) createIdentity(ctx context.Context, identity connector.I ...@@ -314,10 +314,6 @@ func (c *oidcConnector) createIdentity(ctx context.Context, identity connector.I
if (!found || c.overrideClaimMapping) && c.emailKey != "" { if (!found || c.overrideClaimMapping) && c.emailKey != "" {
emailKey = c.emailKey emailKey = c.emailKey
email, found = claims[emailKey].(string) 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 { if !found && hasEmailScope {
......
...@@ -110,23 +110,6 @@ func TestHandleCallback(t *testing.T) { ...@@ -110,23 +110,6 @@ func TestHandleCallback(t *testing.T) {
"email_verified": true, "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", name: "email_verified not in claims, configured to be skipped",
insecureSkipEmailVerified: true, insecureSkipEmailVerified: true,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment