Skip to content

Commit f55d945

Browse files
authored
Merge pull request #28 from paulioceano/master
Rename AUTH0_AUDIENCE with API_IDENTIFIER
2 parents d8bdf4d + 6489ec5 commit f55d945

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

00-Starter-Seed/.env.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
AUTH0_DOMAIN={DOMAIN}
2-
AUTH0_AUDIENCE={API_AUDIENCE}
2+
API_IDENTIFIER={API_IDENTIFIER}

00-Starter-Seed/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Please check our [Quickstart](https://auth0.com/docs/quickstart/backend/python)
1111
In order to run the example you need to have `python` and `pip` installed.
1212

1313
You 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

1717
For 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
2222
AUTH0_DOMAIN=example.auth0.com
23-
AUTH0_AUDIENCE=YOUR_API_AUDIENCE
23+
API_IDENTIFIER={API_IDENTIFIER}
2424
```
2525

2626
Once you've set those 2 environment variables:

00-Starter-Seed/server.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
if ENV_FILE:
1616
load_dotenv(ENV_FILE)
1717
AUTH0_DOMAIN = env.get("AUTH0_DOMAIN")
18-
AUTH0_AUDIENCE = env.get("AUTH0_AUDIENCE")
18+
API_IDENTIFIER = env.get("API_IDENTIFIER")
1919
ALGORITHMS = ["RS256"]
2020
APP = 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:

0 commit comments

Comments
 (0)