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
전문가
검토됨 한 달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인