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
Copy file name to clipboardExpand all lines: README.md
+35-1Lines changed: 35 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -27,7 +27,41 @@ The easiest way to filter this decision is by looking at the permissions set you
27
27
- Application permissions are used when you don’t need a user to login to your app, but the app will perform tasks on its own and run in the background.
28
28
- Delegated permissions, also called scopes, are used when your app requires a user to login and interact with data related to this user in a session.
29
29
30
-
In this demo we'll use the 2 most common scenarios: client secret credentials for application permissions and device code credentials for delegated permissions. You can also use environment credentials, interactive browser credentials, default azure credentials, on-behalf-of credentials, or any other Azure Identity library.
30
+
The following table lists common libraries by permissions set.
31
+
| MSAL library | Permissions set | Common use case |
32
+
|---|---|---|
33
+
|[ClientSecretCredential](https://learn.microsoft.com/en-us/python/api/azure-identity/azure.identity.aio.clientsecretcredential?view=azure-python&preserve-view=true)| Application permissions | Daemon apps or applications running in the background without a signed-in user. |
34
+
|[DeviceCodeCredential](https://learn.microsoft.com/en-us/python/api/azure-identity/azure.identity.devicecodecredential?view=azure-python)| Delegated permissions | Enviroments where authentication is triggered in one machine and completed in another e.g in a cloud server. |
35
+
|[InteractiveBrowserCredentials](https://learn.microsoft.com/en-us/python/api/azure-identity/azure.identity.interactivebrowsercredential?view=azure-python)| Delegated permissions | Environments where a browser is available and the user wants to key in their username/password. |
36
+
|[AuthorizationCodeCredentials](https://learn.microsoft.com/en-us/python/api/azure-identity/azure.identity.authorizationcodecredential?view=azure-python)| Delegated permissions | Usually for custom customer applications where the frontend calls the backend and waits for the authorization code at a particular url. |
37
+
38
+
You can also use [EnvironmentCredential](https://learn.microsoft.com/en-us/python/api/azure-identity/azure.identity.environmentcredential?view=azure-python), [DefaultAzureCredential](https://learn.microsoft.com/en-us/python/api/azure-identity/azure.identity.defaultazurecredential?view=azure-python), [OnBehalfOfCredential](https://learn.microsoft.com/en-us/python/api/azure-identity/azure.identity.onbehalfofcredential?view=azure-python), or any other [Azure Identity library](https://learn.microsoft.com/en-us/python/api/overview/azure/identity-readme?view=azure-python#credential-classes).
39
+
40
+
Once you've picked an authentication library, we can initiate the authentication provider in your app. The following example uses ClientSecretCredential with application permissions.
41
+
```python
42
+
import asyncio
43
+
44
+
from azure.identity.aio import ClientSecretCredential
45
+
from kiota_authentication_azure.azure_identity_authentication_provider import AzureIdentityAuthenticationProvider
0 commit comments