# Android Access Token Not Working

**URL:** <https://community.auth0.com/t/android-access-token-not-working/10387>\
**Category:** Get Help\
**Tags:** lock-android\
**Created:** [March 26, 2018, 1:55pm UTC](https://community.auth0.com/t/android-access-token-not-working/10387 "2018-03-26T13:55:56Z")\
**Posts on this page:** 4\
**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:55pm UTC](https://community.auth0.com/t/android-access-token-not-working/10387/1 "2018-03-26T13:55:56Z")

</div>

We have two login mechanisms. One is Lock for web, which works fine. The other is Lock for android. With this latter login system, the access token we are provided with does not seem to validate, in that our API throws a 401 error.

The code that DOES work in web:

```
this.lock = new Auth0Lock(
    'xxxxx',
    'shoutapp.eu.auth0.com',
    this.lockOptions
);
this.lock.on("authenticated", $.proxy(this.onLockAuthenticated, this));
...
   localStorage.setItem('accessToken', authResult.accessToken);

```

The code that DOES NOT work in Android:

```
        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:** ![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 4, 2018, 8:50am UTC](https://community.auth0.com/t/android-access-token-not-working/10387/7 "2018-04-04T08:50:53Z")

</div>

Does anyone have any ideas?

---

<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, 9:53am UTC](https://community.auth0.com/t/android-access-token-not-working/10387/8 "2018-04-10T09:53:52Z")

</div>

FYI incase anyone has this issue in future, I had to remove the audience paramater. I’m not sure why that fixed it, but it did!

as in:

lock = Lock.newBuilder(auth0, callback)  
_//.withAudience(“[https://api.xxxx/](https://api.xxxx/)”)_  
.build(this);

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [September 6, 2018, 12:20pm UTC](https://community.auth0.com/t/android-access-token-not-working/10387/9 "2018-09-06T12:20:36Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
