diff --git a/cmd/cloudflared/token/token.go b/cmd/cloudflared/token/token.go index 814dce88..e5649b4e 100644 --- a/cmd/cloudflared/token/token.go +++ b/cmd/cloudflared/token/token.go @@ -62,7 +62,8 @@ func GetTokenIfExists(url *url.URL) (string, error) { return "", err } ident, err := oidc.IdentityFromClaims(claims) - if err == nil && ident.ExpiresAt.After(time.Now()) { + // AUTH-1404, reauth if the token is about to expire within 15 minutes + if err == nil && ident.ExpiresAt.After(time.Now().Add(time.Minute*15)) { return token.Encode(), nil } return "", err