Creating JWT claims for access token


I am currently looking at using the dev environment to connect to the PDS API and currently working towards generating a JWT token on our end before sending this to the oauth endpoint to get an access token.

I have followed instructions so far but currently struggling to get the access token duie to the following response: 'error_description: “Invalid ‘exp’ claim in client_assertion JWT - more than 5 minutes in future”

I have set payload of the JWT to the following in JavaScript:

const claims = {
“iss”: “redacted”,
“sub”: “redacted”,
“aud”: “”,
“jti”: uuid.v4(),
“exp”: Math.floor( / 1000) + (60 * 4)

The exp is set to the epoach time in seconds. When this is generated using JavaScript I get a time back such as169813387.

I usually use to check the timestamp

you example seems to be missing a digit? could just be a typo

check the exp, BST/GMT having an impact?