Skip to content

Commit

Permalink
rpc: normalize issuer for Identity
Browse files Browse the repository at this point in the history
  • Loading branch information
patrislav committed Feb 19, 2024
1 parent 8e1b338 commit 7773cfd
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions rpc/identity.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,10 @@ func verifyIdentity(ctx context.Context, client HTTPClient, idToken string, sess
return proto.Identity{}, fmt.Errorf("parse JWT: %w", err)
}

idp := getOIDCProvider(ctx, normalizeIssuer(tok.Issuer()))
issuer := normalizeIssuer(tok.Issuer())
idp := getOIDCProvider(ctx, issuer)
if idp == nil {
return proto.Identity{}, fmt.Errorf("issuer %q not valid for this tenant", tok.Issuer())
return proto.Identity{}, fmt.Errorf("issuer %q not valid for this tenant", issuer)
}

keySet, err := getProviderKeySet(ctx, client, normalizeIssuer(idp.Issuer))
Expand All @@ -94,7 +95,7 @@ func verifyIdentity(ctx context.Context, client HTTPClient, idToken string, sess

identity := proto.Identity{
Type: proto.IdentityType_OIDC,
Issuer: tok.Issuer(),
Issuer: issuer,
Subject: tok.Subject(),
Email: getEmailFromToken(tok),
}
Expand Down

0 comments on commit 7773cfd

Please sign in to comment.