
VasuT.19687 (Customer) asked a question.
On a single machine, in the same browser user1@fake.com logs on to OKTA, clicks on myAPP web application, the process will successfully takes user1@fake.com into myAPP.
Now user1@fake.com logs out of myAPP, user2@fake.com tried to login on the same tab or new tab in the same browser. When myAPP asks for user session from OKTA we get user1@fake.com session instead of redirecting user to OKTA login page.
What are the possible solutions ?
One solution I’m thinking, to make a call to OKTA get user profile and match certain parameters, preferably user name between myAPP and OKTA, if not matching , then auto logout of previous OKTA session and redirect user to OKTA login page.
To do this is there any API which can give user profile info based on user name and force logout of existing session of other user?

Hi Vasu,
You can use Okta session API to get current logged in user and you can also invalidate current session.
refer- https://developer.okta.com/docs/reference/api/sessions/
Get Current Session = GET {{url}}/api/v1/sessions/me
Clear Session = DELETE {{url}}/api/v1/sessions/{{sessionId}}
Clear User Sessions = DELETE {{url}}/api/v1/users/{{userId}}/sessions
Thanks Vipul.
The myAPP doesn't know the OKTA session id in my case, to do that i need to change the implementation to hold OKTA session id.
What's your general experience scenario's like this where users sharing a system and using the same browser or one user have multiple logins and switch between accounts ?
This is very unique scenario where multiple users share same browser to login to the same app. is this SAML based app? have you tried to use SLO (Single-Log-Out).
I have experience of using Okta Sign-In widget where i can call Logout method. It has very rich library you can play with.
I suggest you to use Okta Sign-In widget for your app Login Page. refer - https://developer.okta.com/code/javascript/okta_sign-in_widget/
logout() {
this.widget.signOut(() => {
this.setState({ user: null })
this.showLogin()
})
}
this SAML based app?
using OpenIdConnect
i was using widget., but upon client demands changed to re-direction to OKTA login page.