I can log out as follows: At login time, I store the token in localStorage and in the logout method, I did as follows:
//LOGOUT GOOGLE
const token = await AsyncStorage.getItem("@ellot:googleAccessToken");
if (token) {
try {
await AuthSession.revokeAsync({ token }, { revocationEndpoint: 'https://oauth2.googleapis.com/revoke' });
await AsyncStorage.removeItem("@my:googleAccessToken");
} catch (error) {
console.log('ERROR XXX', error)
}
}
//LOGOUT GOOGLE
Answer from Edinho Rodrigues on Stack Overflow
» npm install expo-auth-session
I'm using Azure B2C to authenticate, and once the user logs in B2C adds a cookie to the system browser.
The problem I'm having, after the users logs out of the app, and goes to re-login, they're automatically authenticated without being prompted for their credentials.
I'm using expo and can't seem to figure out how to fully "logout."
I've tried revokeAsync with AuthSession, as well as React Native Cookies to attempt to remove the cookie with no success.
How is this usually handled?
Any help appreciated!
Hello,
I hope someone can help with this expo issue.
I am trying to use the expo-auth-session to implement SSO with Facebook and getting the following message. Looking at the URL, it seems like it's able to retrieve the access_token from Facebook but something is throwing it off...
I saw a couple of articles on this error and they suggest to use the proxy parameter. But this field was obsolete and removed from the version i am using...
anybody has any idea what's going on??
Minimal reproducible example
https://gist.github.com/PotatoPope/8763ee032673c020670fa821ad1a2583
Summary
Our app uses a third-party OAuth Provider, we manage to log into the provider, but after the login we encounter a bug during the redirect.
The Bug
When using promptAsync to get a response when logging in with oauth2 on Android, the function returns dismiss. Normally dismiss happens when a user exits the login flow halfway, however in this case the login is completed successfully. The flow works fine on iOS. On emulator the flow stops up with a chrome error: cache miss or invalid url scheme. On a physical phone to flow manages to get back to the app with the response with type dismiss.
Expo SDK 49
After attempting to upgrade to Expo SDK 49 in order to fix the bug, another bug appeared:
[Error: Call to function 'ExpoWebBrowser.openBrowserAsync' has been rejected. → Caused by: No matching browser activity found]
Possible causes
The response will be dismiss on Android whenever the app is returned to before the redirect handler is called. Because the intent filter in the manifest is misconfigured it will never be hit on standalone apps, and always returns dismiss. Reference: https://github.com/expo/expo/issues/12044
Maybe the dismiss response is simply a correlation, and not a cause. There might be a problem with the redirection or the token which causes an auto-dismiss.
What I’ve tried
Adding promptAsync(discovery, { useProxy, showInRecents:true });
Adding a timeout to promptasync, in case it didn’t get enough time.
Added scheme to app.json, tried different variations of scheme name
Upgraded Expo SDK, and expo-auth-session
Experimented with different android models and os versions, as well as multiple physical phones.
Created a build, using our keystore
Tried multiple browsers.
Changed parameters in the authReqConfig.
Useful threads
https://github.com/expo/expo/issues/6679#issuecomment-570963717
https://github.com/expo/expo/issues/12044
https://stackoverflow.com/questions/66080607/expo-authsession-returns-dismiss-on-android-device
Environment
expo-env-info 1.0.5 environment info:
System:
OS: macOS 13.4
Shell: 5.9 - /bin/zsh
Binaries:
Node: 16.19.1 - ~/.nvm/versions/node/v16.19.1/bin/node
Yarn: 1.22.19 - /opt/homebrew/bin/yarn
npm: 8.19.3 - ~/.nvm/versions/node/v16.19.1/bin/npm
Watchman: 2023.07.10.00 - /opt/homebrew/bin/watchman
Managers:
CocoaPods: 1.12.1 - /opt/homebrew/bin/pod
SDKs:
iOS SDK:
Platforms: DriverKit 22.2, iOS 16.2, macOS 13.1, tvOS 16.1, watchOS 9.1
IDEs:
Android Studio: 2022.2 AI-222.4459.24.2221.9862592
Xcode: 14.2/14C18 - /usr/bin/xcodebuild
npmPackages:
expo: ~48.0.0 => 48.0.20
react: 18.2.0 => 18.2.0
react-native: 0.71.8 => 0.71.8
npmGlobalPackages:
eas-cli: 3.17.0
expo-cli: 6.3.9
Expo Workflow: managed
Link to github issue: https://github.com/expo/expo/issues/23781