Hi,
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”: “https://dev.api.service.nhs.uk/oauth2/token”,
“jti”: uuid.v4(),
“exp”: Math.floor(Date.now() / 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.