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
RingCentralSDK Authorization session management
Tags: sdk, authentication
Apr 19, 2022 at 3:57am   •   2 replies  •  0 likes
Polina Zubova

Hi all,

I need some assistance with login-logout flow with OAuth login flow.

As the user I want:

1. Login with one account.

2. Logout

3. Login with a different account


In the steps hire in code I use:

1. rcsdk.loginWindow and than make rcsdk.login (popup open, user login, it's okay)

2. rcsdk.logout

3. the same as 1 step

In the step 3 user see in pop up window 'Continue as' first account he used, it will not require any password.

Is there any way I can after logout in the new login not show user information about his previous login, just clean login?

Will appreciate your help on that.

on Apr 19, 2022 at 6:28am   •  1 likes

@Polina Zubova
The session details are saved in the cookie in the browser once the user logs in
Is your use case where multiple users can log in from the same browser on the same machine?
If that is not the case, any other user trying your app will still see a login screen since their browser cookie will not be set

on Apr 20, 2022 at 2:26am   •  0 likes

Hi @Yatin Gera ,

"Is your use case where multiple users can log in from the same browser on the same machine? "

yes, this is the case. Can I use some property in rcsdk.login or rcsdk.loginWindow to not store cookie in pop up?

1 Answer
answered on Apr 20, 2022 at 4:05am  

When you log in using OAuth, the session cookies are stored in the browser when you are redirected to the RingCentral auth page and successfully log in.
There is also your use case where multiple users might be using the same machine and browser instance to log into the app where the cookies will not be deleted by default.
From what I know, the SDK does not have such an option to force deleting the cookies.

There are 2 things you can do that I can think of right now

1. Make sure the logged-in user closes the browser after login. Closing the browser instance after they are done working should (from what I know) clear the cookies. That being said, this is a manual task

2. You might want to implement your own loginWindow This function will be exactly what the SDK does with the addition of clearing the cookies before closing the browser.
What that means is that your loginWindow method should be exactly like https://github.com/ringcentral/ringcentral-js/blob/3f0fbee8e5a31bca9e43a9f6fa7470fbfaf92b49/sdk/src/platform/Platform.ts#L348 with the addition of clear cookie at line 394

These are the 2 suggestions that I have right now. Maybe anyone else reading this could add more to it if they are aware of it

If you find this. helpful, kindly accept the answer for others to find it useful


 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