question

aditi-test12837 avatar image
aditi-test12837 asked Abhishek Babal commented

How can I login the user inside the widget once I have the access token?

Hi,

I am new in this segment and looking for your help to implement login flow in which user will login only once and then our web server will catch the access_token. Now I want to know that do we have a method in which I can login the user in the widget using the saved access token. Please help

sdk
1 |3000

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

Embbnux Ji avatar image
Embbnux Ji answered Abhishek Babal commented
Hi, @ aditi test you can try In-page login mode  https://github.com/ringcentral/ringcentral-embeddable/blob/master/docs/sso-login-mode.md When user had logged with RingCentral OAuth page, it would auto logged in the widget.
1 comment
1 |3000

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

Abhishek Babal avatar image Abhishek Babal commented ·

@Embbnux Ji redirect page is not responsive ............can you provide another link

0 Likes 0 ·
aditi-test12837 avatar image
aditi-test12837 answered Embbnux Ji commented
Hi Embbnux,
thanks for your reply, I have tried it, but it's giving me error "No Auth Code". I tried a lot but, I am not able to find a solution for the same. 
1 comment
1 |3000

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

Embbnux Ji avatar image Embbnux Ji commented ·
Hi, @aditi test Can you show how you implement this and screenshot or other details. It seems a bug in In-page login mode.  
0 Likes 0 ·
Oleg avatar image
Oleg answered

Hi,

I also tried to implement In-page login mode. I was able to get access_token(and saved it in DB), but I don't understand what should I pass instead of "your_app_key". I tried to pass there access_token, clientId and etc, but I always got "error" : "invalid_client"

https://ringcentral.github.io/ringcentral-embeddable/adapter.js?authMode=sso&appKey=your_app_key

Could you please explain what should I pass into appKey?

1 |3000

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

Embbnux Ji avatar image
Embbnux Ji answered Oleg commented

Hi, @Oleg In in-page login, we are reusing alive session in RingCentral login page. If user login in somewhere of current browser, when user goto widget with in-page login, widget will redirect to RingCentral login page. If session is still alive, RingCentral login page will redirect back with access token. We require app key for using same alive session. You don't need to pass access token to widget.

For error "invalid client", can you check your appKey. It is caused by wrong appKey. Is you app id in production environment. If your app id in on sandbox, you need to pass appServer "https://platform.devtest.ringcentral.com"

1 comment
1 |3000

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

Oleg avatar image Oleg commented ·

Hi @Embbnux Ji, Thanks for your explanations, now I understand how it works. I will try to implement it

0 Likes 0 ·

Developer sandbox tools

Using the RingCentral Phone for Desktop, you can dial or receive test calls, send and receive test SMS or Fax messages in your sandbox environment.

Download RingCentral Phone for Desktop:

Tip: switch to the "sandbox mode" before logging in the app:

  • On MacOS: press "fn + command + f2" keys
  • On Windows: press "Ctrl + F2" keys