# I am looking for best practices of using Refresh Token to get Access Token

**URL:** <https://community.auth0.com/t/i-am-looking-for-best-practices-of-using-refresh-token-to-get-access-token/56437>\
**Category:** Get Help\
**Tags:** refresh-tokens, access-token\
**Created:** [January 19, 2021, 2:23pm UTC](https://community.auth0.com/t/i-am-looking-for-best-practices-of-using-refresh-token-to-get-access-token/56437 "2021-01-19T14:23:39Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![tdesai](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/tdesai/32/15525_2.png) [@tdesai](https://community.auth0.com/u/tdesai)\
**Post date:** [January 19, 2021, 2:23pm UTC](https://community.auth0.com/t/i-am-looking-for-best-practices-of-using-refresh-token-to-get-access-token/56437/1 "2021-01-19T14:23:40Z")

</div>

In my applications setup, I have couple of microservices ([asp.net](http://asp.net) core api). Eg. From one microservice, I am making api calls to another microservice (api-to-api OR machine-to-machine). I am looking for best practices around using Refresh Token to get Access Token. Shall I just check whether my current access token has expired before making the api call, if expired obtain a new one using the ClientId/ClientSecret/Audience (grant\_type: client\_credentials). OR shall I using the refresh token to obtain the access token. I was unable to find examples/documentation around usage of refresh token in the scenario I described.

Thank you in advance!

---

<div class="post-metadata">

**Author:** ![stephanie.chamblee](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/stephanie.chamblee/32/26087_2.png) [@stephanie.chamblee](https://community.auth0.com/u/stephanie.chamblee)\
**Post date:** [January 19, 2021, 3:14pm UTC](https://community.auth0.com/t/i-am-looking-for-best-practices-of-using-refresh-token-to-get-access-token/56437/3 "2021-01-19T15:14:22Z")

</div>

Hi @tdesai,

Machine-to-machine applications are following the OAuth2 [Client Credentials](https://auth0.com/docs/flows/client-credentials-flow) flow. In the [specs](https://tools.ietf.org/html/rfc6749#section-4.4.3) for this flow, it is explained that refresh tokens should not be issued in the token response.

> [4.4.3](https://tools.ietf.org/html/rfc6749#section-4.4.3). Access Token Response

> If the access token request is valid and authorized, the authorization server issues an access token as described in [Section 5.1](https://tools.ietf.org/html/rfc6749#section-5.1). A refresh token SHOULD NOT be included. If the request failed client authentication or is invalid, the authorization server returns an error response as described in [Section 5.2](https://tools.ietf.org/html/rfc6749#section-5.2).

When you [validate](https://auth0.com/docs/quickstart/backend/aspnet-core-webapi#validate-access-tokens) the Access Token, you can determine if the token is expired and request another one if so.

---

<div class="post-metadata">

**Author:** ![tdesai](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/tdesai/32/15525_2.png) [@tdesai](https://community.auth0.com/u/tdesai)\
**Post date:** [January 19, 2021, 7:24pm UTC](https://community.auth0.com/t/i-am-looking-for-best-practices-of-using-refresh-token-to-get-access-token/56437/4 "2021-01-19T19:24:48Z")

</div>

Thanks a lot for pointing me to the documentation. I really appreciate it!

---

<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 3, 2021, 7:24pm UTC](https://community.auth0.com/t/i-am-looking-for-best-practices-of-using-refresh-token-to-get-access-token/56437/5 "2021-02-03T19:24:51Z")

</div>

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