# Facing issue to get refresh token

**URL:** <https://community.auth0.com/t/facing-issue-to-get-refresh-token/69364>\
**Category:** Get Help\
**Tags:** jwt, auth0\
**Created:** [September 9, 2021, 1:59pm UTC](https://community.auth0.com/t/facing-issue-to-get-refresh-token/69364 "2021-09-09T13:59:43Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![ankitelevon](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ankitelevon/32/12751_2.png) [@ankitelevon](https://community.auth0.com/u/ankitelevon)\
**Post date:** [September 9, 2021, 1:59pm UTC](https://community.auth0.com/t/facing-issue-to-get-refresh-token/69364/1 "2021-09-09T13:59:43Z")

</div>

Hi, I am trying to get refresh token for a regular web application but not able to get, I am using a free account, is this due to free account. can you please suggest.

---

<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:** [September 9, 2021, 10:40pm UTC](https://community.auth0.com/t/facing-issue-to-get-refresh-token/69364/3 "2021-09-09T22:40:59Z")

</div>

Hi @ankitelevon,

Welcome to the Auth0 Community!

No, this shouldn’t be related to your account type.

If you give us more information we can help you debug.

---

<div class="post-metadata">

**Author:** ![ankitelevon](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ankitelevon/32/12751_2.png) [@ankitelevon](https://community.auth0.com/u/ankitelevon)\
**Post date:** [September 13, 2021, 10:34am UTC](https://community.auth0.com/t/facing-issue-to-get-refresh-token/69364/4 "2021-09-13T10:34:45Z")

</div>

Hi Dan, Thanks for your reply.  
we are trying to create token and refresh token using python, for that we need authorization code and we are using  
“[https://dev-1fqd8ba7.us.auth0.com/login?state=hKFo2SBMSWNxVzlUMnB6dGZ6N0VwUW95TGgxcGNiaktfZ1VOUqFupWxvZ2luo3RpZNkgeUwwZVEzcW5tX0pGb2QwV21FWDhtME1HYjlSak85RVqjY2lk2SBDbUx4dDl5N0pHRVlMWXBLa1hkcnBMUlRFMVFPa2c5OA&client=CmLxt9y7JGEYLYpKkXdrpLRTE1QOkg98&protocol=oauth2&audience=http%3A%2F%2Fdeyesinspectionservicetest-ycndnvorvq-uc.a.run.app&scope=offline\_access&response\_type=code&redirect\_uri=https%3A%2F%2Fdeyesinspectionservicetest-ycndnvorvq-uc.a.run.app%2Fcallback](https://dev-1fqd8ba7.us.auth0.com/login?state=hKFo2SBMSWNxVzlUMnB6dGZ6N0VwUW95TGgxcGNiaktfZ1VOUqFupWxvZ2luo3RpZNkgeUwwZVEzcW5tX0pGb2QwV21FWDhtME1HYjlSak85RVqjY2lk2SBDbUx4dDl5N0pHRVlMWXBLa1hkcnBMUlRFMVFPa2c5OA&client=CmLxt9y7JGEYLYpKkXdrpLRTE1QOkg98&protocol=oauth2&audience=http%3A%2F%2Fdeyesinspectionservicetest-ycndnvorvq-uc.a.run.app&scope=offline_access&response_type=code&redirect_uri=https%3A%2F%2Fdeyesinspectionservicetest-ycndnvorvq-uc.a.run.app%2Fcallback)”

this url to generate authorization code, the issue is the above given url is working in browser and getting authorization code in browser and using that we are able to create token and refresh token,

but as we are checking that one authorization code allow to create only one token, for a new token for new user we have to create a new authorization code but due to python script we are not able to crate authorization code.

we are using request module to call a get request with this url but its not working, the request is below,

import requests

r = requests.head(‘[https://dev-1fqd8ba7.us.auth0.com/authorize?audience=http://deyesinspectionservicetest-ycndnvorvq-uc.a.run.app&scope=offline\_access&response\_type=code&client\_id=CmLxt9y7JGEYLYpKkXdrpLRTE1QOkg98&redirect\_uri=https://deyesinspectionservicetest-ycndnvorvq-uc.a.run.app/callback](https://dev-1fqd8ba7.us.auth0.com/authorize?audience=http://deyesinspectionservicetest-ycndnvorvq-uc.a.run.app&scope=offline_access&response_type=code&client_id=CmLxt9y7JGEYLYpKkXdrpLRTE1QOkg98&redirect_uri=https://deyesinspectionservicetest-ycndnvorvq-uc.a.run.app/callback)’,allow\_redirects=False,headers={

```
'Referer Policy': 'strict-origin-when-cross-origin'

```

})

please let us know either how we can use one authorization code for multiple token for multiple users or a way by which we can generate authorization code everytime usig python script for every new user.

---

<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:** [September 13, 2021, 7:13pm UTC](https://community.auth0.com/t/facing-issue-to-get-refresh-token/69364/5 "2021-09-13T19:13:00Z")

</div>

> [@ankitelevon](#):
>
> please let us know either how we can use one authorization code for multiple token for multiple users or a way by which we can generate authorization code everytime usig python script for every new user.

You should only be using a single code for a one-time transaction with a single user.

You should consider using one of our SDKs. Checkout our [quickstart](https://auth0.com/docs/quickstarts/) to find a tutorial that works for you.

---

<div class="post-metadata">

**Author:** ![ankitelevon](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ankitelevon/32/12751_2.png) [@ankitelevon](https://community.auth0.com/u/ankitelevon)\
**Post date:** [September 14, 2021, 9:26am UTC](https://community.auth0.com/t/facing-issue-to-get-refresh-token/69364/6 "2021-09-14T09:26:17Z")

</div>

Hi Dan,  
we are implementing auth0 for our rest api’s so we need to generate and provide token and access token to the frontend application, we are able to generate token and refresh token for a user but to generate authorization code its require browser login into auth0 account to verify which is not possible in the backend application. is there any way we can generate authorization code without login into browser or any way we can provide login cred into the authorization code generation request.

---

<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:** [September 14, 2021, 3:55pm UTC](https://community.auth0.com/t/facing-issue-to-get-refresh-token/69364/7 "2021-09-14T15:55:15Z")

</div>

It sounds like you may be using the wrong flow. Why can’t a user login through the browser?

---

<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:** [December 23, 2021, 4:55pm UTC](https://community.auth0.com/t/facing-issue-to-get-refresh-token/69364/8 "2021-12-23T16:55:05Z")

</div>

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