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 Jan 15, 2019
1 parent b7ad46b commit 9249b07
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions providers/oidc.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,3 +128,14 @@ func (p *OIDCProvider) createSessionState(ctx context.Context, token *oauth2.Tok
Email: claims.Email,
}, nil
}

// ValidateSessionState checks that the session's IDToken is still valid
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 9249b07

Please sign in to comment.