Skip to content

Commit

Permalink
openid: Validate id_token_hint only via ID claims
Browse files Browse the repository at this point in the history
Signed-off-by: arekkas <aeneas@ory.am>
  • Loading branch information
arekkas committed Aug 7, 2018
1 parent 7820fb2 commit 44c0bfa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions handler/openid/validator.go
Expand Up @@ -150,8 +150,8 @@ func (v *OpenIDConnectRequestValidator) ValidatePrompt(req fosite.AuthorizeReque
return errors.WithStack(fosite.ErrInvalidRequest.WithHint("Failed to validate OpenID Connect request as decoding id token from id_token_hint to *jwt.StandardClaims failed."))
} else if hintSub, _ := hintClaims["sub"].(string); hintSub == "" {
return errors.WithStack(fosite.ErrInvalidRequest.WithHint("Failed to validate OpenID Connect request because provided id token from id_token_hint does not have a subject."))
} else if hintSub != claims.Subject || hintSub != session.GetSubject() {
return errors.WithStack(fosite.ErrLoginRequired.WithHintf("Failed to validate OpenID Connect request because subject from session does not subject from id_token_hint."))
} else if hintSub != claims.Subject {
return errors.WithStack(fosite.ErrLoginRequired.WithHintf("Failed to validate OpenID Connect request because subject from ID token session claims does not subject from id_token_hint."))
}

return nil
Expand Down

0 comments on commit 44c0bfa

Please sign in to comment.