Hi,
I'm testing open messaging (open-messaging-blueprint-main) and can't log in with OAuth client.loginClientCredentialsGrant(config.clientId,config.clientSecret) get the error what could be the reason? details are correct in OAuth clientId and clientSecret.
AxiosError {message: 'Request failed with status code 400', name: 'AxiosError', code: 'ERR_BAD_REQUEST', config: {…}, request: ClientRequest, …}
The thread 'app.js [37860]' (0x0) has exited with code 0 (0x0).
The program 'JavaScript debug adapter: app.js [37860]' has exited with code 4294967295 (0xffffffff).
The program 'app.js' has exited with code 4294967295 (0xffffffff).
I use npm purecloud-platform-client-v2@185.0.0
/***************************************************
-
Authenticate with Genesys Cloud using an
-
OAuth Client Credentials Grant flow
*/
function authenticate() {
client.loginClientCredentialsGrant(config.clientId,config.clientSecret)
.then((data)=> {
// Do authenticated things
accessToken = data.accessToken;// Start express on the defined port app.listen(PORT, () => { console.log(`Server listenign on local port ${PORT}`); // Start Local Tunnel for public internet access (async () => { const tunnel = await localtunnel({ port: PORT, subdomain: LT_SUBDOMAIN }); console.log(`Server listening on external URL ${tunnel.url}`); tunnel.on('close', () => { // tunnels are closed }); })(); });
})
.catch((err) => {
// Handle failure response
console.log(err);
});
}
/Lars