Skip to content

Commit a5535ed

Browse files
authored
Merge pull request #2 from Azure-Samples/changes
Addressing PR comments in the original PR in MSAL Python repo
2 parents 904fba9 + ad45cbd commit a5535ed

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

1-Call-MsGraph-WithSecret/confidential_client_secret_sample.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
The configuration file would look like this (sans those // comments):
33
44
{
5-
"authority": "https://login.microsoftonline.com/organizations",
5+
"authority": "https://login.microsoftonline.com/Enter_the_Tenant_Name_Here",
66
"client_id": "your_client_id",
77
"scope": ["https://graph.microsoft.com/.default"],
88
// For more information about scopes for an app, refer:
99
// https://docs.microsoft.com/en-us/azure/active-directory/develop/v2-oauth2-client-creds-grant-flow#second-case-access-token-request-with-a-certificate"
1010
11-
"secret": "The secret generated by AAD during your confidential app registration"
11+
"secret": "The secret generated by AAD during your confidential app registration",
1212
// For information about generating client secret, refer:
1313
// https://github.com/AzureAD/microsoft-authentication-library-for-python/wiki/Client-Credentials#registering-client-secrets-using-the-application-registration-portal
1414
@@ -60,7 +60,7 @@
6060
graph_data = requests.get( # Use token to call downstream service
6161
config["endpoint"],
6262
headers={'Authorization': 'Bearer ' + result['access_token']}, ).json()
63-
print("Users from graph: " + str(graph_data))
63+
print("Graph API call result: " + str(graph_data))
6464
else:
6565
print(result.get("error"))
6666
print(result.get("error_description"))

1-Call-MsGraph-WithSecret/parameters.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"authority": "https://login.microsoftonline.com/organizations",
2+
"authority": "https://login.microsoftonline.com/Enter_the_Tenant_Name_Here",
33
"client_id": "your_client_id",
44
"scope": [ "https://graph.microsoft.com/.default" ],
55
"secret": "The secret generated by AAD during your confidential app registration",

2-Call-MsGraph-WithCertificate/confidential_client_certificate_sample.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
The configuration file would look like this (sans those // comments):
33
44
{
5-
"authority": "https://login.microsoftonline.com/organizations",
5+
"authority": "https://login.microsoftonline.com/Enter_the_Tenant_Name_Here",
66
"client_id": "your_client_id",
77
"scope": ["https://graph.microsoft.com/.default"],
88
// For more information about scopes for an app, refer:
99
// https://docs.microsoft.com/en-us/azure/active-directory/develop/v2-oauth2-client-creds-grant-flow#second-case-access-token-request-with-a-certificate"
1010
1111
"thumbprint": "790E... The thumbprint generated by AAD when you upload your public cert",
12-
"private_key_file": "filename.pem"
12+
"private_key_file": "filename.pem",
1313
// For information about generating thumbprint and private key file, refer:
1414
// https://github.com/AzureAD/microsoft-authentication-library-for-python/wiki/Client-Credentials#client-credentials-with-certificate
1515
@@ -60,7 +60,7 @@
6060
graph_data = requests.get( # Use token to call downstream service
6161
config["endpoint"],
6262
headers={'Authorization': 'Bearer ' + result['access_token']}, ).json()
63-
print("Users from graph: " + str(graph_data))
63+
print("Graph API call result: " + str(graph_data))
6464
else:
6565
print(result.get("error"))
6666
print(result.get("error_description"))

2-Call-MsGraph-WithCertificate/parameters.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"authority": "https://login.microsoftonline.com/organizations",
2+
"authority": "https://login.microsoftonline.com/Enter_the_Tenant_Name_Here",
33
"client_id": "your_client_id",
44
"scope": [ "https://graph.microsoft.com/.default" ],
55
"thumbprint": "790E... The thumbprint generated by AAD when you upload your public cert",

0 commit comments

Comments
 (0)