如何获取使用 RingCentral 中的小部件登录的用户的访问令牌?

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

我正在使用 RingCentral Embeddable widget 使用以下代码。

(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);
  }
})();

我想在成功登录后存储令牌、刷新令牌和用户 ID。如果我只使用 ringcentral 小部件,有人可以帮助我如何获得上述详细信息吗?

访问令牌在浏览器的本地存储中可用,密钥为 sdk-rc-widgetplatform。请参阅以下内容:

Token is saved at Browser localStorage with key sdk-rc-widgetplatform. You can only access it when your deploy the app in your domain. But it is not recommended to use token, token will be expired and changed when the app refresh it.

If you want to manage token in server side, you can have a look at RingCentral proxy project, it make authorization in server side #349

https://github.com/ringcentral/ringcentral-embeddable/issues/510