mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-12-07 23:00:55 +03:00
oidc refresh token: validate nonce only if set
As clarified in OpenID core spec errata 2, section 12.2 Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
@@ -626,7 +626,9 @@ func TestOIDCRefreshToken(t *testing.T) {
|
||||
},
|
||||
}
|
||||
verifier = mockOIDCVerifier{
|
||||
token: &oidc.IDToken{},
|
||||
token: &oidc.IDToken{
|
||||
Nonce: xid.New().String(), // nonce is different from the expected one
|
||||
},
|
||||
}
|
||||
err = token.refresh(context.Background(), &config, &verifier, r)
|
||||
if assert.Error(t, err) {
|
||||
@@ -634,7 +636,7 @@ func TestOIDCRefreshToken(t *testing.T) {
|
||||
}
|
||||
verifier = mockOIDCVerifier{
|
||||
token: &oidc.IDToken{
|
||||
Nonce: token.Nonce,
|
||||
Nonce: "", // empty token is fine on refresh but claims are not set
|
||||
},
|
||||
}
|
||||
err = token.refresh(context.Background(), &config, &verifier, r)
|
||||
|
||||
Reference in New Issue
Block a user