# Refresh token within Ionic App

**URL:** <https://community.auth0.com/t/refresh-token-within-ionic-app/7498>\
**Category:** Get Help\
**Tags:** renewauth, ionic2, auth0js\
**Created:** [July 13, 2017, 11:09am UTC](https://community.auth0.com/t/refresh-token-within-ionic-app/7498 "2017-07-13T11:09:56Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![dan.kellett](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@dan.kellett](https://community.auth0.com/u/dan.kellett)\
**Post date:** [July 13, 2017, 11:09am UTC](https://community.auth0.com/t/refresh-token-within-ionic-app/7498/1 "2017-07-13T11:09:56Z")

</div>

Is it possible to refresh a token within a Ionic/Cordova app? I’m looking at the renewAuth function in auth0.js, but not sure what the config object values should be. Specifically the redirectUri value.

---

<div class="post-metadata">

**Author:** ![jmangelo](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jmangelo/32/7923_2.png) [@jmangelo](https://community.auth0.com/u/jmangelo)\
**Post date:** [July 13, 2017, 2:55pm UTC](https://community.auth0.com/t/refresh-token-within-ionic-app/7498/2 "2017-07-13T14:55:00Z")

</div>

The `renewAuth` function in Auth0.js is meant for web applications as it performs its work by leveraging an hidden iframe.

If you’re developing a mobile application and you already have a refresh token then the last step, the refresh request, can be made with any library that is able to perform an HTTP request. You can check the [reference documentation on using a refresh token](https://auth0.com/docs/tokens/refresh-token/current#use-a-refresh-token) which includes examples in various languages/platforms. Although we have a [library for Cordova](https://github.com/auth0/auth0-cordova) applications `auth0-cordova`, at this time, it does not seem to include a utility method to refresh tokens. The library does handle the PKCE exchange which is the most complex part of the process so it’s still beneficial to use that library and then just do an HTTP request to the token endpoint.

---

<div class="post-metadata">

**Author:** ![dan.kellett](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@dan.kellett](https://community.auth0.com/u/dan.kellett)\
**Post date:** [July 13, 2017, 8:46pm UTC](https://community.auth0.com/t/refresh-token-within-ionic-app/7498/3 "2017-07-13T20:46:25Z")

</div>

Ok thanks, nothing in the sdk to help so I’ll call the auth0 api directly. I don’t intend to use PKCE since it is really awkward UX and maintenance - and I don’t intend to use social media login.

Thanks for the help!

---

<div class="post-metadata">

**Author:** ![dan.kellett](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@dan.kellett](https://community.auth0.com/u/dan.kellett)\
**Post date:** [July 13, 2017, 8:46pm UTC](https://community.auth0.com/t/refresh-token-within-ionic-app/7498/4 "2017-07-13T20:46:25Z")

</div>

Ok thanks, nothing in the sdk to help so I’ll call the auth0 api directly. I don’t intend to use PKCE since it is really awkward UX and maintenance - and I don’t intend to use social media login.

Thanks for the help!

---

<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:** [March 2, 2018, 5:55am UTC](https://community.auth0.com/t/refresh-token-within-ionic-app/7498/5 "2018-03-02T05:55:21Z")

</div>


