# Android force update token

**URL:** <https://community.auth0.com/t/android-force-update-token/92350>\
**Category:** Get Help\
**Tags:** android, refresh-tokens, auth0\
**Created:** [October 13, 2022, 4:39pm UTC](https://community.auth0.com/t/android-force-update-token/92350 "2022-10-13T16:39:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kotya341](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/kotya341/32/40574_2.png) [@kotya341](https://community.auth0.com/u/kotya341)\
**Post date:** [October 13, 2022, 4:39pm UTC](https://community.auth0.com/t/android-force-update-token/92350/1 "2022-10-13T16:39:17Z")

</div>

I’m working on migration of ipd provider for our android app

Please include the following information in your post:

- we are using android sdk com.auth0.android:auth0
- com.auth0.android:auth0:2.8.0
- mid sdk version is 26

I’m looking for a mechanism to force update the token,  
our [old provider](https://github.com/openid/AppAuth-Android/blob/master/library/java/net/openid/appauth/AuthState.java#L367) had this flag, which was triggered when server returned 401.  
I’m looking for a way to implement similar logic with a new provider.

Could you please give me some tips or point to direction?  
just simply call

> SecureCredentialsManager().clearCredentials()

would fully log out a user

---

<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:** [October 14, 2022, 11:21pm UTC](https://community.auth0.com/t/android-force-update-token/92350/3 "2022-10-14T23:21:18Z")

</div>

Hey there @kotya341 welcome to the community!

> [@kotya341](#):
>
> I’m looking for a mechanism to force update the token,  
> our [old provider](https://github.com/openid/AppAuth-Android/blob/master/library/java/net/openid/appauth/AuthState.java#L367) had this flag, which was triggered when server returned 401.  
> I’m looking for a way to implement similar logic with a new provider.

Auth0 provides a similar approach using refresh tokens - Please see the following:

> **[GitHub - auth0/Auth0.Android: Android toolkit for Auth0 API](https://github.com/auth0/Auth0.Android#usage)**
>
> Android toolkit for Auth0 API. Contribute to auth0/Auth0.Android development by creating an account on GitHub.

Essentially, if you request the `offline_access` scope a refresh token will be saved and automatically used to request new tokens when needed.

---

<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:** [November 3, 2022, 10:47pm UTC](https://community.auth0.com/t/android-force-update-token/92350/4 "2022-11-03T22:47:37Z")

</div>

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