Question

How can I get the access token of the user logged in using widget in ringcentral?

  • 4 May 2021
  • 1 reply
  • 237 views

I'm using the ringcentral embeddable widget using the following code.

(function() {
    var rcs = document.createElement("script");
    rcs.src = "https://ringcentral.github.io/ringcentral-embeddable/adapter.js?clientId={client_id}&appServer={app_server}&redirectUri={redirect_uri}";
    var rcs0 = document.getElementsByTagName("script")[0];
    rcs0.parentNode.insertBefore(rcs, rcs0);
  if (window.RCAdapter) {
    window.RCAdapter.setMinimized(false);
  }
})();

I want to store the token, refresh token and user id after a successful login. Can someone please help in how can I get the above details if I'm just using the ringcentral widget?


1 reply

Userlevel 1

Not sure about your purpose of storing the tokens, but you should know that the embeddable widget keeps refreshing the tokens itself and once that happens, the tokens you store will become invalid. Or if you use the refresh token to refresh the access token, the widget will not be able to refresh the tokens anymore. Anyway, @Embbnux Ji can help you if there is a way to access the tokens or not.

Reply