-
Notifications
You must be signed in to change notification settings - Fork 209
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
react-native-auth0 WebAuth popup #124
Comments
@pragadeesh0106 please can you tell us the steps to re-create, I presume you are using MFA. |
web view opening in the browser is not a issue . The auth0 page opens in a chrome web view and when i go check my otp in my messenger and come back to enter otp im not able to reopen that webview it closese automatically. |
We are seeing this issue as well. When using webAuth with Passwordless authentication on Android, the user is required to navigate out of the default system browser to retrieve the code from the user's email. Upon navigating back, the browser window where the code is meant to be entered has closed, and the authentication process cannot be completed. iOS works as expected |
Thanks, I'll have a run through this. |
@cocojoe in our case, we tracked the problem to be related to Chrome Custom Tabs being used in Android. Right now our workaround will be to disable Custom Tabs. |
@cocojoe what is the workaround to disable custom tabs does anyone know it ?? |
@pragadeesh0106 I guess in this method skip the "CustomTabsIntent" code and just start a new Intent with Action VIEW and the URL as URI, like it's done when the activity is null. |
@pragadeesh0106 @lbalmaceda yes, that's what we are doing. so we forked the library and removed the CustomTabsIntent part. |
I didn't get you can u explain clearly what to do and i am calling the auth0 from react native so should i do the changes in react native or the node modules of the react native auth0 |
@pragadeesh0106 you would fork react-native-auth0 library and edit your own fork. and then reference the fork from your package.json |
After forking what is the change to be done i didn't get that part. |
This is a workaround while we seek for a formal solution. You have to fork the repo and replace: if (activity != null) {
CustomTabsIntent.Builder builder = new CustomTabsIntent.Builder();
CustomTabsIntent customTabsIntent = builder.build();
customTabsIntent.intent.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY);
customTabsIntent.intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
customTabsIntent.launchUrl(activity, Uri.parse(url));
} else {
final Intent intent = new Intent(Intent.ACTION_VIEW);
intent.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY);
intent.setData(Uri.parse(url));
getReactApplicationContext().startActivity(intent);
} with final Intent intent = new Intent(Intent.ACTION_VIEW);
intent.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY);
intent.setData(Uri.parse(url));
getReactApplicationContext().startActivity(intent); then just build and reference the library locally |
intent.addFlags(Intent. FLAG_ACTIVITY_NEW_TASK); Above flag needs to be added and the it worked fine thank you. Is there any way to open it within the app instead of a browser. |
The only way would be through Custom Tabs as they open "in a separate activity" within your app. Use of the |
So your saying it is not possible. |
@pragadeesh0106 While technically it's possible to launch a WebView, this would be a pointless practice as OAuth authentication is not permitted using WebView. https://developers.googleblog.com/2016/08/modernizing-oauth-interactions-in-native-apps.html |
OK got it |
@pragadeesh0106 @cocojoe @lbalmaceda This issue should not be closed, there is no real fix for it yet |
Agreed |
@msalokangas @pragadeesh0106 I've proposed changes on #126. Feel free to try it and leave some feedback before we merge it. |
when this function is called the webauth is opened outside the app . So when i go check my otp and click recent tabs in my phone my app remains there but the auth0 webauth popup is missing .
If anyone knows how to solve the issue kindly help...
The text was updated successfully, but these errors were encountered: