# iOS Auth0 v2 refresh idToken

**URL:** <https://community.auth0.com/t/ios-auth0-v2-refresh-idtoken/6792>\
**Category:** Get Help\
**Tags:** idtoken, swift, ios\
**Created:** [May 30, 2017, 1:46pm UTC](https://community.auth0.com/t/ios-auth0-v2-refresh-idtoken/6792 "2017-05-30T13:46:55Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![phramealpha](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@phramealpha](https://community.auth0.com/u/phramealpha)\
**Post date:** [May 30, 2017, 1:46pm UTC](https://community.auth0.com/t/ios-auth0-v2-refresh-idtoken/6792/1 "2017-05-30T13:46:55Z")

</div>

I have a question regarding Auth0 v2 for iOS, how to renew the idToken?

I am using renew(withRefreshToken refreshToken: String, scope: String?) method with refreshToken, but it’s only returning new accessToken, and I need idToken. In v1 there was a method fetchNewIdTokenWithRefreshToken, but how to do this in v2?

Thanks

---

<div class="post-metadata">

**Author:** ![phramealpha](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@phramealpha](https://community.auth0.com/u/phramealpha)\
**Post date:** [May 31, 2017, 6:35pm UTC](https://community.auth0.com/t/ios-auth0-v2-refresh-idtoken/6792/2 "2017-05-31T18:35:11Z")

</div>

I’ve managed to obtain new idToken using `delegation`, maybe it’ll be helpful for someone, so I’m posting it below:

```
Auth0
		.authentication()
		.delegation(withParameters: "refresh_token": refreshToken])
		.start { result in
			switch result {
			case .success(let data):
				guard let idToken = data"id_token"] as? String else {
					// No id token
					return
				}
				
				// Save your idToken
			case .failure(let error):
				print(error.localizedDescription)
			}
	}

```

---

<div class="post-metadata">

**Author:** ![ankit](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@ankit](https://community.auth0.com/u/ankit)\
**Post date:** [August 17, 2017, 8:59pm UTC](https://community.auth0.com/t/ios-auth0-v2-refresh-idtoken/6792/3 "2017-08-17T20:59:46Z")

</div>

I’m getting this in response

> {“error”:“invalid\_request”,“error\_description”:“Cannot  
> set property  
> ‘undefinedorganization\_uri’ of  
> undefined”,“statusCode”:400}

---

<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:54am UTC](https://community.auth0.com/t/ios-auth0-v2-refresh-idtoken/6792/4 "2018-03-02T05:54:11Z")

</div>


