# In Mobile Application - We need id\_token and refresh\_token during Social Login. There is also a requirement to get the latest id\_token using the refresh\_token

**URL:** <https://community.auth0.com/t/in-mobile-application-we-need-id-token-and-refresh-token-during-social-login-there-is-also-a-requirement-to-get-the-latest-id-token-using-the-refresh-token/8658>\
**Category:** Get Help\
**Tags:** social, refresh\_token\
**Created:** [November 2, 2017, 8:16pm UTC](https://community.auth0.com/t/in-mobile-application-we-need-id-token-and-refresh-token-during-social-login-there-is-also-a-requirement-to-get-the-latest-id-token-using-the-refresh-token/8658 "2017-11-02T20:16:55Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![aswin.kumar](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@aswin.kumar](https://community.auth0.com/u/aswin.kumar)\
**Post date:** [November 2, 2017, 8:16pm UTC](https://community.auth0.com/t/in-mobile-application-we-need-id-token-and-refresh-token-during-social-login-there-is-also-a-requirement-to-get-the-latest-id-token-using-the-refresh-token/8658/1 "2017-11-02T20:16:55Z")

</div>

In Mobile Application - We need id\_token and refresh\_token during Social Login. There is also a requirement to get the latest id\_token using the refresh\_token.

1. Since We are using Non-OIDC client we get refresh\_token and id\_token during Social Login. But we are not getting the latest id\_token using the refresh\_token - only latest access\_token is returned.

[http://community.auth0.com/questions/1226/how-to-renew-id-token](http://community.auth0.com/questions/1226/how-to-renew-id-token)  
Also, we cannot use /delegation endpoint as mentioned in the above link as it is deprecated in newer clients.

1. So we are forced to move to OIDC client.  
[Applications in Auth0 - Auth0 Docs](https://auth0.com/docs/api-auth/tutorials/adoption/oidc-conformant)  
When we move to OIDC client, as mentioned in the above documentation we are not getting refresh\_token during Social Login.

We are caught in-between and we need a solution to get latest id\_token using refresh\_token during Social Login.

---

<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:** [November 3, 2017, 10:53pm UTC](https://community.auth0.com/t/in-mobile-application-we-need-id-token-and-refresh-token-during-social-login-there-is-also-a-requirement-to-get-the-latest-id-token-using-the-refresh-token/8658/2 "2017-11-03T22:53:37Z")

</div>

Based on the information provided I’m assuming the issue with OIDC is the lack of support for refresh tokens when using the implicit grant. If that’s the case you should be using [silent authentication](https://auth0.com/docs/api-auth/tutorials/silent-authentication) to obtain refreshed tokens in a browser-based web application. If you have a specific issue with silent authentication then you should update your question or if I understood incorrectly also clarify your scenario, but the lack of refresh tokens in implicit grant is unavoidable as refresh tokens are not suitable for browser-based applications.

---

<div class="post-metadata">

**Author:** ![aswin.kumar](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@aswin.kumar](https://community.auth0.com/u/aswin.kumar)\
**Post date:** [November 3, 2017, 11:16pm UTC](https://community.auth0.com/t/in-mobile-application-we-need-id-token-and-refresh-token-during-social-login-there-is-also-a-requirement-to-get-the-latest-id-token-using-the-refresh-token/8658/3 "2017-11-03T23:16:44Z")

</div>

@jmangelo Yes, the issue with OIDC is the lack of support for refresh tokens when using the implicit grant. We cannot go with silent authentication as we are using native mobile application that does a browser-based social login. Is there a solution for native mobile applications for the same issue rather than browser-based web applications.

---

<div class="post-metadata">

**Author:** ![aswin.kumar](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@aswin.kumar](https://community.auth0.com/u/aswin.kumar)\
**Post date:** [November 3, 2017, 11:16pm UTC](https://community.auth0.com/t/in-mobile-application-we-need-id-token-and-refresh-token-during-social-login-there-is-also-a-requirement-to-get-the-latest-id-token-using-the-refresh-token/8658/4 "2017-11-03T23:16:44Z")

</div>

@jmangelo Yes, the issue with OIDC is the lack of support for refresh tokens when using the implicit grant. We cannot go with silent authentication as we are using native mobile application that does a browser-based social login. Is there a solution for native mobile applications for the same issue rather than browser-based web applications.

---

<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:** [November 6, 2017, 11:58pm UTC](https://community.auth0.com/t/in-mobile-application-we-need-id-token-and-refresh-token-during-social-login-there-is-also-a-requirement-to-get-the-latest-id-token-using-the-refresh-token/8658/5 "2017-11-06T23:58:37Z")

</div>

A native application should not be using implicit grant, it should use an authorization code grant with PKCE which would allow for the refresh token to be issued. See: [https://auth0.com/docs/api-auth/grant/authorization-code-pkce](https://auth0.com/docs/api-auth/grant/authorization-code-pkce)

---

<div class="post-metadata">

**Author:** ![aswin.kumar](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@aswin.kumar](https://community.auth0.com/u/aswin.kumar)\
**Post date:** [November 13, 2017, 10:24pm UTC](https://community.auth0.com/t/in-mobile-application-we-need-id-token-and-refresh-token-during-social-login-there-is-also-a-requirement-to-get-the-latest-id-token-using-the-refresh-token/8658/6 "2017-11-13T22:24:11Z")

</div>

In Mobile Application - We need id\_token and refresh\_token during Social Login. There is also a requirement to get the latest id\_token using the refresh\_token.

Update - (Solved)

Authorisation code grant with PKCE + OIDC (passing an audience during social login) = refresh\_token.

We are also able to refresh the id\_token using the obtained refresh\_token.

Thanks @jmangelo

---

<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:57am UTC](https://community.auth0.com/t/in-mobile-application-we-need-id-token-and-refresh-token-during-social-login-there-is-also-a-requirement-to-get-the-latest-id-token-using-the-refresh-token/8658/7 "2018-03-02T05:57:16Z")

</div>


