Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

435
Views
Are Cognito refresh tokens "valid" JSON web tokens?

I have been trying to validate the "refresh token" returned by Amazon Cognito Identity Provider via their boto3 python client. I've been using the validator at https://jwt.io.

When I paste the refresh token into the "encoded" box, it returns a header:

{
  "cty": "JWT",
  "enc": "A256GCM",
  "alg": "RSA-OAEP"
}

but the tool also says "invalid signature" at the bottom.

I'm wondering if this is expected behavior? Are AWS Cognito refresh tokens not valid JWTs?

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Yes, with this header it appears that the refresh token is a valid JWT.

https://jwt.io is not able to parse it because it is limited to signed JWT (JWS - RFC7515) and this one is an encrypted one (JWE - RFC7516).

Contrary to the JWS, the JWE is composed of 5 parts separated by dots. Its header can be parsed, but the payload is encrypted and cannot be read without the private or shared key.

According to the cty header, this token contains another JWT that is certainly a JWS. This nested token allows both of the two worlds: signed and encrypted claims.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!