File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11AUTH0_DOMAIN = {DOMAIN}
2- AUTH0_AUDIENCE = {API_AUDIENCE }
2+ API_IDENTIFIER = {API_IDENTIFIER }
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ Please check our [Quickstart](https://auth0.com/docs/quickstart/backend/python)
1111In order to run the example you need to have ` python ` and ` pip ` installed.
1212
1313You also need to set your Auth0 Domain and the API's audience as environment variables with the following names
14- respectively: ` AUTH0_DOMAIN ` and ` AUTH0_AUDIENCE ` , which is the audience of your API. You can find an example in the
14+ respectively: ` AUTH0_DOMAIN ` and ` API_IDENTIFIER ` , which is the audience of your API. You can find an example in the
1515` env.example ` file.
1616
1717For that, if you just create a file named ` .env ` in the directory and set the values like the following,
@@ -20,7 +20,7 @@ the app will just work:
2020``` bash
2121# .env file
2222AUTH0_DOMAIN=example.auth0.com
23- AUTH0_AUDIENCE=YOUR_API_AUDIENCE
23+ API_IDENTIFIER={API_IDENTIFIER}
2424```
2525
2626Once you've set those 2 environment variables:
Original file line number Diff line number Diff line change 1515if ENV_FILE :
1616 load_dotenv (ENV_FILE )
1717AUTH0_DOMAIN = env .get ("AUTH0_DOMAIN" )
18- AUTH0_AUDIENCE = env .get ("AUTH0_AUDIENCE " )
18+ API_IDENTIFIER = env .get ("API_IDENTIFIER " )
1919ALGORITHMS = ["RS256" ]
2020APP = Flask (__name__ )
2121
@@ -114,7 +114,7 @@ def decorated(*args, **kwargs):
114114 token ,
115115 rsa_key ,
116116 algorithms = ALGORITHMS ,
117- audience = AUTH0_AUDIENCE ,
117+ audience = API_IDENTIFIER ,
118118 issuer = "https://" + AUTH0_DOMAIN + "/"
119119 )
120120 except jwt .ExpiredSignatureError :
You can’t perform that action at this time.
0 commit comments