# Passwordless Magic Link

**URL:** <https://community.auth0.com/t/passwordless-magic-link/85193>\
**Category:** Get Help\
**Tags:** passwordless, magic-link\
**Created:** [June 15, 2022, 8:01pm UTC](https://community.auth0.com/t/passwordless-magic-link/85193 "2022-06-15T20:01:51Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![min.soo.kim](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/min.soo.kim/32/33695_2.png) [@min.soo.kim](https://community.auth0.com/u/min.soo.kim)\
**Post date:** [June 15, 2022, 8:01pm UTC](https://community.auth0.com/t/passwordless-magic-link/85193/1 "2022-06-15T20:01:51Z")

</div>

Is the auth0.js the only library to be used with password-less with magic link? Is there an example of password-less with magic link that use libraries other than auth0.js?

I’m trying to find a way where I can access refresh\_token using password-less with magic link.

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [June 24, 2022, 6:02pm UTC](https://community.auth0.com/t/passwordless-magic-link/85193/3 "2022-06-24T18:02:16Z")

</div>

Hi @min.soo.kim,

Welcome to the Auth0 Community!

You should be able to use most SDKs to get a passwordless magic link set up. The SDKs initiate the request and handle the response in the client, regardless of which login method you are using.

The passwordless setup part happens on the Auth0 server.

This doc demonstrates how to set up passwordless.

> **[Passwordless Authentication with Magic Links](https://auth0.com/docs/authenticate/passwordless/authentication-methods/email-magic-link)**
>
> Describes how to use Passwordless connections with the magic link authentication factor.

And this doc shows how to get a refresh token, although much of the code here will be handled by the SDK. Do you know which SDK you would like to use?

> **[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:** ![min.soo.kim](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/min.soo.kim/32/33695_2.png) [@min.soo.kim](https://community.auth0.com/u/min.soo.kim)\
**Post date:** [July 12, 2022, 1:46am UTC](https://community.auth0.com/t/passwordless-magic-link/85193/4 "2022-07-12T01:46:01Z")

</div>

Thank you so much for the info, Dan.

If I could bug you just a little bit more, I came across the following article: [Unable to retrieve a refresh token using the passwordless link method](https://community.auth0.com/t/unable-to-retrieve-a-refresh-token-using-the-passwordless-link-method/51914)

Where the author states that

> [https://auth0.com/docs/best-practices/token-best-practices#refresh-token-usagePasswordless](https://auth0.com/docs/best-practices/token-best-practices#refresh-token-usagePasswordless) flow is not part of Oauth2.0 grant flows. Hence, it is not supported.

Is this true? That password-less with magic link cannot be used to access refresh token?

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [July 12, 2022, 10:45pm UTC](https://community.auth0.com/t/passwordless-magic-link/85193/5 "2022-07-12T22:45:20Z")

</div>

It appears possible according to this post: [How to get `refresh_token` for embedded passwordless auth in a native app](https://community.auth0.com/t/how-to-get-refresh-token-for-embedded-passwordless-auth-in-a-native-app/63170).

What are you seeing returned when you request one?

---

<div class="post-metadata">

**Author:** ![min.soo.kim](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/min.soo.kim/32/33695_2.png) [@min.soo.kim](https://community.auth0.com/u/min.soo.kim)\
**Post date:** [July 16, 2022, 6:36pm UTC](https://community.auth0.com/t/passwordless-magic-link/85193/6 "2022-07-16T18:36:54Z")

</div>

Before answering the question, may I provide a bit more context? Here’s the code snippet from our FE which uses `auth0-js` package:

```auto
...
import { WebAuth } from "auth0-js";
...
export const AuthProvider = (props: AuthProviderProps) => {
    const [auth0] = useState<WebAuth>(new WebAuth({
        domain: domain,
        clientID: clientId,
        responseType: responseType,
        redirectUri: redirectUri,
        audience: audience,
        scope: "openid profile email offline_access",,
        })
    ));

    ....

    const renewSession: RenewSession = async () => {
        const { err, res } = await new Promise(resolve => auth0.checkSession({}, (err, res: AuthResult) => resolve({ err, res })));
    }
    ...
  };
}
...

```

So to answer your question, inside `res` from `const { err, res } = await new Promise(resolve => auth0.checkSession({}, (err, res: AuthResult) => resolve({ err, res })));`, the properties look like this:

```auto
{
    "accessToken": "...",
    "idToken": "...",
    "idTokenPayload": {
        "https://cos.goldn.com/": {
            "userId": "..."
        },
        "nickname": "...",
        "name": "...",
        "picture": "...",
        "updated_at": "2022-07-16T17:52:29.948Z",
        "email": "...",
        "email_verified": true,
        "iss": "...",
        "sub": "...",
        "aud": "...",
        "iat": 1657994279,
        "exp": 1658030279,
        "at_hash": "...",
        "nonce": "..."
    },
    "appState": "...",
    "refreshToken": null,
    "state": "...",
    "expiresIn": 86400,
    "tokenType": "Bearer",
    "scope": "openid profile email offline_access"
}

```

And even though I followed the instruction and set the scope to include `offline_access` and enable them in my API, the value of `refreshToken` is still `null`

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [May 11, 2023, 1:01pm UTC](https://community.auth0.com/t/passwordless-magic-link/85193/7 "2023-05-11T13:01:16Z")

</div>


