Skip to content

Commit 8afeb1d

Browse files
updated README and adjusted app_config
1 parent 6ea947c commit 8afeb1d

File tree

2 files changed

+9
-13
lines changed

2 files changed

+9
-13
lines changed

PersonalAccessTokenAPIAppSample/ms-identity-python-webapp-master/README.md

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,14 @@ languages:
44
- python
55
products:
66
- azure-active-directory
7-
description: "This sample demonstrates a Python web application calling the PAT Lifecycle API on PPE that is secured using Azure Active Directory."
7+
description: "This sample demonstrates a Python web application calling the PAT lifecycle management API that is secured using Azure Active Directory. Users can download the sample and fill in their own credentials in 'app_config.py' to try the API themselves."
88
urlFragment: ms-identity-python-webapp
99
---
1010
# Integrating Microsoft Identity Platform with a Python web application
1111

1212
## About this sample
1313

14-
> This sample is also available as a quickstart for the Microsoft identity platform:
15-
[Quickstart: Add sign-in with Microsoft to a Python web app]("https://docs.microsoft.com/azure/active-directory/develop/quickstart-v2-python-webapp")
14+
> This sample can also be created from a Quickstart for the Microsoft identity platform: [Get started with a Python Flask Quickstart application](TODO: add link to new content docs article)
1615
1716
### Overview
1817

@@ -128,7 +127,7 @@ In the steps below, "ClientID" is the same as "Application ID" or "AppId".
128127
Now you can set the secret in environment variable `CLIENT_SECRET`,
129128
and then adjust `app_config.py` to pick it up.
130129
1. Find the app key `Enter_the_Application_Id_here` and replace the existing value with the application ID (clientId) of the `python-webapp` application copied from the Azure portal.
131-
130+
1. Find the ENDPOINT variable and replace `Enter_the_Collection_Name_Here` with the name of your Azure DevOps collection.
132131

133132
### Step 4: Run the sample
134133

@@ -166,7 +165,4 @@ For more information, see MSAL.Python's [conceptual documentation]("https://gith
166165

167166
For more information about web apps scenarios on the Microsoft identity platform see [Scenario: Web app that calls web APIs](https://docs.microsoft.com/en-us/azure/active-directory/develop/scenario-web-app-call-api-overview)
168167

169-
For more information about how OAuth 2.0 protocols work in this scenario and other scenarios, see [Authentication Scenarios for Azure AD](http://go.microsoft.com/fwlink/?LinkId=394414).
170-
171-
## TODO
172-
- Add the rest of the PAT Lifecycle API endpoints
168+
For more information about how OAuth 2.0 protocols work in this scenario and other scenarios, see [Authentication Scenarios for Azure AD](http://go.microsoft.com/fwlink/?LinkId=394414).

PersonalAccessTokenAPIAppSample/ms-identity-python-webapp-master/app_config.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,26 @@
33
# To configure this application, fill in your application (client) ID, client secret,
44
# AAD tenant ID, and Azure DevOps collection name in the placeholders below.
55

6-
CLIENT_ID = "YOUR_CLIENT_ID_HERE"
6+
CLIENT_ID = "Enter_the_Application_Id_here"
77
# Application (client) ID of app registration
88

9-
CLIENT_SECRET = "CLIENT_SECRET_HERE"
9+
CLIENT_SECRET = "Enter_the_Client_Secret_here"
1010
# In a production app, we recommend you use a more secure method of storing your secret,
1111
# like Azure Key Vault. Or, use an environment variable as described in Flask's documentation:
1212
# https://flask.palletsprojects.com/en/1.1.x/config/#configuring-from-environment-variables
1313
# CLIENT_SECRET = os.getenv("CLIENT_SECRET")
1414
# if not CLIENT_SECRET:
1515
# raise ValueError("Need to define CLIENT_SECRET environment variable")
1616

17-
AUTHORITY = "https://login.windows-ppe.net/YOUR_AAD_TENANT_ID_HERE" # For multi-tenant app
18-
# AUTHORITY = "https://login.windows-ppe.net/Enter_the_Tenant_Name_Here"
17+
AUTHORITY = "https://login.microsoftonline.com/Enter_the_Tenant_Name_Here" # For multi-tenant app
18+
# AUTHORITY = "https://login.microsoftonline.com/Enter_the_Tenant_Name_Here"
1919

2020
REDIRECT_PATH = "/getAToken" # Used for forming an absolute URL to your redirect URI.
2121
# The absolute URL must match the redirect URI you set
2222
# in the app's registration in the Azure portal.
2323

2424

25-
ENDPOINT = 'https://dev.azure.com/YOUR_COLLECTION_HERE/_apis/Tokens/Pats?api-version=6.1-preview'
25+
ENDPOINT = 'https://dev.azure.com/Enter_the_Collection_Name_Here/_apis/Tokens/Pats?api-version=6.1-preview'
2626
# fill in the url to the user's ADO collection name here
2727

2828
SCOPE = ["499b84ac-1321-427f-aa17-267ca6975798/.default"]

0 commit comments

Comments
 (0)