# Getting a refresh\_token from the server side

**URL:** <https://community.auth0.com/t/getting-a-refresh-token-from-the-server-side/169777>\
**Category:** Get Help\
**Tags:** apis, application\
**Created:** [January 22, 2025, 2:01pm UTC](https://community.auth0.com/t/getting-a-refresh-token-from-the-server-side/169777 "2025-01-22T14:01:59Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![joaofrca](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/joaofrca/32/71269_2.png) [@joaofrca](https://community.auth0.com/u/joaofrca)\
**Post date:** [January 22, 2025, 2:01pm UTC](https://community.auth0.com/t/getting-a-refresh-token-from-the-server-side/169777/1 "2025-01-22T14:01:59Z")

</div>

1. We have implemented a custom login page in our Frontend application that directly connects to our server application. Our current process aligns with the **Resource Owner Password Flow** as described in the documentation.
2. We intentionally avoid using the **authorize endpoint** or the **Authorization Code Flow** , as we are not integrating with social identity providers at this stage.
3. To fetch the `access_token`, we invoke the `oauth/token` endpoint, using the `grant_type` set to `'password'`.
4. Based on the documentation, it appears that obtaining a `refresh_token` via this flow is not supported. Therefore, we are seeking guidance on how to authenticate users through our server application without requiring them to re-enter their credentials every 24 hours. Is there a way to refresh the token within our current setup, or do we need to modify our approach?

---

<div class="post-metadata">

**Author:** ![dawid.matuszczyk](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dawid.matuszczyk/32/74550_2.png) [@dawid.matuszczyk](https://community.auth0.com/u/dawid.matuszczyk)\
**Post date:** [January 22, 2025, 2:38pm UTC](https://community.auth0.com/t/getting-a-refresh-token-from-the-server-side/169777/3 "2025-01-22T14:38:55Z")

</div>

Hi @joaofrca

Welcome to the Auth0 Community!

Thank you for posting your question; adding the `offline_access` in the scope will give you the refresh token in the response. I’ve just tested the below request with Management API as audience, and it returned the refresh and access token properly

```auto
curl --location --request POST 'https://{TENANT_DOMAIN}/oauth/token' \

--header 'Content-Type: application/x-www-form-urlencoded' \

--data-urlencode 'grant_type=password' \

--data-urlencode 'client_id=CLIENT_ID' \

--data-urlencode 'client_secret=CLIENT_SECRET' \

--data-urlencode 'audience=AUDIENCE' \

--data-urlencode 'username=USERNAME' \

--data-urlencode 'password=PASSWORD' \

--data-urlencode 'scope=openid profile email offline_access'

```

Thanks  
Dawid

---

<div class="post-metadata">

**Author:** ![joaofrca](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/joaofrca/32/71269_2.png) [@joaofrca](https://community.auth0.com/u/joaofrca)\
**Post date:** [January 23, 2025, 2:49pm UTC](https://community.auth0.com/t/getting-a-refresh-token-from-the-server-side/169777/4 "2025-01-23T14:49:06Z")

</div>

Hi @dawid.matuszczyk ,  
This worked indeed! Thank you so much, I highly appreciate it!  
But let me just make a suggestion that the documentation could/should be improved. I do not find scope mentioned anywhere referring to the oauth/token endpoint. Please see the section on “Get Refresh Tokens”:

> To get a refresh token, you must include the `offline_access` (scope) when you initiate an authentication request through the `/authorize` endpoint. Be sure to initiate Offline Access in your API. For more information, read (API Settings).

It is quite a struggle to see the proper contracts of the APIs, and everything they shall or shall not accept in the payloads, as it is also difficult to find the proper responses.

Best,  
João

---

<div class="post-metadata">

**Author:** ![dawid.matuszczyk](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dawid.matuszczyk/32/74550_2.png) [@dawid.matuszczyk](https://community.auth0.com/u/dawid.matuszczyk)\
**Post date:** [January 23, 2025, 2:51pm UTC](https://community.auth0.com/t/getting-a-refresh-token-from-the-server-side/169777/5 "2025-01-23T14:51:25Z")

</div>

Thank you for the feedback, @joaofrca; I will pass it on to the Documentation Team!

Thanks!  
Dawid

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [February 6, 2025, 2:51pm UTC](https://community.auth0.com/t/getting-a-refresh-token-from-the-server-side/169777/6 "2025-02-06T14:51:41Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
