Solved

JWT: error Error: Client authentication is required | Node SDK

  • 20 October 2023
  • 3 replies
  • 182 views

Using this code to try and authenticate the SDK.

import { SDK } from "@ringcentral/sdk";

export default async function fetchRingCentralData() {
  const rcsdk = new SDK({
    server: process.env.RC_SERVER,
    appKey: process.env.RC_CLIENTID,
    appSecret: process.env.RC_CLIENTSECRET,
  });
  const platform = rcsdk.platform();
 
  await platform.login({ jwt: process.env.RC_JWT });
}


Receiving error

Error: Client authentication is required 


The app is set up as a JWT app.

cleanshot-2023-10-20-at-131844.png


Can someone help?

icon

Best answer by Phong1426275020 20 October 2023, 21:33

View original

3 replies

Userlevel 1

The new SDK constructor takes new param object.

const rcsdk = new SDK({
    server: process.env.RC_SERVER,
    clientId: process.env.RC_CLIENTID,
    clientSecret: process.env.RC_CLIENTSECRET,
  });

Can you share the link to the documentation or sample code that shows you the old code. We will fix the documentation accordingly. Thanks.

That worked, thank you. I probably pulled that from some other community post's code when debugging something else. Could've sworn I tested what was in the docs, but apparently not. Docs all appear correct.

Oh wait, it's in the test data here - https://developers.ringcentral.com/api-reference/provisioningcleanshot-2023-10-20-at-173932.png

Reply