|
1 | | -""" |
2 | | -This file contains configuration settings for running the Python auth samples |
3 | | -locally. In a production deployment, this information should be saved in a |
4 | | -database or other secure storage mechanism. |
| 1 | +"""Configuration settings for running the Python auth samples locally. |
| 2 | +
|
| 3 | +In a production deployment, this information should be saved in a database or |
| 4 | +other secure storage mechanism. |
5 | 5 | """ |
6 | 6 |
|
7 | | -CLIENT_ID = 'PUT YOUR CLIENT ID HERE' |
8 | | -CLIENT_SECRET = 'PUT YOUR CLIENT SECRET HERE' |
| 7 | +CLIENT_ID = 'ENTER_YOUR_CLIENT_ID' |
| 8 | +CLIENT_SECRET = 'ENTER_YOUR_SECRET' |
9 | 9 | REDIRECT_URI = 'http://localhost:5000/login/authorized' |
10 | 10 |
|
| 11 | +# AUTHORITY_URL ending determines type of account that can be authenticated: |
| 12 | +# /organizations = organizational accounts only |
| 13 | +# /consumers = MSAs only (Microsoft Accounts - Live.com, Hotmail.com, etc.) |
| 14 | +# /common = allow both types of accounts |
11 | 15 | AUTHORITY_URL = 'https://login.microsoftonline.com/common' |
| 16 | + |
12 | 17 | AUTH_ENDPOINT = '/oauth2/v2.0/authorize' |
13 | 18 | TOKEN_ENDPOINT = '/oauth2/v2.0/token' |
14 | 19 |
|
15 | 20 | RESOURCE = 'https://graph.microsoft.com/' |
16 | 21 | API_VERSION = 'v1.0' |
17 | | -SCOPES = ['User.Read'] # add other scopes/permissions as needed |
| 22 | +SCOPES = ['User.Read'] # Add other scopes/permissions as needed. |
| 23 | + |
18 | 24 |
|
19 | 25 | # This code can be removed after configuring CLIENT_ID and CLIENT_SECRET above. |
20 | | -if ' ' in CLIENT_ID or ' ' in CLIENT_SECRET: |
| 26 | +if 'ENTER_YOUR' in CLIENT_ID or 'ENTER_YOUR' in CLIENT_SECRET: |
21 | 27 | print('ERROR: config.py does not contain valid CLIENT_ID and CLIENT_SECRET') |
22 | 28 | import sys |
23 | 29 | sys.exit(1) |
0 commit comments