File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -101,8 +101,8 @@ type Config struct {
101
101
// Time function to check Token expiry. Defaults to time.Now
102
102
Now func () time.Time
103
103
104
- // Duration function for clock skew. Defaults to 5 minutes.
105
- ClockSkew func () time.Duration
104
+ // Duration for clock skew. Defaults to 5 minutes.
105
+ ClockSkew time.Duration
106
106
}
107
107
108
108
// Verifier returns an IDTokenVerifier that uses the provider's key set to verify JWTs.
@@ -273,8 +273,8 @@ func (v *IDTokenVerifier) Verify(ctx context.Context, rawIDToken string) (*IDTok
273
273
// Set to 5 minutes by default since this is what other OpenID Connect providers do to deal with clock skew.
274
274
// https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/blob/6.12.2/src/Microsoft.IdentityModel.Tokens/TokenValidationParameters.cs#L149-L153
275
275
clockSkew := 5 * time .Minute
276
- if v .config .ClockSkew != nil {
277
- clockSkew = v .config .ClockSkew ()
276
+ if v .config .ClockSkew > 0 {
277
+ clockSkew = v .config .ClockSkew
278
278
}
279
279
280
280
if t .Expiry .Before (nowTime .Add (- clockSkew )) {
You can’t perform that action at this time.
0 commit comments