# How to get \`refresh\_token\` for embedded passwordless auth in a native app

**URL:** <https://community.auth0.com/t/how-to-get-refresh-token-for-embedded-passwordless-auth-in-a-native-app/63170>\
**Category:** Get Help\
**Tags:** passwordless-sms, embedded-login, api, passwordless, login\
**Created:** [May 21, 2021, 3:20pm UTC](https://community.auth0.com/t/how-to-get-refresh-token-for-embedded-passwordless-auth-in-a-native-app/63170 "2021-05-21T15:20:43Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![nrion](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/nrion/32/25233_2.png) [@nrion](https://community.auth0.com/u/nrion)\
**Post date:** [May 21, 2021, 3:20pm UTC](https://community.auth0.com/t/how-to-get-refresh-token-for-embedded-passwordless-auth-in-a-native-app/63170/1 "2021-05-21T15:20:44Z")

</div>

Hello!

I have a flutter app, and I want to implement a Passwordless SMS login without using Universal Login. I have been following this documentation in [Embedded Passwordless Login in Native Applications](https://auth0.com/docs/connections/passwordless/guides/embedded-login-native).

So far, I was able to send an OTP to a phone number using the following:

```auto
POST https://example.auth0.com/passwordless/start
Body: {
    "client_id": "CLIENT_ID_HERE",
    "connection": "sms",
    "phone_number": "PHONE_NUMBER_HERE",
    "send": "code",
    "authParams": {
        "scope": "openid profile email"
    }
}

```

And authenticate the user with:

```auto
POST https://example.auth0.com/oauth/token
Body: {
    "grant_type": "http://auth0.com/oauth/grant-type/passwordless/otp",
    "client_id": "CLIENT_ID_HERE",
    "username": "PHONE_NUMBER_HERE",
    "otp": "123456",
    "realm": "sms",
    "audience": "AUDIENCE_HERE",
    "scope": "openid profile email"
}

```

But the response I receive doesn’t include a `refresh_token`. I only get the following:

```auto
{
    "access_token": "eyJh...",
    "id_token": "eyJh...",
    "scope": "openid profile email",
    "expires_in": 86400,
    "token_type": "Bearer"
}

```

Also tried to include `offline_access` as a scope according to some of the topics that I’ve read, but it still won’t return the `refresh_token`.

**Am I doing something wrong? Did I miss anything?**

I must have looked through every topics with `passwordless`, `refresh_token` keywords here, but I got nothing so far.

Any input is appreciated, thank you! \<3

---

<div class="post-metadata">

**Author:** ![sgo](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/sgo/32/13789_2.png) [@sgo](https://community.auth0.com/u/sgo)\
**Post date:** [May 21, 2021, 3:59pm UTC](https://community.auth0.com/t/how-to-get-refresh-token-for-embedded-passwordless-auth-in-a-native-app/63170/2 "2021-05-21T15:59:31Z")

</div>

Hi @nrion, welcome to the community!

It could be that the audience you have specified does not have offline access enabled, have you checked that offline access is allowed in the API settings?  
When this is disabled Auth0 silently ignores the `offline_access` scope. This scope is required to get a refresh token.

> **[API Settings](https://auth0.com/docs/get-started/apis/api-settings)**
>
> Describes the settings related to APIs available in the Auth0 Dashboard.

> **[Get Refresh Tokens](https://auth0.com/docs/secure/tokens/refresh-tokens/get-refresh-tokens)**
>
> Describes how to get a Refresh Token when you initiate a request using the Authorize endpoint.

---

<div class="post-metadata">

**Author:** ![nrion](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/nrion/32/25233_2.png) [@nrion](https://community.auth0.com/u/nrion)\
**Post date:** [May 21, 2021, 4:24pm UTC](https://community.auth0.com/t/how-to-get-refresh-token-for-embedded-passwordless-auth-in-a-native-app/63170/3 "2021-05-21T16:24:03Z")

</div>

Hi @sgo, glad to be here!

And that was it! I can’t believe it took me too many hours to resolve that. Thank you!

---

<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:** [May 27, 2021, 10:48am UTC](https://community.auth0.com/t/how-to-get-refresh-token-for-embedded-passwordless-auth-in-a-native-app/63170/4 "2021-05-27T10:48:39Z")

</div>

No worries! We got you covered!

---

<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:** [May 27, 2021, 10:48am UTC](https://community.auth0.com/t/how-to-get-refresh-token-for-embedded-passwordless-auth-in-a-native-app/63170/5 "2021-05-27T10:48:43Z")

</div>


