Skip to content

Commit 2483772

Browse files
authored
Merge pull request #19 from auth0-samples/change-port
Change port
2 parents b613a24 + 189d061 commit 2483772

6 files changed

Lines changed: 11 additions & 11 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-
API_ID={API_AUDIENCE}
2+
AUTH0_AUDIENCE={API_AUDIENCE}

00-Starter-Seed/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ RUN pip install -r requirements.txt
99
ADD . /home/app
1010
CMD python server.py
1111

12-
EXPOSE 3001
12+
EXPOSE 3010

00-Starter-Seed/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,16 @@ Once you've set those 2 enviroment variables:
2525

2626
1. Install the needed dependencies with `pip install -r requirements.txt`
2727
2. 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
3333
throw an error if you don't send an access token signed with RS256 with the appropriate issuer and audience in the
3434
Authorization header.
3535

3636
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
37+
[http://localhost:3010/secured/private/ping](http://localhost:3010/secured/private/ping) which will throw an error if
3838
you don't send an access token with the scope `read:agenda` signed with RS256 with the appropriate issuer and audience
3939
in the Authorization header.
4040

@@ -44,4 +44,4 @@ In order to run the sample with [Docker](https://www.docker.com/) you need to ad
4444
to the `.env` filed as explained [previously](#running-the-example) and then
4545

4646
1. 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)

00-Starter-Seed/exec.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
docker 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

00-Starter-Seed/exec.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#!/usr/bin/env bash
22
docker 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

00-Starter-Seed/server.py

Lines changed: 3 additions & 3 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-
API_AUDIENCE = env.get("API_ID")
18+
AUTH0_AUDIENCE = env.get("AUTH0_AUDIENCE")
1919
ALGORITHMS = ["RS256"]
2020
APP = 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

171171
if __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))

0 commit comments

Comments
 (0)