You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: 00-Starter-Seed/README.md
+36-4Lines changed: 36 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,12 +1,17 @@
1
1
# Auth0 + Python + Flask API Seed
2
-
This is the seed project you need to use if you're going to create a Python + Flask API. If you just want to create a Regular Python WebApp, please check [this other seed project](https://github.com/auth0-samples/auth0-python-web-app/tree/master/00-Starter-Seed)
2
+
This is the seed project you need to use if you're going to create a Python + Flask API.
3
+
If you just want to create a Regular Python WebApp, please
4
+
check [this other seed project](https://github.com/auth0-samples/auth0-python-web-app/tree/master/01-Login)
3
5
4
6
# Running the example
5
7
In order to run the example you need to have `python` and `pip` installed.
6
8
7
-
You also need to set your Auth0 Domain and the API's audience as environment variables with the following names respectively: `AUTH0_DOMAIN` and `API_ID`, which is the audience of your API. You can find an example in the `env.example` file.
9
+
You also need to set your Auth0 Domain and the API's audience as environment variables with the following names
10
+
respectively: `AUTH0_DOMAIN` and `API_ID`, which is the audience of your API. You can find an example in the
11
+
`env.example` file.
8
12
9
-
For that, if you just create a file named `.env` in the directory and set the values like the following, the app will just work:
13
+
For that, if you just create a file named `.env` in the directory and set the values like the following,
14
+
the app will just work:
10
15
11
16
```bash
12
17
# .env file
@@ -20,4 +25,31 @@ Once you've set those 2 enviroment variables:
You can then try to do a GET to [http://localhost:3001/secured/ping](http://localhost:3001/secured/ping) which will throw an error if you don't send an access token signed with RS256 with the appropriate issuer and audience in the Authorization header. You can also try to do a GET to [http://localhost:3001/secured/private/ping](http://localhost:3001/secured/private/ping) which will throw an error if you don't send an access token with the scope `read:agenda` signed with RS256 with the appropriate issuer and audience in the Authorization header.
28
+
# Running the example with Docker
29
+
30
+
In order to run the example you need to have `docker` installed.
31
+
32
+
You also need to set your Auth0 Domain and the API's audience as environment variables with the following names
33
+
respectively: `AUTH0_DOMAIN` and `API_ID`, which is the audience of your API. You can find an example in the
34
+
`env.example` file.
35
+
36
+
For that, if you just create a file named `.env` in the directory and set the values like the following,
37
+
the app will just work:
38
+
39
+
```bash
40
+
# .env file
41
+
AUTH0_DOMAIN=example.auth0.com
42
+
API_ID=YOUR_API_AUDIENCE
43
+
```
44
+
45
+
Once you've set those 2 enviroment variables:
46
+
47
+
1. Execute in command line `sh exec.sh` to run the Docker in Linux, or `.\exec.ps1` to run the Docker in Windows.
0 commit comments