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

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.

Did you solve this?

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 -->`

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.

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

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

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?

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?