简体   繁体   English

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

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

I'm using the RingCentral Embeddable widget using the following code.我正在使用以下代码使用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);
  }
})();

I want to store the token, refresh token and user id after a successful login.我想在成功登录后存储令牌、刷新令牌和用户 ID。 Can someone please help in how can I get the above details if I'm just using the ringcentral widget?如果我只是使用 ringcentral 小部件,有人可以帮助我如何获得上述详细信息吗?

The access token is available in the browser's local storage with the key sdk-rc-widgetplatform .访问令牌在浏览器的本地存储中可用,密钥sdk-rc-widgetplatform See the following:请参阅以下内容:

Token is saved at Browser localStorage with key sdk-rc-widgetplatform .令牌保存在浏览器 localStorage 中,密钥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.但不推荐使用token,应用刷新时token会过期更改。

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如果你想在服务器端管理令牌,你可以看看 RingCentral 代理项目,它在服务器端进行授权 #349

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在使用授权代码流时让用户保持用户登录 RingCentral? - How can I keep user keep user logged in RingCentral while using Authorization code flow? 如何使用RingCentral访问其他分机的问候语? - How can I access another extension's greeting using RingCentral? 如何获得RingCentral软电话中显示的用户状态? - How can I get a user's status as shown in the RingCentral softphone? RingCentral Salesforce:如何使用RingCentral沙箱用户详细信息登录到应用程序 - RingCentral Salesforce: How do I login to app using RingCentral sandbox user details 如何在 RingCentral 帐户中创建用户? - How to create a user in RingCentral account? 使用网络电话时,如何在RingCentral的呼叫处理和转接中配置的所有号码上收到振铃? - How can I receive ringing on all the numbers configured in call handling and forwarding in RingCentral while using web phone? Salesforce:如何获取接收者的RingCentral扩展号码 - Salesforce: How do I get RingCentral extension number of receiver 如何使用 API 获取 RingCentral 实时报告数据? - How to get RingCentral Live Reports data using the API? 如何从 RingCentral SMS 响应中获取 conversationId? - How do I get the conversationId from a RingCentral SMS response? 如何获得 RingCentral 呼叫队列成员可用性? - How to get RingCentral Call Queue Members Availability?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM