I am using the below code to generate JWT
const fs = require('fs')
const jwt = require('jsonwebtoken')
const privateKeyName = 'd:/privatekey.pem' // Should be valid path to the private key
const issuer = 'revolut-jwt-sandbox.glitch.me' // Issuer for JWT, should be derived from your redirect URL
const client_id = <CLientID> // Your client ID
const aud = 'https://revolut.com' // Constant
const payload = {
"iss": issuer,
"sub": client_id,
"aud": aud
}
try{
const privateKey = fs.readFileSync(privateKeyName);
const token = jwt.sign(payload, privateKey, { algorithm: 'RS256', expiresIn: 60 * 60});
console.log(token)
}
catch(error)
{
this.error("Bad Luck JWT", error);
}
Then trying to get the refresh token from the Revolut API in sandbox environment by the below post request but always getting error "**{"error":"invalid_client","error_description":"client_secret is missing"}curl: (6) Could not resolve host: \**"
curl https://sandbox-b2b.revolut.com/api/1.0/auth/token \
-H "Content-Type: application/x-www-form-urlencoded"\
--data "grant_type=refresh_token"\
--data "refresh_token= <token>"\
--data "client_id=<ClientID>"\
--data "client_assertion_type=urn:ietf:params:oauth:client-assertion-type:jwt-bearer"\
--data "client_assertion=<JWT form the above JS code>"