Skip to content

Commit

Permalink
Merge pull request #3 from Chia-Network/skew
Browse files Browse the repository at this point in the history
Add 60 seconds of allowable skew
  • Loading branch information
cmmarslender committed Oct 24, 2022
2 parents ac59f98 + a300206 commit 372cf41
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/jwt/parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package jwt
import (
"net/http"
"strings"
"time"

"github.com/lestrrat-go/jwx/jwk"
"github.com/lestrrat-go/jwx/jwt"
Expand Down Expand Up @@ -35,7 +36,7 @@ func ParseTokenFromRequestWithJWKS(r *http.Request, jwksEndpoint string) (jwt.To
}

// ensures that we verify essential claims, like expiration, not before, etc
err = jwt.Validate(token)
err = jwt.Validate(token, jwt.WithAcceptableSkew(60*time.Second))
if err != nil {
return nil, errors.Wrap(err, "ParseTokenFromHeaderWithJWKS():jwt.Verify()")
}
Expand Down

0 comments on commit 372cf41

Please sign in to comment.