File tree Expand file tree Collapse file tree 4 files changed +8
-8
lines changed
1-Call-MsGraph-WithSecret
2-Call-MsGraph-WithCertificate Expand file tree Collapse file tree 4 files changed +8
-8
lines changed Original file line number Diff line number Diff line change 22The 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
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 ))
6464else :
6565 print (result .get ("error" ))
6666 print (result .get ("error_description" ))
Original file line number Diff line number Diff line change 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" ,
Original file line number Diff line number Diff line change 22The 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
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 ))
6464else :
6565 print (result .get ("error" ))
6666 print (result .get ("error_description" ))
Original file line number Diff line number Diff line change 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" ,
You can’t perform that action at this time.
0 commit comments