Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
The configuration file would look like this (sans those // comments):

{
"authority": "https://login.microsoftonline.com/organizations",
"authority": "https://login.microsoftonline.com/Enter_the_Tenant_Name_Here",
"client_id": "your_client_id",
"scope": ["https://graph.microsoft.com/.default"],
// For more information about scopes for an app, refer:
// https://docs.microsoft.com/en-us/azure/active-directory/develop/v2-oauth2-client-creds-grant-flow#second-case-access-token-request-with-a-certificate"

"secret": "The secret generated by AAD during your confidential app registration"
"secret": "The secret generated by AAD during your confidential app registration",
// For information about generating client secret, refer:
// https://github.com/AzureAD/microsoft-authentication-library-for-python/wiki/Client-Credentials#registering-client-secrets-using-the-application-registration-portal

Expand Down Expand Up @@ -60,7 +60,7 @@
graph_data = requests.get( # Use token to call downstream service
config["endpoint"],
headers={'Authorization': 'Bearer ' + result['access_token']}, ).json()
print("Users from graph: " + str(graph_data))
print("Graph API call result: " + str(graph_data))
else:
print(result.get("error"))
print(result.get("error_description"))
Expand Down
2 changes: 1 addition & 1 deletion 1-Call-MsGraph-WithSecret/parameters.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"authority": "https://login.microsoftonline.com/organizations",
"authority": "https://login.microsoftonline.com/Enter_the_Tenant_Name_Here",
"client_id": "your_client_id",
"scope": [ "https://graph.microsoft.com/.default" ],
"secret": "The secret generated by AAD during your confidential app registration",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
The configuration file would look like this (sans those // comments):

{
"authority": "https://login.microsoftonline.com/organizations",
"authority": "https://login.microsoftonline.com/Enter_the_Tenant_Name_Here",
"client_id": "your_client_id",
"scope": ["https://graph.microsoft.com/.default"],
// For more information about scopes for an app, refer:
// https://docs.microsoft.com/en-us/azure/active-directory/develop/v2-oauth2-client-creds-grant-flow#second-case-access-token-request-with-a-certificate"

"thumbprint": "790E... The thumbprint generated by AAD when you upload your public cert",
"private_key_file": "filename.pem"
"private_key_file": "filename.pem",
// For information about generating thumbprint and private key file, refer:
// https://github.com/AzureAD/microsoft-authentication-library-for-python/wiki/Client-Credentials#client-credentials-with-certificate

Expand Down Expand Up @@ -60,7 +60,7 @@
graph_data = requests.get( # Use token to call downstream service
config["endpoint"],
headers={'Authorization': 'Bearer ' + result['access_token']}, ).json()
print("Users from graph: " + str(graph_data))
print("Graph API call result: " + str(graph_data))
else:
print(result.get("error"))
print(result.get("error_description"))
Expand Down
2 changes: 1 addition & 1 deletion 2-Call-MsGraph-WithCertificate/parameters.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"authority": "https://login.microsoftonline.com/organizations",
"authority": "https://login.microsoftonline.com/Enter_the_Tenant_Name_Here",
"client_id": "your_client_id",
"scope": [ "https://graph.microsoft.com/.default" ],
"thumbprint": "790E... The thumbprint generated by AAD when you upload your public cert",
Expand Down