# Issue retrieving refresh token in passwordless otp grant type

**URL:** <https://community.auth0.com/t/issue-retrieving-refresh-token-in-passwordless-otp-grant-type/36905>\
**Category:** Get Help\
**Created:** [January 27, 2020, 4:33pm UTC](https://community.auth0.com/t/issue-retrieving-refresh-token-in-passwordless-otp-grant-type/36905 "2020-01-27T16:33:05Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![bartlomiej.rozanski](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/bartlomiej.rozanski/32/14237_2.png) [@bartlomiej.rozanski](https://community.auth0.com/u/bartlomiej.rozanski)\
**Post date:** [January 27, 2020, 4:33pm UTC](https://community.auth0.com/t/issue-retrieving-refresh-token-in-passwordless-otp-grant-type/36905/1 "2020-01-27T16:33:05Z")

</div>

Hello,  
I’m trying to get refresh\_token in passwordless flow, according to documentation I tried to add offline\_access to scope in auth params and in other configurations, also I couldn’t find any answer that would help me get it properly.

> When an authentication is performed with the offline\_access scope included, it will return a Refresh Token that can be used to request a new user token, without forcing the user to perform authentication again.

My requests are as follows:  
Generating otp:

```auto
curl --request POST --url 'https://redacted.eu.auth0.com/passwordless/start' --header 'content-type: application/json' --data '{"client_id": "redacted", "client_secret": "redacted", "connection": "sms", "phone_number": "+redacted ", "send": "code", "authParams":{"scope":"offline_access"}}'

```

Confirming otp:

```auto
curl --request POST --url 'https://redacted.eu.auth0.com/oauth/token' --header 'content-type: application/json' --data '{"client_id": "redacted", "client_secret": "redacted", "grant_type": "http://auth0.com/oauth/grant-type/passwordless/otp", "realm": "sms", "username": "+redacted", "otp": "8115"}'

```

Response doesn’t contain refresh\_token:

```auto
{"access_token":"redacted","id_token":"redacted","scope":"openid profile email address phone","expires_in":86400,"token_type":"Bearer"}

```

what am I missing? I doubt that auth0 api is broken rather documentation is unclear at this point, but correct me if I’m wrong

> [@Unable to Obtain Refresh Token using Passwordless](http://community.auth0.com/t/unable-to-obtain-refresh-token-using-passwordless/10035):
>
> Hi, I have a mobile app that implements passwordless authentication for users, I’m able to get an access token, however, I’m unable to get a refresh token. I’m sending a POST request to the /ouath/token endpoint, and passing offline\_access to the scope. Please help. Regards, Saeed

---

<div class="post-metadata">

**Author:** ![nicolas\_sabena](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/nicolas_sabena/32/6064_2.png) [@nicolas\_sabena](https://community.auth0.com/u/nicolas_sabena)\
**Post date:** [January 27, 2020, 7:38pm UTC](https://community.auth0.com/t/issue-retrieving-refresh-token-in-passwordless-otp-grant-type/36905/2 "2020-01-27T19:38:39Z")

</div>

What type of application are you using? SPA, Regular web app or Native?

---

<div class="post-metadata">

**Author:** ![bartlomiej.rozanski](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/bartlomiej.rozanski/32/14237_2.png) [@bartlomiej.rozanski](https://community.auth0.com/u/bartlomiej.rozanski)\
**Post date:** [January 27, 2020, 8:30pm UTC](https://community.auth0.com/t/issue-retrieving-refresh-token-in-passwordless-otp-grant-type/36905/3 "2020-01-27T20:30:00Z")

</div>

I’ve started by Native, it didn’t work and so I tried Regular Web Application with the same result.

---

<div class="post-metadata">

**Author:** ![nicolas\_sabena](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/nicolas_sabena/32/6064_2.png) [@nicolas\_sabena](https://community.auth0.com/u/nicolas_sabena)\
**Post date:** [January 27, 2020, 8:39pm UTC](https://community.auth0.com/t/issue-retrieving-refresh-token-in-passwordless-otp-grant-type/36905/4 "2020-01-27T20:39:07Z")

</div>

Can you try adding `openid` (and `email profile` if you require the additional information) to the `scope=offline_access` in the first request?  
In the token response you are getting `"scope":"openid profile email"`, which suggests that the server is defaulting to `openid profile email address phone` for some reason, but maybe since there’s no `openid` scope in the request is not creating the refresh token.

---

<div class="post-metadata">

**Author:** ![bartlomiej.rozanski](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/bartlomiej.rozanski/32/14237_2.png) [@bartlomiej.rozanski](https://community.auth0.com/u/bartlomiej.rozanski)\
**Post date:** [January 28, 2020, 9:06am UTC](https://community.auth0.com/t/issue-retrieving-refresh-token-in-passwordless-otp-grant-type/36905/5 "2020-01-28T09:06:32Z")

</div>

scope list in authParams from `start` request doesn’t reflect in token response:

```auto
curl --request POST --url 'https://REDACTED.eu.auth0.com/passwordless/start' --header 'content-type: application/json' --data '{"client_id": "REDACTED", "client_secret": "REDACTED", "authParams":{"scope":"openid phone offline_access"}, "connection": "sms", "phone_number": "+REDACTED", "send": "code"}'
{"_id":"5e26f231dd1db51a85fc75bf","phone_number":"+REDACTED","phone_verified":false,"request_language":null}

```

```auto
curl --request POST --url 'https://REDACTED.eu.auth0.com/oauth/token' --header 'content-type: application/json' --data '{"client_id": "REDACTED", "client_secret": "REDACTED", "grant_type": "http://auth0.com/oauth/grant-type/passwordless/otp", "realm": "sms", "username": "+REDACTED", "otp": "6193"}'
{"access_token":"REDACTED","id_token":"REDACTED","scope":"openid profile email address phone","expires_in":86400,"token_type":"Bearer"}

```

I’ve also following grant types set up in connected app:

 ![Screenshot 2020-01-28 at 10.09.23](https://global.discourse-cdn.com/auth0/original/3X/3/f/3fdc219a4f878359c4af2fd057b2f32ab3ecedc5.png)

---

<div class="post-metadata">

**Author:** ![nicolas\_sabena](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/nicolas_sabena/32/6064_2.png) [@nicolas\_sabena](https://community.auth0.com/u/nicolas_sabena)\
**Post date:** [January 28, 2020, 9:42pm UTC](https://community.auth0.com/t/issue-retrieving-refresh-token-in-passwordless-otp-grant-type/36905/6 "2020-01-28T21:42:53Z")

</div>

Is it possible that you are altering the `scope` within a rule? Where are the ` address phone` scopes being added? Are you removing `offline_access` as a side effect maybe?
