# iOS Lock V2: Refresh token

**URL:** <https://community.auth0.com/t/ios-lock-v2-refresh-token/8122>\
**Category:** Get Help\
**Tags:** swift, v2, lock, ios\
**Created:** [September 8, 2017, 12:09am UTC](https://community.auth0.com/t/ios-lock-v2-refresh-token/8122 "2017-09-08T00:09:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ankit1](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@ankit1](https://community.auth0.com/u/ankit1)\
**Post date:** [September 8, 2017, 12:09am UTC](https://community.auth0.com/t/ios-lock-v2-refresh-token/8122/1 "2017-09-08T00:09:22Z")

</div>

Hi,

How to refresh token in auth0 lock v2. I tried to use the delegation api like this

```
Auth0
                    .authentication(clientId: "clientID", domain: "domain")

                    .delegation(withParameters: "refresh_token" : "refresh Token"])

```

But JWT id token generated by this process doe not contain all the information. So basically there is difference in payload of JWT id token generated during login and refresh token via delegation.

Please enlighten me on this.

Thanks

Ankit

---

<div class="post-metadata">

**Author:** ![walsh](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/walsh/32/7074_2.png) [@walsh](https://community.auth0.com/u/walsh)\
**Post date:** [September 9, 2017, 3:55am UTC](https://community.auth0.com/t/ios-lock-v2-refresh-token/8122/2 "2017-09-09T03:55:51Z")

</div>

I wouldn’t recommend the older `delegation` method, take a look at the [iOS Swift User Sessions QuickStart](https://auth0.com/docs/quickstart/native/ios-swift/03-user-sessions). This covers using the `renew` method to return a new token using the `refresh_token` and comes with complete sample source code.

---

<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:56am UTC](https://community.auth0.com/t/ios-lock-v2-refresh-token/8122/3 "2018-03-02T05:56:23Z")

</div>


