Idea

sharmilan-a avatar image
sharmilan-a Posted ·

Getting access_token and refresh_token from web embbedable token login

I am using RingCentral embeddable voice for CRM integration, I could be able the access_token, refresh_token and etc from the browser local storage manually.
Is there any proper way to get the tokens? something like through 'rc-login-status-notify' event listeners inside the javascript.
topic-default
1 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

1 Comment

· Write a Comment
Embbnux Ji avatar image
Embbnux Ji Posted ·
Hi, Sharmilan

For security problem, now it isn't allowed to pass token by message event directly. Can you tell me why you need the token. Actually you can get most data from widget event. If you need more data, you can create a issue in here, so we can add it into our backlog.  https://github.com/ringcentral/ringcentral-embeddable/issues

If you still need access token, you can customize redirect uri and get token from 'window.location.href' in implicit auth flow.  https://github.com/ringcentral/ringcentral-embeddable/blob/master/docs/config-client-id-and-secret.m...   https://github.com/ringcentral/ringcentral-embeddable/blob/master/docs/customize-redirect-uri.md

Thanks,
Embbnux
5 comments
1 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Thanks for your response.
I need to use some APIs and webhooks from the server side too, for track some actions. But, not interested to prompt login screen again for back-end purpose, since I have been already logged in through the widget.
The key purpose is I have to use front-end and the back-end with the single login, So if I update the access_token by using the refresh_token, I have to update front-end as well for the widget access. Or is there any way to use the existing access_token inside the widget?
I hope this is not a new scenario, have you any idea?
0 Likes 0 · ·
Hi, Sharmilan

I am thinking if SSO feature in widget can meet your requirements. Login button in your website page to make user connect ringcentral. After user login,  render the widget and it login with auto redirecting. I am doing some experiment. I will give you feedback after I finish.
1 Like 1 · ·
Hi, Sharmilan

We just release a beta SSO feature into RingCentral Embeddable. This is the document  https://github.com/ringcentral/ringcentral-embeddable/blob/master/docs/sso-login-mode.md Any feedback is very welcome.

Thanks
0 Likes 0 · ·
Thank you very much,
I going to use this, but I have an unclear point. If I have logged in two instances with different creds, but appKey, appSecret are the same in both instances since same sandbox. Then If I use widget, how it's going to use the correct RingCentral or which account will be use.
Thanks
0 Likes 0 · ·
Hi, Sharmilan, for sso, two instance should be same account. If we want to check user info, you can require '/account/~/extension/~' api
0 Likes 0 · ·

Write a Comment

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Your Opinion Counts

Share your great idea, or help out by voting for other people's ideas.