Skip to content
Snippets Groups Projects
Commit 1608b473 authored by Happy2C0de's avatar Happy2C0de
Browse files

Remove false failed errors.

parent 2b6bb199
No related branches found
No related tags found
No related merge requests found
...@@ -299,10 +299,7 @@ func (c *oidcConnector) createIdentity(ctx context.Context, identity connector.I ...@@ -299,10 +299,7 @@ func (c *oidcConnector) createIdentity(ctx context.Context, identity connector.I
preferredUsername, found := claims[prefUsername].(string) preferredUsername, found := claims[prefUsername].(string)
if (!found || c.overrideClaimMapping) && c.preferredUsernameKey != "" { if (!found || c.overrideClaimMapping) && c.preferredUsernameKey != "" {
prefUsername = c.preferredUsernameKey prefUsername = c.preferredUsernameKey
preferredUsername, found = claims[prefUsername].(string) preferredUsername, _ = claims[prefUsername].(string)
if !found {
return identity, fmt.Errorf("missing \"%s\" claim", prefUsername)
}
} }
hasEmailScope := false hasEmailScope := false
...@@ -319,9 +316,6 @@ func (c *oidcConnector) createIdentity(ctx context.Context, identity connector.I ...@@ -319,9 +316,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 {
return identity, fmt.Errorf("missing \"%s\" claim", emailKey)
}
} }
if !found && hasEmailScope { if !found && hasEmailScope {
......
...@@ -253,7 +253,7 @@ func TestHandleCallback(t *testing.T) { ...@@ -253,7 +253,7 @@ func TestHandleCallback(t *testing.T) {
}, },
}, },
{ {
name: "customGroupsKeyButGroupsProvidedButOverride", name: "customGroupsKeyDespiteGroupsProvidedButOverride",
overrideClaimMapping: true, overrideClaimMapping: true,
groupsKey: "cognito:groups", groupsKey: "cognito:groups",
expectUserID: "subvalue", expectUserID: "subvalue",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment