You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Quickstart: Acquire a token and call Microsoft Graph API from a Python console app using app's identity
25
25
26
-
In this quickstart, you'll learn how to write a Python application that can get an access token using the app's own identity, and then call the Microsoft Graph API to display a [list of users](https://docs.microsoft.com/graph/api/user-list) in the directory. This scenario is useful for situations where headless, unattended job or a windows service needs to run with an application identity, instead of a user's identity.
26
+
In this quickstart, write a Python application that gets an accessing token using the app's identity, and then calls the Microsoft Graph API to display a [list of users](https://docs.microsoft.com/graph/api/user-list) in the directory. This scenario is useful for situations where headless, unattended job or a windows service needs to run with an application identity, instead of a user's identity.
27
27
28
-

28
+
> [!div renderon="docs"]
29
+
> 
29
30
30
31
## Prerequisites
31
32
@@ -83,7 +84,7 @@ To run this sample, you will need:
83
84
#### Step 3: Configure your Python project
84
85
85
86
1. Extract the zip file to a local folder close to the root of the disk, for example, **C:\Azure-Samples**.
86
-
1.navigate to the sub folder **1-Call-MsGraph-WithSecret"**.
87
+
1.Navigate to the sub folder **1-Call-MsGraph-WithSecret"**.
87
88
1. Edit **parameters.json** and replace the values of the fields `authority`, `client_id`, and `secret` with the following snippet:
You should see some json containing a list of users in your Azure AD directory as result.
153
+
You should see on the console output some Json fragment representing a list of users in your Azure AD directory.
153
154
154
155
> [!IMPORTANT]
155
156
> This quickstart application uses a client secret to identify itself as confidential client. Because the client secret is added as a plain-text to your project files, for security reasons, it is recommended that you use a certificate instead of a client secret before considering the application as production application. For more information on how to use a certificate, see [these instructions](https://github.com/Azure-Samples/ms-identity-python-daemon/blob/master/2-Call-MsGraph-WithCertificate/README.md) in the same GitHub repository for this sample, but in the second folder **2-Call-MsGraph-WithCertificate**
156
157
157
158
## More information
158
159
159
-
### MSAL.Python
160
+
### MSALPython
160
161
161
-
[MSAL.Python](https://github.com/AzureAD/microsoft-authentication-library-for-python) is the library used to sign in users and request tokens used to access an API protected by Microsoft identity platform. As described, this quickstart requests tokens by using the application own identity instead of delegated permissions. The authentication flow used in this case is known as *[client credentials oauth flow](v2-oauth2-client-creds-grant-flow.md)*. For more information on how to use MSAL.Python with daemon apps, see [this article](scenario-daemon-overview.md).
162
+
[MSALPython](https://github.com/AzureAD/microsoft-authentication-library-for-python) is the library used to sign in users and request tokens used to access an API protected by Microsoft identity platform. As described, this quickstart requests tokens by using the application own identity instead of delegated permissions. The authentication flow used in this case is known as *[client credentials oauth flow](v2-oauth2-client-creds-grant-flow.md)*. For more information on how to use MSALPython with daemon apps, see [this article](scenario-daemon-overview.md).
162
163
163
-
You can install MSAL.Python by running the following pip command.
164
+
You can install MSALPython by running the following pip command.
0 commit comments