ImmatureSignatureError as soon as I pass the cognito access token to JWT decode() method for verifying signature against JWKS.

0

Hi, I am getting ImmatureSignatureError as soon as I pass the cognito access token to JWT decode() method for verifying signature against JWKS. However, If i delay a bit like less than a sec, the issue is not existing. What's the best practice to tackle this issue?

1 個回答
0

Hello ,

Warm greetings from aws!

From your case notes I understand that you are getting the error => ImmatureSignatureError. This error is happening whenever you are trying to decode the jwt tokens immediately using jwt decode(). However you are not getting the error when introducing a delay of less than a second .

Please feel free to correct me if I did not understand your issue.

======= Solution

I would like to highlight that the error => ImmatureSignatureError. is not a cognito specific error and it is related to a specific jwt decoder you are using in your usecase.

The error is documented here => [1] https://pyjwt.readthedocs.io/en/latest/api.html#jwt.exceptions.ImmatureSignatureError "Raised when a token’s nbf claim represents a time in the future"[1]

However on best effort I have identified the issue and it seems to be related to the local time and server time has some clock skew.

================================ References and solution implementation

I am sharing some articles on best efforts basis to resolve this issue: =>https://github.com/jpadilla/pyjwt/pull/794 =>https://pyjwt.readthedocs.io/en/latest/api.html#jwt.exceptions.ImmatureSignatureError => https://github.com/nextstrain/cli/issues/307

NOTE : Third-party link shared above contains third party information and are not endorsed by AWS hence we cannot guarantee the authenticity of the content. It is shared for reference purpose only on a best-effort basis in order to assist you.

hemant
已回答 7 個月前
profile picture
專家
已審閱 1 個月前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南