Auth0 Home Blog Docs

Android Facebook login CANNOT GET /android/package/callback error

android
login
error
facebook

#1

I’m trying to login using Facebook on my Android app, using:

            Auth0 auth0 = new Auth0(getString(R.string.auth0_client_id), getString(R.string.auth0_domain));
            WebAuthProvider.init(auth0)
                    .withConnection("facebook")
                    .start(LoginActivity.this, new AuthCallback() {
                        @Override
                        public void onFailure(@NonNull Dialog dialog) {
                            …
                        }
                        @Override
                        public void onFailure(AuthenticationException exception) {
                            …
                        }
                        @Override
                        public void onSuccess(@NonNull Credentials credentials) {
                            …
                        }
                    });

When running the app I’m prompted to login with Facebook, and after that, instead of returning to the app, I’m redirected to a page with the error: Cannot GET /android/[package-name]/callback?code=…]&state=…]

The [package-name] is the same that’s in the Android manifest.


#2

Did you solve this?


#3

Hi,

I’m experiencing this issue, but at some point I managed to get my test application working. Could it be that they are both using the same client?. Wondering if there are best places to debug other than just the callback URLs in auth0 and android manifest.

Callback: https://[domain]/android/[packagename]/callback

Manifest:`

    <activity
        android:name="com.auth0.android.lock.LockActivity"
        android:label="@string/app_name"
        android:launchMode="singleTask"
        android:screenOrientation="portrait"
        android:theme="@style/Lock.Theme">
        <intent-filter>
            <action android:name="android.intent.action.VIEW" />

            <category android:name="android.intent.category.DEFAULT" />
            <category android:name="android.intent.category.BROWSABLE" />

            <data
                android:host="@string/auth0_domain"
                android:pathPrefix="/android/[packagename]/callback"
                android:scheme="https" />
        </intent-filter>
    </activity>
    <activity
        android:name="com.auth0.android.provider.WebAuthActivity"
        android:theme="@style/Lock.Theme" />
    <!-- Auth0 Lock End -->`

#4

Figured out my issue. At some point I said use my browser as the default app for my application in dev. This caused it to not handle the callback properly.


#5

hi i’m getting the same error after login on facebook using android, how to fix this? please help


#6

i’m just following this https://auth0.com/docs/quickstart/native/android/00-centralized-login but still get the same error


#7

I get same error. This is my code:

WebAuthProvider.init(auth0)
                                    .withScheme("https")
                                    .withAudience(String.format("https://%s/userinfo", getString(R.string.com_auth0_domain)))
                                    .withScope("openid offline_access")
                                    .start(BaseActivity.this, new AuthCallback() {  .....

Did you solve it?


#8

I get same error. This is my code:

WebAuthProvider.init(auth0)
                                    .withScheme("https")
                                    .withAudience(String.format("https://%s/userinfo", getString(R.string.com_auth0_domain)))
                                    .withScope("openid offline_access")
                                    .start(BaseActivity.this, new AuthCallback() {  .....

Did you solve it?


#9