# Can I get a long-lived refresh token for a Cordova/Ionic app using Auth0?

**URL:** <https://community.auth0.com/t/can-i-get-a-long-lived-refresh-token-for-a-cordova-ionic-app-using-auth0/50845>\
**Category:** Get Help\
**Tags:** spa, cordova, refresh-tokens\
**Created:** [October 1, 2020, 7:31pm UTC](https://community.auth0.com/t/can-i-get-a-long-lived-refresh-token-for-a-cordova-ionic-app-using-auth0/50845 "2020-10-01T19:31:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kazlauskis](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/kazlauskis/32/24625_2.png) [@kazlauskis](https://community.auth0.com/u/kazlauskis)\
**Post date:** [October 1, 2020, 7:31pm UTC](https://community.auth0.com/t/can-i-get-a-long-lived-refresh-token-for-a-cordova-ionic-app-using-auth0/50845/1 "2020-10-01T19:31:13Z")

</div>

It works well when using rotating refresh tokens but the problem is that the user would potentially have to re-login every 90 days (max expiry for rotating tokens).

Implementing Authorization Code Flow (PKCE) in a Cordova app sets ‘origin’ header in the requests and Auth0 then doesn’t include the refresh token. Omitting the origin header would work and if this was a native app then I think this would work.

Resource Owner Password flow would work too but this approach isn’t recommended.

So my question is can I get a long-lived refresh token for a Cordova/Ionic app using Auth0?

Thanks!

---

<div class="post-metadata">

**Author:** ![mohammadz](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/mohammadz/32/13482_2.png) [@mohammadz](https://community.auth0.com/u/mohammadz)\
**Post date:** [November 20, 2020, 6:50pm UTC](https://community.auth0.com/t/can-i-get-a-long-lived-refresh-token-for-a-cordova-ionic-app-using-auth0/50845/2 "2020-11-20T18:50:00Z")

</div>

I’m having the same issue using Ionic. I have my native app as OIDC conformant (I made this app in 2020 not 2017 so it’s not legacy) and have the advanced setting with the grant of refresh token enabled. For the scope in the app itself I use `scope: 'openid profile offline_access' ` this includes the offline\_access scope.I double checked the docs and this is related to getting the refresh token for the app. I have no rules or anything like setup so I don’t know why it’s not returning the refresh token.

---

<div class="post-metadata">

**Author:** ![mohammadz](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/mohammadz/32/13482_2.png) [@mohammadz](https://community.auth0.com/u/mohammadz)\
**Post date:** [November 20, 2020, 6:55pm UTC](https://community.auth0.com/t/can-i-get-a-long-lived-refresh-token-for-a-cordova-ionic-app-using-auth0/50845/3 "2020-11-20T18:55:14Z")

</div>

Looks like this [Refresh tokens · Issue #120 · auth0/auth0-cordova · GitHub](https://github.com/auth0/auth0-cordova/issues/120#issuecomment-592655457)  
answers my problem.
