File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -9,4 +9,4 @@ RUN pip install -r requirements.txt
99ADD . /home/app
1010CMD python server.py
1111
12- EXPOSE 3001
12+ EXPOSE 3010
Original file line number Diff line number Diff line change @@ -25,16 +25,16 @@ Once you've set those 2 enviroment variables:
2525
26261 . Install the needed dependencies with ` pip install -r requirements.txt `
27272 . Start the server with ` python server.py `
28- 3 . Try calling [ http://localhost:3001 /ping ] ( http://localhost:3001 /ping )
28+ 3 . Try calling [ http://localhost:3010 /ping ] ( http://localhost:3010 /ping )
2929
3030# Testing the API
3131
32- You can then try to do a GET to [ http://localhost:3001 /secured/ping ] ( http://localhost:3001 /secured/ping ) which will
32+ You can then try to do a GET to [ http://localhost:3010 /secured/ping ] ( http://localhost:3010 /secured/ping ) which will
3333throw an error if you don't send an access token signed with RS256 with the appropriate issuer and audience in the
3434Authorization header.
3535
3636You 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
37+ [ http://localhost:3010 /secured/private/ping ] ( http://localhost:3010 /secured/private/ping ) which will throw an error if
3838you don't send an access token with the scope ` read:agenda ` signed with RS256 with the appropriate issuer and audience
3939in the Authorization header.
4040
@@ -44,4 +44,4 @@ In order to run the sample with [Docker](https://www.docker.com/) you need to ad
4444to the ` .env ` filed as explained [ previously] ( #running-the-example ) and then
4545
46461 . Execute in command line ` sh exec.sh ` to run the Docker in Linux, or ` .\exec.ps1 ` to run the Docker in Windows.
47- 2 . Try calling [ http://localhost:3001 /ping ] ( http://localhost:3001 /ping )
47+ 2 . Try calling [ http://localhost:3010 /ping ] ( http://localhost:3010 /ping )
Original file line number Diff line number Diff line change 11docker build - t auth0- python- api .
2- docker run -- env- file .env - p 3001 : 3001 - it auth0- python- api
2+ docker run -- env- file .env - p 3010 : 3010 - it auth0- python- api
Original file line number Diff line number Diff line change 11#! /usr/bin/env bash
22docker build -t auth0-python-api .
3- docker run --env-file .env -p 3001:3001 -it auth0-python-api
3+ docker run --env-file .env -p 3010:3010 -it auth0-python-api
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- API_AUDIENCE = env .get ("API_ID " )
18+ AUTH0_AUDIENCE = env .get ("AUTH0_AUDIENCE " )
1919ALGORITHMS = ["RS256" ]
2020APP = Flask (__name__ )
2121
@@ -113,7 +113,7 @@ def decorated(*args, **kwargs):
113113 token ,
114114 rsa_key ,
115115 algorithms = ALGORITHMS ,
116- audience = API_AUDIENCE ,
116+ audience = AUTH0_AUDIENCE ,
117117 issuer = "https://" + AUTH0_DOMAIN + "/"
118118 )
119119 except jwt .ExpiredSignatureError :
@@ -169,4 +169,4 @@ def secured_private_ping():
169169
170170
171171if __name__ == "__main__" :
172- APP .run (host = "0.0.0.0" , port = env .get ("PORT" , 3001 ))
172+ APP .run (host = "0.0.0.0" , port = env .get ("PORT" , 3010 ))
You can’t perform that action at this time.
0 commit comments