News & Announcements User Community Developer Community

Welcome to the RingCentral Community

Please note the community is currently under maintenance and is read-only.

Search
Make sure to review our Terms of Use and Community Guidelines.
  Please note the community is currently under maintenance and is read-only.
Home » Developers
Refresh Token Missing - Maintaining Active Login with JWT Auth using Node SDK
Tags: rest api
Apr 3, 2024 at 10:36am   •   1 replies  •  0 likes
TC User

Hi,

We are having a similar issue to the one mentioned here. We're using the Node SDK, and migrated from password authentication to JWT authentication.

After reading the docs, it seemed that JWT authentication did not require any accessToken or refreshToken management, and we would just maintain a login state without any issues... but that does not appear to be the case.

We first received "Refresh token is missing" errors - and enabled refresh tokens in the app. This fixed the issue for now.


Here's a sample of our auth code:


const rcsdk = new SDK({
  server: RINGCENTRAL_SERVER,
  clientId: RINGCENTRAL_CLIENTID,
  clientSecret: RINGCENTRAL_CLIENTSECRET,
});


const platform = rcsdk.platform();


platform
  .login({
    jwt: JWT,
  })
  .then(async function (resp) {
    return resp.json();
  })
  .then((r) => console.log("login response", r));


Is this sufficient to maintain an active session until the JWT is set to expire? Or, do we need to be managing the login status more manually?

1 Answer
answered on Apr 3, 2024 at 11:53am  

To get the token and return it, you have to use the await keyword

platform
  .login({
    jwt: JWT,
  })
  .then(async function (resp) {
    return await resp.json();
  })
  .then((r) => console.log("login response", r));

 0



A new Community is coming to RingCentral!

Posts are currently read-only as we transition into our new platform.

We thank you for your patience
during this downtime.

Try Workflow Builder

Did you know you can easily automate tasks like responding to SMS, team messages, and more? Plus it's included with RingCentral Video and RingEX plans!

Try RingCentral Workflow Builder

PRODUCTS
RingEX
Message
Video
Phone
OPEN ECOSYSTEM
Developer Platform
APIs
Integrated Apps
App Gallery
Developer support
Games and rewards

RESOURCES
Resource center
Blog
Product Releases
Accessibility
QUICK LINKS
App Download
RingCentral App login
Admin Portal Login
Contact Sales
© 1999-2024 RingCentral, Inc. All rights reserved. Legal Privacy Notice Site Map Contact Us