mirror of
https://github.com/vmware-tanzu/pinniped.git
synced 2026-06-03 21:46:46 +00:00
callback_handler.go: assert nonce is stored correctly
I think we want to do this here since we are storing all of the other ID token claims? Signed-off-by: Andrew Keesler <akeesler@vmware.com>
This commit is contained in:
@@ -97,7 +97,13 @@ func NewHandler(
|
||||
return err
|
||||
}
|
||||
|
||||
openIDSession := makeDownstreamSession(downstreamIssuer, downstreamAuthParams.Get("client_id"), username, groups)
|
||||
openIDSession := makeDownstreamSession(
|
||||
downstreamIssuer,
|
||||
downstreamAuthParams.Get("client_id"),
|
||||
downstreamAuthParams.Get("nonce"),
|
||||
username,
|
||||
groups,
|
||||
)
|
||||
authorizeResponder, err := oauthHelper.NewAuthorizeResponse(r.Context(), authorizeRequester, openIDSession)
|
||||
if err != nil {
|
||||
plog.WarningErr("error while generating and saving authcode", err, "upstreamName", upstreamIDPConfig.GetName())
|
||||
@@ -291,7 +297,7 @@ func getGroupsFromUpstreamIDToken(
|
||||
return groups, nil
|
||||
}
|
||||
|
||||
func makeDownstreamSession(issuer, clientID, username string, groups []string) *openid.DefaultSession {
|
||||
func makeDownstreamSession(issuer, clientID, nonce, username string, groups []string) *openid.DefaultSession {
|
||||
now := time.Now()
|
||||
openIDSession := &openid.DefaultSession{
|
||||
Claims: &jwt.IDTokenClaims{
|
||||
@@ -302,6 +308,7 @@ func makeDownstreamSession(issuer, clientID, username string, groups []string) *
|
||||
IssuedAt: now,
|
||||
RequestedAt: now,
|
||||
AuthTime: now,
|
||||
Nonce: nonce,
|
||||
},
|
||||
}
|
||||
if groups != nil {
|
||||
|
||||
Reference in New Issue
Block a user