[Android] signInWithBrowser (Social Sign In)
Hi Okta team,
So when using signInWithBrowser on Android is there a way to clear the session completely when logging out ? currently when logging out there is no way for me log out from (Facebook, gmail etc) when I try to login again it automatically logs me in unless I go to my chrome browser and sign me manually out from the service I am using (for instance google).
let me know if there is a workaround. On iOS it works fine. We are using okta-react-native 2.2.0, react-native 0.65.1.
Thanks,
hi @Qwin I'll see if I can run down an answer for you.
Hi @Qwin have you taken a look at the signOut method? https://github.com/okta/okta-react-native#signout
This should launch the browser (very briefly), and log you out of Okta from the browser side as well. Next time you try to log in, you should be presented with the Okta Sign In Widget to choose your login method (username/password, facebook, google, etc)
@JayNewstrom I see it opening the browser briefly, yet when I try to re-login, it still logs me in automatically, on iOS it does not.
Can you share a code snippet of how you're logging in?
@JayNewstrom will try to get you something tomorrow
I am also facing same issue.
we are facing the same issue, we are trying to clear if any previous session exists but it is not working as expected all the time. sometimes it is stucking at signout call. please help us
import {
EventEmitter,
createConfig,
getUser,
isAuthenticated,
signOut,
signInWithBrowser,
clearTokens,
} from '@okta/okta-react-native';
...
....
const oldOktaSession = await isAuthenticated();
if (oldOktaSession?.authenticated) {
await signOut().catch((e) => log.error(e));
}
await clearTokens().catch((e) => log.error(e));
await signInWithBrowser({noSSO: true});
...
...