0
votes

Referencing video: https://www.youtube.com/watch?v=ebwN2HWpDQA

Environment: Node.js

In the video they show how to get an access_token using the JWT. Documentation says the lifetime of the access_token can only be 1 hour so what do we do once the token expires? Can we simply use the JWT again with an updated date-time in UNIX epoch format for the iat and exp values to get a new access_token?

If I do update the iat and exp I get the following error

{
    "error": "invalid_grant",
    "error_description": "no_valid_keys_or_signatures"
}

How should we get a new access token?

1

1 Answers

0
votes

When an access token expires, you will need to generate a new JWT assertion, sign it, and use it to request a new access token.

Reusing the old assertion with modified IAT and EXP values won't work without also generating a new signature using your RSA Private Key.