i am using the @okta/okta-sdk-nodejs , set the client according to documentation :
const client = new okta.Client({
orgUrl: ‘’,
authorizationMode: ‘PrivateKey’,
clientId: '. ',
scopes: [‘okta.users.read’],
privateKey: key, // the key is a JSON as a string that was copied according to the guide, currently in another file and exported as string
keyId: ‘<my kid from the app integration API service general tab’,
})
}
when running any api , for example :
const user = await client.userApi.getUser({ userId: ‘00u7j1z1z1Z2Z2Z2Z2Z2’ })
i get the following error :
“invalid json response body at /error/404?fromURI=%2Foauth2%2Fv1%2Ftoken reason: Unexpected token ‘<’, "<!DOCTYPE "… is not valid JSON”
I could not find any ‘<’ sign …
my key file looks like :
export const key = { "d": "<some-string>", "p": "<some-string>", "q": "<some-string>", "dp": "<some-string>", "dq": "<some-string>", "qi": "<some-string>", "kty": "RSA", "e": "<some-string>", "kid": "my KID", "n": "<some-string>" }
can you please help to understand what may be the issue ?