Skip to content
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

Cannot GET /android on specific "facebook" connection #49

Closed
vishal-i4gs opened this issue Jul 13, 2017 · 9 comments
Closed

Cannot GET /android on specific "facebook" connection #49

vishal-i4gs opened this issue Jul 13, 2017 · 9 comments

Comments

@vishal-i4gs
Copy link

On the WebAuthProvider part if I add .withConnection("facebook") and my chrome browser logs into facebook for the first time, it works fine and redirects to my app but if my browser is already logged into facebook and I try authlogin, the browser does not redirect to the app, It tells Cannot GET/ android.

@lbalmaceda
Copy link
Contributor

@vishal-i4gs That's weird.. but I could reproduce it. The issue is probably in the auth0.android SDK. While we investigate, either downgrade to version 1.8.0 which is not using Chrome Custom Tabs or override the RedirectActivity's intent-filter using a custom scheme (follow this doc). Keep in mind that changing the scheme will impact in i) manually adding the intent-filter, overriding the RedirectActivity's, ii) changing the callback URL in your client's dashboard and iii) calling .withScheme("yourscheme") on the WebAuthProvider builder.

@vishal-i4gs
Copy link
Author

vishal-i4gs commented Jul 14, 2017

@lbalmaceda I actually downgraded the version to 1.8.0 and it seems to be fine.

@x-cray
Copy link

x-cray commented Aug 16, 2017

Spent half the day until I found this issue. Setting custom scheme works well for me.

@iX21Mobile
Copy link

iX21Mobile commented Dec 15, 2017

Settings a custom scheme doesn't seem to work anymore... I get a blank page instead of the error and I'm not able to log in.
I reproduce this behavior on different Android version. I use Lock : com.auth0.android:lock:2.8.0. For google and facebook socials
Did anyone encounter the same issue ?

@wazcov
Copy link

wazcov commented Apr 17, 2018

@iX21Mobile I've just solved this issue myself. You have to set a custom scheme in 3 places:

  1. In the build.gradle file - manifestPlaceholders = [auth0Domain: "shoutapp.eu.auth0.com", auth0Scheme: "XXX"],

  2. The lock initialisation code - lock = Lock.newBuilder(auth0, callback).withScheme("XXX")

  3. In your Auth0 Dashboard, under callback urls like XXX://domain.eu.auth0.com/android/com.domain.app/callback,

If you use an old version of lock, you also need to add a data element to the intent-filter in the manifest:
<data android:host="@string/com_auth0_domain" android:pathPrefix="/android/${applicationId}/callback" android:scheme=“XXX” />

Note XXX can be literally anything - even XXX itself

@lbalmaceda
Copy link
Contributor

All this is already explained in the sdk library readme, in the lock library readme and in the android quickstarts introduction. If you run into any issues don't hesitate opening a new issue in the corresponding library repo so we can track it, or contact our amazing team at https://support.auth0.com.

@NivaLevy
Copy link

NivaLevy commented Jul 4, 2018

@wayneio adding- scheme must be low case string

@sharukhmohammed
Copy link

I have used the scheme as a lower case 'xxx' and it works fine but it throws me up a new error.

E/OAuthManager: Received state doesn't match. Received VikZhSyOD0MBxkiPG7swzaQsc2yAuM6s2Y3jn_m3yfU but expected On7vaXLWhWslEoh8ly0e9eFxhboZktfjyh_MXk3nULo
W/System.err: com.auth0.android.authentication.AuthenticationException: An error occurred when trying to authenticate with the server.
W/System.err:     at com.auth0.android.provider.OAuthManager.assertValidState(OAuthManager.java:187)
W/System.err:     at com.auth0.android.provider.OAuthManager.resumeAuthorization(OAuthManager.java:120)
W/System.err:     at com.auth0.android.provider.WebAuthProvider.resume(WebAuthProvider.java:389)
W/System.err:     at com.auth0.android.provider.AuthenticationActivity.deliverSuccessfulAuthenticationResult(AuthenticationActivity.java:126)
W/System.err:     at com.auth0.android.provider.AuthenticationActivity.onResume(AuthenticationActivity.java:85)
W/System.err:     at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1413)
W/System.err:     at android.app.Activity.performResume(Activity.java:7366)
W/System.err:     at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3816)
W/System.err:     at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3856)
W/System.err:     at android.os.Handler.dispatchMessage(Handler.java:106)
W/System.err:     at android.os.Looper.loop(Looper.java:201)
W/System.err:     at android.app.ActivityThread.main(ActivityThread.java:6806)
W/System.err:     at java.lang.reflect.Method.invoke(Native Method)
W/System.err:     at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)
W/System.err:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:873)

I cannot find any docs/discussions nor have any leads. Any help would be appreciated.

@paixols
Copy link

paixols commented Feb 26, 2019

If using web WebAuthProvider, we also need to include:

WebAuthProvider.withScheme("XXX")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants