Skip to content
This repository has been archived by the owner on Jan 24, 2019. It is now read-only.

Commit

Permalink
Validate OIDC Session State
Browse files Browse the repository at this point in the history
  • Loading branch information
JoelSpeed committed Jun 21, 2018
1 parent bf0957d commit 1e7cd88
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions providers/oidc.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,3 +123,13 @@ func (p *OIDCProvider) createSessionState(token *oauth2.Token, ctx context.Conte
Email: claims.Email,
}, 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
}

0 comments on commit 1e7cd88

Please sign in to comment.