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
+28-4Lines changed: 28 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,12 +1,19 @@
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
Please check our [Quickstart](https://auth0.com/docs/quickstart/backend/python) to better understand this sample.
3
7
4
8
# Running the example
5
9
In order to run the example you need to have `python` and `pip` installed.
6
10
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.
11
+
You also need to set your Auth0 Domain and the API's audience as environment variables with the following names
12
+
respectively: `AUTH0_DOMAIN` and `API_ID`, which is the audience of your API. You can find an example in the
13
+
`env.example` file.
8
14
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:
15
+
For that, if you just create a file named `.env` in the directory and set the values like the following,
16
+
the app will just work:
10
17
11
18
```bash
12
19
# .env file
@@ -20,4 +27,21 @@ 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.
30
+
# Testing the API
31
+
32
+
You can then try to do a GET to [http://localhost:3001/secured/ping](http://localhost:3001/secured/ping) which will
33
+
throw an error if you don't send an access token signed with RS256 with the appropriate issuer and audience in the
34
+
Authorization header.
35
+
36
+
You can also try to do a GET to
37
+
[http://localhost:3001/secured/private/ping](http://localhost:3001/secured/private/ping) which will throw an error if
38
+
you don't send an access token with the scope `read:agenda` signed with RS256 with the appropriate issuer and audience
39
+
in the Authorization header.
40
+
41
+
# Running the example with Docker
42
+
43
+
In order to run the sample with [Docker](https://www.docker.com/) you need to add the `AUTH0_DOMAIN` and `API_ID`
44
+
to the `.env` filed as explained [previously](#running-the-example) and then
45
+
46
+
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