Validate OIDC Session State

This commit is contained in:
Joel Speed 2018-06-21 11:31:21 +01:00
parent a628b852eb
commit 5ab17d9a40
No known key found for this signature in database
GPG Key ID: 83695B8B3A376982

View File

@ -123,3 +123,13 @@ func (p *OIDCProvider) createSessionState(token *oauth2.Token, ctx context.Conte
Email: claims.Email, Email: claims.Email,
}, nil }, nil
} }
func (p *OIDCProvider) ValidateSessionState(s *SessionState) bool {
ctx := context.Background()
_, err := p.Verifier.Verify(ctx, s.IdToken)
if err != nil {
return false
}
return true
}