簡體   English   中英

如何獲取使用 RingCentral 中的小部件登錄的用戶的訪問令牌?

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

我正在使用以下代碼使用RingCentral Embeddable 小部件

(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 請參閱以下內容:

令牌保存在瀏覽器 localStorage 中,密鑰sdk-rc-widgetplatform 只有在您的域中部署應用程序時才能訪問它。 但不推薦使用token,應用刷新時token會過期更改。

如果你想在服務器端管理令牌,你可以看看 RingCentral 代理項目,它在服務器端進行授權 #349

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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM