# Unable to get refresh token from the device code authorization flow

**URL:** <https://community.auth0.com/t/unable-to-get-refresh-token-from-the-device-code-authorization-flow/82127>\
**Category:** Get Help\
**Tags:** refresh\_token, auth0\
**Created:** [April 21, 2022, 8:20am UTC](https://community.auth0.com/t/unable-to-get-refresh-token-from-the-device-code-authorization-flow/82127 "2022-04-21T08:20:11Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![selvi](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/selvi/32/33945_2.png) [@selvi](https://community.auth0.com/u/selvi)\
**Post date:** [April 21, 2022, 8:20am UTC](https://community.auth0.com/t/unable-to-get-refresh-token-from-the-device-code-authorization-flow/82127/1 "2022-04-21T08:20:11Z")

</div>

unable to get refresh token in the below response. And also updated refresh token settings in app page. Refer the screenshot attached below

**Command:**  
curl --request POST   
–url ‘[https://domain/oauth/device/code](https://domain/oauth/device/code)’   
–header ‘content-type: application/x-www-form-urlencoded’   
–data ‘client\_id=dhsffjdfjdhfjjjjjjjfjdjf’   
–data scope=openid   
–data audience=[https://domain/api/v2/](https://domain/api/v2/)

**Response:**  
{  
“access\_token”:“eyJz93a…k4laUWw”,  
“id\_token”: “eyJ0XAi…4faeEoQ”,  
“token\_type”:“Bearer”,  
“expires\_in”:86400  
}

 ![Application Details](https://global.discourse-cdn.com/auth0/original/3X/f/0/f0b5c30fabfee5cd05313e4ac955a6d655f4bd5d.png)

---

<div class="post-metadata">

**Author:** ![lihua.zhang](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/lihua.zhang/32/39683_2.png) [@lihua.zhang](https://community.auth0.com/u/lihua.zhang)\
**Post date:** [April 21, 2022, 3:58pm UTC](https://community.auth0.com/t/unable-to-get-refresh-token-from-the-device-code-authorization-flow/82127/3 "2022-04-21T15:58:17Z")

</div>

Hi @selvi ,

Thank you for posting this query on Auth0 Community!

[This](https://auth0.com/docs/quickstart/native/device/01-login#device-code-parameters) article explained the scopes in the authorization flow.

```auto
–data scope=openid

```

To get the refresh token, please set scope=offline\_access and enable the **Allow Offline Access** field in the [API Settings](https://manage.auth0.com/?_gl=1*1t4hnb2*rollup_ga*MjA5MTA5MTk2MC4xNjQ4NzQwNzU4*rollup_ga_F1G3E656YZ*MTY1MDU1NTQxNi42OS4xLjE2NTA1NTYwMTcuNTc.&_ga=2.113193345.483232687.1650296876-2091091960.1648740758#/apis).

Hope this helps!

---

<div class="post-metadata">

**Author:** ![selvi](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/selvi/32/33945_2.png) [@selvi](https://community.auth0.com/u/selvi)\
**Post date:** [April 22, 2022, 8:59am UTC](https://community.auth0.com/t/unable-to-get-refresh-token-from-the-device-code-authorization-flow/82127/4 "2022-04-22T08:59:34Z")

</div>

This command works fine after adding the scope offline\_access curl --request POST   
-curl --request POST   
–url ‘[https://domain/oauth/device/code](https://domain/oauth/device/code)’   
–header ‘content-type: application/x-www-form-urlencoded’   
–data ‘client\_id=xsHDHSBD’   
–data scope=openid%20offline\_access   
–data audience=[https://domain/api/v2/](https://domain/api/v2/)

---

<div class="post-metadata">

**Author:** ![lihua.zhang](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/lihua.zhang/32/39683_2.png) [@lihua.zhang](https://community.auth0.com/u/lihua.zhang)\
**Post date:** [April 22, 2022, 7:11pm UTC](https://community.auth0.com/t/unable-to-get-refresh-token-from-the-device-code-authorization-flow/82127/5 "2022-04-22T19:11:21Z")

</div>

Thank you for sharing the solution with us! 🙂

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [December 22, 2022, 11:34am UTC](https://community.auth0.com/t/unable-to-get-refresh-token-from-the-device-code-authorization-flow/82127/6 "2022-12-22T11:34:17Z")

</div>


