Skip to content

Commit ac18482

Browse files
Annybell VillarroelAnnybell Villarroel
authored andcommitted
Callback URL Instruction and update variable
1 parent 670907a commit ac18482

2 files changed

Lines changed: 4 additions & 6 deletions

File tree

00-Starter-Seed/README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ This sample demonstrates how to add authentication to a Python web app using Aut
66

77
To run the sample, make sure you have `python` and `pip` installed.
88

9-
Rename `.env.example` to `.env` and populate it with the client ID, domain, and secret for your Auth0 app.
9+
Rename `.env.example` to `.env` and populate it with the client ID, domain, and secret for your Auth0 app. Also, add the callback URL to the settings section of your Auth0 client.
1010

1111
Run `pip install -r requirements.txt` to install the dependencies and run `python server.py`. The app will be served at [http://localhost:3000/](http://localhost:3000/).
1212

@@ -37,5 +37,3 @@ If you have found a bug or if you have a feature request, please report them at
3737
## License
3838

3939
This project is licensed under the MIT license. See the [LICENSE](LICENSE) file for more info.
40-
41-

00-Starter-Seed/server.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def static_files(filename):
5454
def callback_handling():
5555
code = request.args.get(constants.CODE_KEY)
5656
json_header = {constants.CONTENT_TYPE_KEY: constants.APP_JSON_KEY}
57-
token_url = 'https://{domain}/oauth/token'.format(domain=env[constants.AUTH0_DOMAIN])
57+
token_url = 'https://{domain_auth0}/oauth/token'.format(domain_auth0=env[constants.AUTH0_DOMAIN])
5858
token_payload = {
5959
constants.CLIENT_ID_KEY : env[constants.AUTH0_CLIENT_ID],
6060
constants.CLIENT_SECRET_KEY : env[constants.AUTH0_CLIENT_SECRET],
@@ -65,8 +65,8 @@ def callback_handling():
6565

6666
token_info = requests.post(token_url, data=json.dumps(token_payload),
6767
headers=json_header).json()
68-
user_url = 'https://{domain}/userinfo?access_token={access_token}'.format(
69-
domain=env[constants.AUTH0_DOMAIN], access_token=token_info[constants.ACCESS_TOKEN_KEY])
68+
user_url = 'https://{domain_auth0}/userinfo?access_token={access_token}'.format(
69+
domain_auth0=env[constants.AUTH0_DOMAIN], access_token=token_info[constants.ACCESS_TOKEN_KEY])
7070
user_info = requests.get(user_url).json()
7171
session[constants.PROFILE_KEY] = user_info
7272
return redirect('/dashboard')

0 commit comments

Comments
 (0)