News & Announcements User Community Developer Community

Welcome to the RingCentral Community

Please note the community is currently under maintenance and is read-only.

Search
Make sure to review our Terms of Use and Community Guidelines.
  Please note the community is currently under maintenance and is read-only.
Home » Developers
Is there an API or way to auto-login a user to RingCentral when using RingCentral embeddable?
Tags: rest api, embeddable, authentication
Mar 15, 2022 at 2:45am   •   3 replies  •  0 likes
Himanshu Patel

We have implemented the RingCentral widget to receive calls in our Magento-powered website. For that, when an admin user logs into the website then they must also log into their RingCentral account from the widget or browser. Is there any API for that? So that when any admin user logs in then they are logged in automatically to RingCentral account based on their user credential?

on Mar 15, 2022 at 5:03am   •  1 likes

It is a little unclear on what do you mean by "For that when admin user login to website than must login to ring central account for from widget or browser."
My assumption is that you want to login into the RingCentral account in the widget (without putting in the credentials) as soon as the user logs into your website.
The concern I see here is that your website and RingCentral widget share different auth credentials and mechanisms as they are 2 different entities.
I am also assuming that your widget is using 3 legged OAuth to authenticate and login the user.
@Himanshu Patel Could you confirm if my understanding/assumptions are correct?

on Mar 15, 2022 at 8:31pm   •  0 likes

for implement & access phone in ring central widget in our website need to login ring central account. So is there any way to auto login so direct receive & make call from widget ?

2 Answers
answered on Mar 15, 2022 at 11:30pm  

The embeddable widget support to customize authorization flow based on authorization code:https://github.com/ringcentral/ringcentral-embeddable/blob/master/docs/customize-authorization.md
You need to implement RingCentral authorization code flow in your side, then pass authorization code to embeddable for login.


 1
on Mar 25, 2022 at 1:32am   •  0 likes

We use https://github.com/ringcentral/ringcentral-js-widgets in out HTML page so how can use below method in HTML page?

on Mar 27, 2022 at 7:33pm   •  0 likes

For "JS widgets" lib, you can just call "phone.auth.login({code: 'user_authorization_code'})"

on Mar 27, 2022 at 8:32pm   •  0 likes

https://github.com/ringcentral/ringcentral-embeddable there is no any function like phone.auth.login

on Apr 1, 2022 at 3:37pm   •  0 likes

The ringcentral-embeddable library and the ringcentral-js-widgets are different. I am not too familiar with js-widgets. Can you describe in more detail what you are trying to build, then perhaps we can help you find the optimal library and then show you how to auth using that library.

In either scenario though, you will we doing a 3-legged auth token flow. This is a classic OAuth flow in which a user clicks login, gets directed to RingCentral.com to login, authorizes the app, then returns the user to your app which then obtains the auth token and sets it in the widget/component via JS. Then the client (either a widget or embeddable) can make API calls.

on Mar 27, 2022 at 11:08pm   •  0 likes

Hi @Himanshu Patel "phone.auth.login" is for app built from js widgets lib.
If you are using embeddable widget, you should follow https://github.com/ringcentral/ringcentral-embeddable/blob/master/docs/customize-authorization.md to customize authorization.

on Mar 28, 2022 at 6:32am   •  0 likes

For get code i use https://platform.devtest.ringcentral.com/restapi/oauth/authorize?response_type=code&redirect_uri=https://www.ms.com/add.php&client_id=<CLIENTID>&display=&prompt=code_challenge=_MZEI9FtFf31e2EkTdVL4i0EkX7R5o37oMOs6Zyh3YM&code_challenge_method=S256 URL where shown response as "No redirect uri is registered for the client" while my app configure with "Password-based auth flow" so where to configure ir?

on Mar 28, 2022 at 12:00pm   •  0 likes

It appears your app is misconfigured. It needs to be configured to use the "3-legged OAuth flow authorization code" options for REST API apps.

on Mar 28, 2022 at 7:48pm   •  0 likes

Currently the embeddable widget doesn't support password auth flow with iframe API. It only supports authorization code auth flow (3-legged OAuth flow).

We can add API to let the embeddable support password flow. But the password grant flow only work for private RingCentral app (only working at your own RingCentral account). Can you share why you need password flow? Are you building private RingCentral app?

on Mar 29, 2022 at 6:44am   •  0 likes

When I try to get code URL for login than return error "Single Sign-on is not yet enabled for this user account. Please contact your company administrator." please suggest any simple way to login with embedded widget

on Mar 29, 2022 at 7:42pm   •  0 likes

Do you test app in Sandbox environment or production? Sandbox account is independent with production account. It error show your account is not enabled for Single Sign-on. If you are testing at sandbox, you need to enter your email or phone number to login. 1648608040113.png

on Mar 30, 2022 at 1:22am   •  0 likes

When try to single sign than shown error as "Single Sign-on is not yet enabled for this user account. Please contact your company administrator."

on Mar 30, 2022 at 11:01pm   •  0 likes

It should that your account don't support to login with Single Sign-On at RingCentral login. You should just input email or phone number to login.

on Mar 28, 2022 at 8:08pm   •  0 likes

You can try to run "phone.auth.login({password: '', username: ''})" in the embeddable widget iframe scope with chrome developer tool to try password grant flow. It only works when you pass your own client id (need to support password grant flow) and secret to the embeddable. https://github.com/ringcentral/ringcentral-embeddable/blob/master/docs/config-client-id-and-secret.md

answered on Mar 15, 2022 at 8:04pm  

The answer to your question is relatively complex, but let me see if I can break it down.

Simply put, there is no API to authenticate an arbitrary user to obtain a token to access their account. That would be a huge security risk. However, we do have solutions that I think will help you.

  1. JWT auth flow. This is not the ideal auth flow for all use cases, but it does have the advantage of being able to access a user's account via the API without them being present or having to use a user interface. This auth mode was designed with server-to-server use cases in mind.

  2. Auth code flow. This feels like the right solution for you, but what is missing from your solution (I think) is prompt your user to connect to their RC account, and then to implement a service to wake periodically to refresh your access keys to keep them fresh and prevent them from expiring.

One final solution worth mentioning, which might also be appropriate is using Okta. Okta is a third-party authentication and identity provider which can help facilitate single sign-on between different services you subscribe to, e.g. RingCentral, Magneto, etc.


 0



A new Community is coming to RingCentral!

Posts are currently read-only as we transition into our new platform.

We thank you for your patience
during this downtime.

Try Workflow Builder

Did you know you can easily automate tasks like responding to SMS, team messages, and more? Plus it's included with RingCentral Video and RingEX plans!

Try RingCentral Workflow Builder

PRODUCTS
RingEX
Message
Video
Phone
OPEN ECOSYSTEM
Developer Platform
APIs
Integrated Apps
App Gallery
Developer support
Games and rewards

RESOURCES
Resource center
Blog
Product Releases
Accessibility
QUICK LINKS
App Download
RingCentral App login
Admin Portal Login
Contact Sales
© 1999-2024 RingCentral, Inc. All rights reserved. Legal Privacy Notice Site Map Contact Us