# Twitter Login Not Working On Android

**URL:** <https://community.auth0.com/t/twitter-login-not-working-on-android/10385>\
**Category:** Get Help\
**Tags:** android\
**Created:** [March 26, 2018, 1:52pm UTC](https://community.auth0.com/t/twitter-login-not-working-on-android/10385 "2018-03-26T13:52:28Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![shoutapp](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/shoutapp/32/10120_2.png) [@shoutapp](https://community.auth0.com/u/shoutapp)\
**Post date:** [March 26, 2018, 1:52pm UTC](https://community.auth0.com/t/twitter-login-not-working-on-android/10385/1 "2018-03-26T13:52:28Z")

</div>

Hi.

We have a problem where Twitter login is not working on Android. We can test it using the “Try” button in Auth0 dashboard successfully. We can also log in on a web browser, but not in Android as we get the following error:

> “Cannot GET /android/io.shoutapp.shout/callback”

upon pressing the twitter button, before even being presented with a login page for twitter (possibly because I’m already logged in with twitter on the phone).

Our login code is:

```
        Auth0 auth0 = new Auth0(getString(R.string.com_auth0_client_id), getString(R.string.com_auth0_domain));
    auth0.setOIDCConformant(true);
    lock = Lock.newBuilder(auth0, callback)
            .withAudience("https://api.shoutapp.io/")
            .build(this);
    startActivity(lock.newIntent(this));

```

---

<div class="post-metadata">

**Author:** ![kimcodes](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/kimcodes/32/81052_2.png) [@kimcodes](https://community.auth0.com/u/kimcodes)\
**Post date:** [March 28, 2018, 3:37pm UTC](https://community.auth0.com/t/twitter-login-not-working-on-android/10385/3 "2018-03-28T15:37:31Z")

</div>

👋 @shoutapp

Is it just the Twitter login that is not working on your Android application? Do you have other logins that are working?

Can you check if you have a [`LockCallback`](https://auth0.com/docs/libraries/lock-android/v2#authentication-callback) implementation? If you could please share that here it might help.

---

<div class="post-metadata">

**Author:** ![shoutapp](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/shoutapp/32/10120_2.png) [@shoutapp](https://community.auth0.com/u/shoutapp)\
**Post date:** [March 28, 2018, 4:25pm UTC](https://community.auth0.com/t/twitter-login-not-working-on-android/10385/4 "2018-03-28T16:25:20Z")

</div>

Correct, It’s just twitter. Facebook and google work fine, as do standard login.

Here is the callback:

```
private LockCallback callback = new AuthenticationCallback() {
    @Override
    public void onAuthentication(Credentials credentials) {
        //Authenticated
        jwt = new JWT(credentials.getIdToken());
        androidAuthName = jwt.getClaim("name").asString();
        androidAuthToken = credentials.getAccessToken();
        loggedIn = true;
        webView.loadUrl(String.format(SHOUT_APP_URL, androidAuthToken, androidAuthName, URL_PARAMS));
    }

```

…

---

<div class="post-metadata">

**Author:** ![kimcodes](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/kimcodes/32/81052_2.png) [@kimcodes](https://community.auth0.com/u/kimcodes)\
**Post date:** [March 28, 2018, 5:55pm UTC](https://community.auth0.com/t/twitter-login-not-working-on-android/10385/5 "2018-03-28T17:55:28Z")

</div>

@shoutapp thanks for sharing the LockCallback!

From the error message you provided in your first message, `“Cannot GET /android/io.shoutapp.shout/callback”`, it could be that the response was supposed to be handled by the app and not the browser, which may happen if the browser is opening all https schemas by default or if the “Open with” popup showed up and the browser was selected. You could try using a [custom scheme](https://auth0.com/docs/libraries/lock-android/v2#android-app-links-custom-scheme).

Is this a continuous issue with Twitter or does it only happen sometimes? If it’s the later is it a bit random even on the same device? Any particular version of Android?

---

<div class="post-metadata">

**Author:** ![shoutapp](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/shoutapp/32/10120_2.png) [@shoutapp](https://community.auth0.com/u/shoutapp)\
**Post date:** [April 3, 2018, 9:33am UTC](https://community.auth0.com/t/twitter-login-not-working-on-android/10385/8 "2018-04-03T09:33:29Z")

</div>

@kimcodes just to add, the app is, as you can tell from the code, a webview. That callback error is actually appearing in the webview, not in the browser if that’s what you mean? Which i think is correct, as the google and facebook login stuff appears to work within the app, calling a “custom chrome tab”

Also, It seems to be all versions of android with Twitter all of the time

---

<div class="post-metadata">

**Author:** ![kimcodes](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/kimcodes/32/81052_2.png) [@kimcodes](https://community.auth0.com/u/kimcodes)\
**Post date:** [April 3, 2018, 2:17pm UTC](https://community.auth0.com/t/twitter-login-not-working-on-android/10385/9 "2018-04-03T14:17:26Z")

</div>

Gotcha! What version of Lock.Android are you using in your build.gradle file?

---

<div class="post-metadata">

**Author:** ![shoutapp](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/shoutapp/32/10120_2.png) [@shoutapp](https://community.auth0.com/u/shoutapp)\
**Post date:** [April 3, 2018, 4:07pm UTC](https://community.auth0.com/t/twitter-login-not-working-on-android/10385/10 "2018-04-03T16:07:59Z")

</div>

Looks like I was just setting it to ‘com.auth0.android:lock:2.+’ - which I believe compiled to 2.8.3.

(p.s thank you for continuing to help with this)

---

<div class="post-metadata">

**Author:** ![shoutapp](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/shoutapp/32/10120_2.png) [@shoutapp](https://community.auth0.com/u/shoutapp)\
**Post date:** [April 6, 2018, 11:05am UTC](https://community.auth0.com/t/twitter-login-not-working-on-android/10385/11 "2018-04-06T11:05:34Z")

</div>

@kimcodes Looks like I was just setting it to ‘com.auth0.android:lock:2.+’ - which I believe compiled to 2.8.3.

(p.s thank you for continuing to help with this)

---

<div class="post-metadata">

**Author:** ![kimcodes](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/kimcodes/32/81052_2.png) [@kimcodes](https://community.auth0.com/u/kimcodes)\
**Post date:** [April 6, 2018, 2:01pm UTC](https://community.auth0.com/t/twitter-login-not-working-on-android/10385/13 "2018-04-06T14:01:34Z")

</div>

@shoutapp great! thanks for checking that for me. I apologize for the delay I must have missed the notification. Let me give it a try on my end. Ill get back to you shortly.

---

<div class="post-metadata">

**Author:** ![shoutapp](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/shoutapp/32/10120_2.png) [@shoutapp](https://community.auth0.com/u/shoutapp)\
**Post date:** [April 10, 2018, 8:23am UTC](https://community.auth0.com/t/twitter-login-not-working-on-android/10385/14 "2018-04-10T08:23:06Z")

</div>

@kimcodes That would be great, thank you 🙂

---

<div class="post-metadata">

**Author:** ![shoutapp](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/shoutapp/32/10120_2.png) [@shoutapp](https://community.auth0.com/u/shoutapp)\
**Post date:** [April 12, 2018, 8:41am UTC](https://community.auth0.com/t/twitter-login-not-working-on-android/10385/15 "2018-04-12T08:41:39Z")

</div>

@kimcodes Any luck?

Wayne

---

<div class="post-metadata">

**Author:** ![kimcodes](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/kimcodes/32/81052_2.png) [@kimcodes](https://community.auth0.com/u/kimcodes)\
**Post date:** [April 12, 2018, 1:10pm UTC](https://community.auth0.com/t/twitter-login-not-working-on-android/10385/16 "2018-04-12T13:10:20Z")

</div>

@shoutapp apologize for the delay! I wasn’t able to reproduce the issue for my version, but it may just be a simple difference. Let me reply to your DM!

---

<div class="post-metadata">

**Author:** ![shoutapp](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/shoutapp/32/10120_2.png) [@shoutapp](https://community.auth0.com/u/shoutapp)\
**Post date:** [April 17, 2018, 1:44pm UTC](https://community.auth0.com/t/twitter-login-not-working-on-android/10385/17 "2018-04-17T13:44:34Z")

</div>

FYI to anyone reading this topic. @kimcodes kindly solved this issue by pointing out that we could set the scheme to a custom and arbitary string, as long as it matched in; the manifest, the lock initialisation code, and the dashboard callbacks.

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [December 17, 2018, 10:26am UTC](https://community.auth0.com/t/twitter-login-not-working-on-android/10385/18 "2018-12-17T10:26:06Z")

</div>


