# Getting Valid IdToken ,But Invalid AccessToken

**URL:** <https://community.auth0.com/t/getting-valid-idtoken-but-invalid-accesstoken/83362>\
**Category:** Get Help\
**Tags:** jwt, login, auth0\
**Created:** [May 12, 2022, 5:39pm UTC](https://community.auth0.com/t/getting-valid-idtoken-but-invalid-accesstoken/83362 "2022-05-12T17:39:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![thupili\_charwaka](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/thupili_charwaka/32/13837_2.png) [@thupili\_charwaka](https://community.auth0.com/u/thupili_charwaka)\
**Post date:** [May 12, 2022, 5:39pm UTC](https://community.auth0.com/t/getting-valid-idtoken-but-invalid-accesstoken/83362/1 "2022-05-12T17:39:41Z")

</div>

Please include the following information in your post:

- Which SDK this is regarding:  
[GitHub - auth0/Auth0.Android: Android toolkit for Auth0 API](https://github.com/auth0/Auth0.Android)
- SDK Version:  
Latest
- Platform Version:  
Android (Kotlin)

I built a custom UI in Android App which captures the User’s Mobile Number And OTP, and I am using  
**AuthenticationAPIClient** to send OTP and verify OTP ( [GitHub - auth0/Auth0.Android: Android toolkit for Auth0 API](https://github.com/auth0/Auth0.Android/tree/main#authentication-api)), After verifying OTP successfully, I am getting an invalid access token and getting a valid ID token(when checked in [JWT.IO](http://JWT.IO)). not sure what’s going wrong,  
is there any way to pass “Audience” using AuthenticationAPIClient? , is this the proper way to do it?

---

<div class="post-metadata">

**Author:** ![ty.frith](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ty.frith/32/58484_2.png) [@ty.frith](https://community.auth0.com/u/ty.frith)\
**Post date:** [May 13, 2022, 11:08pm UTC](https://community.auth0.com/t/getting-valid-idtoken-but-invalid-accesstoken/83362/3 "2022-05-13T23:08:02Z")

</div>

Hello @thupili_charwaka welcome to the community!

> [@thupili\_charwaka](#):
>
> is there any way to pass “Audience” using AuthenticationAPIClient? , is this the proper way to do it?

I don’t believe there is - The recommended approach here is to use `WebAuthProvider` as outlined in our [Android quickstart](https://auth0.com/docs/quickstart/native/android/00-login?#add-login-to-your-app) - This method will use a call to `/authorize` where an audience param can be included. Please see our Android sample:

> <https://github.com/auth0-samples/auth0-android-sample/blob/ef848e9f6f317766e926a39ad5c6aa21fddf7031/00-Login-Kt/app/src/main/java/com/auth0/sample/MainActivity.kt#L63>

Hope this helps!

---

<div class="post-metadata">

**Author:** ![ty.frith](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ty.frith/32/58484_2.png) [@ty.frith](https://community.auth0.com/u/ty.frith)\
**Post date:** [May 28, 2022, 11:08pm UTC](https://community.auth0.com/t/getting-valid-idtoken-but-invalid-accesstoken/83362/4 "2022-05-28T23:08:39Z")

</div>

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