-
-
Notifications
You must be signed in to change notification settings - Fork 216
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
Unable to get proper response post authentication on auth server #36
Comments
@i1990jain please attach more info, what platform are you testing? |
About the redirection, try using |
I am testing both on android and iOS |
well this is regarding the app I am talking about the fact that once the user is authenticated on the laravel based website which is open in the inappbrowser in am responding with |
About the redirect, it's different per platform:
Do you have the deep linking configuration already for Android (AndroidManifest.xml) and iOS (Info.plist)? |
yes I have configured these and the server responds based on the platform ... but in either of the case I just get type:dismiss as the result in the function
|
Android 8.0.0 |
Cannot you just give a brief explaination about what and in which way the response should be returned from the server ? |
we have a redirection from the server to the deep linking of the app and when that url is detected by the plugin, the following response is returned: |
I tried a lot of different ways of sending back the redirect from the browser, it always got me
|
I think we get |
Very odd because we have the same configuration with Linking here https://github.com/proyecto26/react-native-inappbrowser/blob/master/index.js#L119 |
Can you debug from the plugin and please let me know? |
Ok so I tried using the same with iOS and it works perfectly but still I haven't been able to get it working for android
Also for the confguration of the android app I have MainApplication.java and MainActivity.java
and my utilities.js
would like to repeat that it is working fine in iOS ... but in android I am unable to get a proper response and have to use the Linking eventListener to get the incoming url |
What's the redirection used from the server in the case of Android? |
I am redirecting to |
mmm very odd, we have this Android intent:
|
even after adding android:pathPrefix="" it still gets me {type : dismiss} |
can you debug and put a breakpoint here? https://github.com/proyecto26/react-native-inappbrowser/blob/master/index.js#L114 |
same issue, I encountered. |
@sdsd08013 please debug and let me know 🙏 |
Any help is really appreciated! |
Ohhh you can't use |
Encountered the same issue without |
@jdnichollsc can you tell me what info you need from debugging, and is it native debug or js debug? I tried almost everything the result is always "dismiss". Also, I noticed that android:launchMode="singleTask"is present in the example app, but same thing happens with or without it. |
@viewpnt1 let me know the url to debug your authentication because in my case it's working as expected, we're using okta to authenticate the users and the deep linking redirection works very well :) |
What happens if the browser is closed but the redirection never responds? Because we have a conditional here to detect deep linking redirection:
Can you share your code? You can only call |
@jdnichollsc Could you have a look at my PR? Tell me what you think about my fixes! 🙂 |
Same issue here .. :( Working fine on IOS but getting { type: dismiss } on android. |
I got tired of trying to find a solution, a workaround is to do.
|
Ok guys, debug develop branch and let me know if this PR works for you https://github.com/proyecto26/react-native-inappbrowser/pull/103/files |
Check the last version 3.1.0 and let me know 👍 |
Just tested |
Damn... I also ran this example configured by you https://github.com/proyecto26/react-native-inappbrowser/blob/master/example/App.js#L104 and I've got the same problem. This is really blocking sadly :( |
@giacomocerquone do you have more than 1 redirect in your login flow? |
@viewpnt1 as I said, I'm using the example https://github.com/proyecto26/react-native-inappbrowser/blob/master/example/App.js#L104 and as you can see there is 1 redirect in that login flow. Plus I tried the deep link externally (just using Linking.openURL) and it is working. So can't understand why it's crashing... |
@jdnichollsc very good news guys! I previously updated my last comment saying that probably the problem relied in the Android API's I was using, but actually I was wrong. The broken thing, at least for me, was this page here put up by the owner of this lib: https://github.com/proyecto26/react-native-inappbrowser/blob/gh-pages/index.html Basically the way he links back to the app is faulty and it can crash your app and result in a "dismissed" action for the lib (at least restructuring that in another way, didn't let my app crash or report a dismissed inappbrowser). Now, what this probably means? UPDATE: not working with
damn... same crash and same "dismissed" alert when I open it back UPDATE2: If you find a way, let us know :) |
It looks like JS redirections doesn't work in the case of Android, only works with redirections from backend (HTTP 302), check for more details => https://stackoverflow.com/a/41882732/1532821 |
@jdnichollsc yes, in fact attaching the deep link url directly to auth0 (they obviously use a 302) it works gracefully UPDATE: I saw you already updated the example :) |
Can you debug from Android Studio? Maybe using a redirection from backend is much better from the example |
I am still facing same issue of "type:dismiss", has this issue already been fixed? Can anyone help me with it please? |
@andresubri thanks for your help, it was fixed in the last version 3.3.0, let me know 👍 https://github.com/proyecto26/react-native-inappbrowser/releases/tag/v3.3.0 |
@jdnichollsc I've just updated to version 3.3.0 and the issue of "type:dismiss" persists in Android. Can you please help me with this? |
Please share more details of your error because I don't know what version of Android you're using, the backend redirection logic you have, the deep linking configuration you did in your project, etc 😅 |
Honestly @jdnichollsc I believe there is a huge misunderstanding with this library due to the example in the readme. I discovered this randomly after having spent a whole day to implement deep linking and the oatuh2 auth flow with an external provider. I ported an entire expo app to a bare react native app and I used this module to replace the "authsession" module. Do you confirm this or I'm wrong about something? The only other reason I can come up with is that deeplinking must be configured in order to have that response from the promise... is that it? |
I don't understand you because we have the same logic from Expo, you need to configure deep linking in your app to be able to redirect the users from browser to the app again and we fixed the race condition issue with the promise when the browser is opened from Android, so check again and let me know, you can debug the JS code of this library from your project (node_modules) using React Native Debugger tool and let us know if the new validation using Linking is not working as expected 🙂 https://github.com/expo/expo/blob/master/packages/expo-web-browser/src/WebBrowser.ts#L179 |
@zealgit please check the |
Sorry for the delay! Not appreciating the downvote, but still... This is one thing:
and this is another:
My question was: deep linking configuration is needed for both ways or just for the first one? |
The downvote is about this, we spent more days creating this library, so you can create any pull request if you see an opportunity for improvement in this plugin 👍 About |
Guys, FYI https://github.com/proyecto26/react-native-inappbrowser/releases/tag/v3.3.2 |
I am using the deep linking auth flow example mentioned in the description of the repo. I was able to successfully open the authentication flow in the browser. I am using a Laravel based server to authenticate the user. Once the user is autheticated the server responds with
return redirect('mobileapp://home?token='.$token);
when this happens the browser closes off but then
console.log(result);
shows metype:dismiss
as a result from the browser, I would also like to know if there is a possibility to handle the URL change in the browser component how we do with for WebViewonNavigationStateChange
with that way also I will have a possibility to see what is the current state of the browser and act accordingly.The text was updated successfully, but these errors were encountered: