Skip to main content
The First Step
October 20, 2023
Solved

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

  • October 20, 2023
  • 3 replies
  • 463 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?

Best answer by PhongVu

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.

3 replies

PhongVu
Community Manager
PhongVuAnswer
Community Manager
October 20, 2023

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.

nargyleThe First StepAuthor
The First Step
October 20, 2023

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.

nargyleThe First StepAuthor
The First Step
October 20, 2023