Unable to get refresh token from the device code authorization flow

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
–header ‘content-type: application/x-www-form-urlencoded’
–data ‘client_id=dhsffjdfjdhfjjjjjjjfjdjf’
–data scope=openid
–data audience=https://domain/api/v2/

Response:
{
“access_token”:“eyJz93a…k4laUWw”,
“id_token”: “eyJ0XAi…4faeEoQ”,
“token_type”:“Bearer”,
“expires_in”:86400
}

Hi @selvi ,

Thank you for posting this query on Auth0 Community!

This article explained the scopes in the authorization flow.

–data scope=openid

To get the refresh token, please set scope=offline_access and enable the Allow Offline Access field in the API Settings.

Hope this helps!

1 Like

This command works fine after adding the scope offline_access curl --request POST
-curl --request POST
–url ‘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/

1 Like

Thank you for sharing the solution with us! :slight_smile: