Add back comment about deferring validation when id token subject is missing
This commit is contained in:
parent
2958461970
commit
2b744b2eef
@ -253,6 +253,8 @@ func (p *ProviderConfig) ValidateTokenAndMergeWithUserInfo(ctx context.Context,
|
|||||||
idTokenSubject, _ := validatedClaims[oidc.IDTokenSubjectClaim].(string)
|
idTokenSubject, _ := validatedClaims[oidc.IDTokenSubjectClaim].(string)
|
||||||
|
|
||||||
if len(idTokenSubject) > 0 || !requireIDToken {
|
if len(idTokenSubject) > 0 || !requireIDToken {
|
||||||
|
// only fetch userinfo if the ID token has a subject or if we are ignoring the id token completely.
|
||||||
|
// otherwise, defer to existing ID token validation
|
||||||
if err := p.maybeFetchUserInfoAndMergeClaims(ctx, tok, validatedClaims, requireIDToken); err != nil {
|
if err := p.maybeFetchUserInfoAndMergeClaims(ctx, tok, validatedClaims, requireIDToken); err != nil {
|
||||||
return nil, httperr.Wrap(http.StatusInternalServerError, "could not fetch user info claims", err)
|
return nil, httperr.Wrap(http.StatusInternalServerError, "could not fetch user info claims", err)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user