fix: clock skew when using jwt profile
This commit is contained in:
parent
27f3bc0f4a
commit
b23f37f7eb
1 changed files with 5 additions and 1 deletions
|
@ -69,7 +69,11 @@ func CreateAccessToken(ctx context.Context, tokenRequest TokenRequest, accessTok
|
|||
if err != nil {
|
||||
return "", 0, err
|
||||
}
|
||||
validity = exp.Add(client.ClockSkew()).Sub(time.Now().UTC())
|
||||
var clockSkew time.Duration
|
||||
if client != nil {
|
||||
clockSkew = client.ClockSkew()
|
||||
}
|
||||
validity = exp.Add(clockSkew).Sub(time.Now().UTC())
|
||||
if accessTokenType == AccessTokenTypeJWT {
|
||||
token, err = CreateJWT(ctx, creator.Issuer(), tokenRequest, exp, id, creator.Signer(), client, creator.Storage())
|
||||
return
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue