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: articles/active-directory/develop/migrate-python-adal-msal.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -46,7 +46,7 @@ ADAL Python acquires tokens for resources, but MSAL Python acquires tokens for s
46
46
47
47
### Error handling
48
48
49
-
Azure Active Directory Authentication Library (ADAL) for Python uses the exception `AdalError` to indicate that there's been a problem. MSAL for Python typically uses error codes, instead. For more information, see [MSAL for Python error handling](msal-handling-exceptions.md#msal-for-python-error-handling).
49
+
Azure Active Directory Authentication Library (ADAL) for Python uses the exception `AdalError` to indicate that there's been a problem. MSAL for Python typically uses error codes, instead. For more information, see [MSAL for Python error handling](https://docs.microsoft.com/azure/active-directory/develop/msal-handling-exceptions?tabs=python).
50
50
51
51
### API changes
52
52
@@ -58,7 +58,7 @@ The following table lists an API in ADAL for Python, and the one to use in its p
|[acquire_token_with_refresh_token()](https://adal-python.readthedocs.io/en/latest/#adal.AuthenticationContext.acquire_token_with_refresh_token)| N/A (See the section above) |
|[acquire_token_with_device_code()](https://adal-python.readthedocs.io/en/latest/#adal.AuthenticationContext.acquire_token_with_device_code) and [cancel_request_to_get_token_with_device_code()](https://adal-python.readthedocs.io/en/latest/#adal.AuthenticationContext.cancel_request_to_get_token_with_device_code)|[acquire_token_by_device_flow()](https://msal-python.readthedocs.io/en/latest/#msal.PublicClientApplication.acquire_token_by_device_flow)|
Copy file name to clipboardExpand all lines: articles/active-directory/develop/msal-java-adfs-support.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -48,6 +48,6 @@ The supported AD FS versions in this federated scenario are:
48
48
49
49
When you acquire a token using `ConfidentialClientApplication.AcquireToken()` or `PublicClientApplication.AcquireToken()` with `IntegratedWindowsAuthenticationParameters` or `UsernamePasswordParameters`, MSAL for Java gets the identity provider to contact based on the username. MSAL for Java gets a [SAML 1.1 token](reference-saml-tokens.md) token from the identity provider, which it then provides to Azure AD which returns the JSON Web Token (JWT).
50
50
51
-
## See also
51
+
## Next steps
52
52
53
53
For the federated case, see [Configure Azure Active Directory sign in behavior for an application by using a Home Realm Discovery policy](https://docs.microsoft.com/azure/active-directory/manage-apps/configure-authentication-for-federated-users-portal)
Copy file name to clipboardExpand all lines: articles/active-directory/develop/msal-national-cloud.md
+52-15Lines changed: 52 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -56,9 +56,18 @@ If you don't have an Azure Government subscription, create a [free account](http
56
56
57
57
For details about using a national cloud with a particular programming language, choose the tab matching your language:
58
58
59
+
## [.NET](#tab/donet)
60
+
61
+
You can use MSAL.NET to sign in users, acquire tokens, and call the Microsoft Graph API in national clouds.
62
+
63
+
The following tutorials demonstrate how to build a .NET Core 2.2 MVC Web app. The app uses OpenID Connect to sign in users with a work and school account in an organization that belongs to a national cloud.
64
+
65
+
- To sign in users and acquire tokens, follow this tutorial: [Build an ASP.NET Core Web app signing-in users in sovereign clouds with the Microsoft identity platform](https://github.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2/tree/master/1-WebApp-OIDC/1-4-Sovereign#build-an-aspnet-core-web-app-signing-in-users-in-sovereign-clouds-with-the-microsoft-identity-platform).
66
+
- To call the Microsoft Graph API, follow this tutorial: [Using the Microsoft identity platform to call the Microsoft Graph API from an An ASP.NET Core 2.x Web App, on behalf of a user signing-in using their work and school account in Microsoft National Cloud](https://github.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2/tree/master/2-WebApp-graph-user/2-4-Sovereign-Call-MSGraph#using-the-microsoft-identity-platform-to-call-the-microsoft-graph-api-from-an-an-aspnet-core-2x-web-app-on-behalf-of-a-user-signing-in-using-their-work-and-school-account-in-microsoft-national-cloud).
67
+
59
68
## [JavaScript](#tab/javascript)
60
69
61
-
## JavaScript
70
+
To enable your MSAL.js application for sovereign clouds:
62
71
63
72
### Step 1: Register your application
64
73
@@ -128,17 +137,53 @@ In that code:
128
137
129
138
To find Microsoft Graph endpoints for all the national clouds, see [Microsoft Graph endpoints in national clouds](https://docs.microsoft.com/graph/deployments#microsoft-graph-and-graph-explorer-service-root-endpoints).
130
139
131
-
## .NET
140
+
## [Python](#tab/python)
132
141
133
-
You can use MSAL.NET to sign in users, acquire tokens, and call the Microsoft Graph API in national clouds.
142
+
To enable your MSAL Python application for sovereign clouds:
134
143
135
-
The following tutorials demonstrate how to build a .NET Core 2.2 MVC Web app. The app uses OpenID Connect to sign in users with a work and school account in an organization that belongs to a national cloud.
144
+
- Register your application in a specific portal, depending on the cloud. For more information on how to choose the portal refer [App registration endpoints](authentication-national-cloud.md#app-registration-endpoints)
145
+
- Use any of the [samples](https://github.com/AzureAD/microsoft-authentication-library-for-python/tree/dev/sample) from the repo with a few changes to the configuration, depending on the cloud, which is mentioned next.
146
+
- Use a specific authority, depending on the cloud you registered the application in. For more information on authorities for different clouds, refer [Azure AD Authentication endpoints](authentication-national-cloud.md#azure-ad-authentication-endpoints).
- To call Microsoft graph requires a specific Graph endpoint URL that depends on which cloud you are using. To find Microsoft Graph endpoints for all the national clouds, refer to [Microsoft Graph and Graph Explorer service root endpoints](https://docs.microsoft.com/graph/deployments#microsoft-graph-and-graph-explorer-service-root-endpoints).
155
+
156
+
Here's an example of a graph endpoint, with scope:
157
+
158
+
```json
159
+
"endpoint" : "https://graph.microsoft.us/v1.0/me"
160
+
"scope": "User.Read"
161
+
```
162
+
163
+
## [Java](#tab/java)
136
164
137
-
- To sign in users and acquire tokens, follow [this tutorial](https://github.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2/tree/master/1-WebApp-OIDC/1-4-Sovereign#build-an-aspnet-core-web-app-signing-in-users-in-sovereign-clouds-with-the-microsoft-identity-platform).
138
-
- To call the Microsoft Graph API, follow [this tutorial](https://github.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2/tree/master/2-WebApp-graph-user/2-4-Sovereign-Call-MSGraph#using-the-microsoft-identity-platform-to-call-the-microsoft-graph-api-from-an-an-aspnet-core-2x-web-app-on-behalf-of-a-user-signing-in-using-their-work-and-school-account-in-microsoft-national-cloud).
165
+
To enable your MSAL for Java application for sovereign clouds:
166
+
167
+
- Register your application in a specific portal, depending on the cloud. For more information on how to choose the portal refer [App registration endpoints](authentication-national-cloud.md#app-registration-endpoints)
168
+
- Use any of the [samples](https://github.com/AzureAD/microsoft-authentication-library-for-java/tree/dev/src/samples) from the repo with a few changes to the configuration, depending on the cloud, which are mentioned next.
169
+
- Use a specific authority, depending on the cloud you registered the application in. For more information on authorities for different clouds, refer [Azure AD Authentication endpoints](authentication-national-cloud.md#azure-ad-authentication-endpoints).
- To call Microsoft graph requires a specific Graph endpoint URL that depends on which cloud you are using. To find Microsoft Graph endpoints for all the national clouds, refer to [Microsoft Graph and Graph Explorer service root endpoints](https://docs.microsoft.com/graph/deployments#microsoft-graph-and-graph-explorer-service-root-endpoints).
178
+
179
+
Here's an example of a graph endpoint, with scope:
180
+
181
+
```json
182
+
"endpoint" : "https://graph.microsoft.us/v1.0/me"
183
+
"scope": "User.Read"
184
+
```
139
185
140
186
## [Objective-C](#tab/objc)
141
-
## MSAL for iOS and macOS
142
187
143
188
MSAL for iOS and macOS can be used to acquire tokens in national clouds, but it requires additional configuration when creating `MSALPublicClientApplication`.
144
189
@@ -174,14 +219,6 @@ let config = MSALPublicClientApplicationConfig(clientId: "<your-client-id-here>"
174
219
if let application = try? MSALPublicClientApplication(configuration: config) { /* Use application */}
175
220
```
176
221
177
-
## [Java](#tab/java)
178
-
179
-
To enable your MSAL for Java application for sovereign clouds, you must:
180
-
181
-
- Register your application in a specific portal, depending on the cloud
182
-
- Use a specific authority, depending on the cloud in the config file for your application
183
-
- To call the Microsoft Graph API requires a specific Graph endpoint URL, depending on the cloud.
Copy file name to clipboardExpand all lines: articles/active-directory/develop/msal-net-adfs-support.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -58,6 +58,6 @@ Currently, there are no plans to support a direct connection to:
58
58
59
59
If you need to support scenarios requiring a direct connection to AD FS 2016, use the latest version of [Azure Active Directory Authentication Library](active-directory-authentication-libraries.md#microsoft-supported-client-libraries). When you have upgraded your on-premises system to AD FS 2019, you'll be able to use MSAL.NET.
60
60
61
-
## See also
61
+
## Next steps
62
62
63
63
For the federated case, see [Configure Azure Active Directory sign in behavior for an application by using a Home Realm Discovery policy](https://docs.microsoft.com/azure/active-directory/manage-apps/configure-authentication-for-federated-users-portal)
title: Azure AD FS support in Microsoft Authentication Library for Python
3
+
titleSuffix: Microsoft identity platform
4
+
description: Learn about Active Directory Federation Services (AD FS) support in Microsoft Authentication Library for Python
5
+
services: active-directory
6
+
documentationcenter: dev-center-name
7
+
author: abhidnya13
8
+
manager: henrikm
9
+
editor: ''
10
+
11
+
ms.service: active-directory
12
+
ms.subservice: develop
13
+
ms.devlang: na
14
+
ms.topic: conceptual
15
+
ms.tgt_pltfrm: na
16
+
ms.workload: identity
17
+
ms.date: 11/23/2019
18
+
ms.author: abpati
19
+
ms.reviewer: navyasri.canumalla
20
+
ms.custom: aaddev
21
+
#Customer intent: As an application developer, I want to learn about AD FS support in MSAL for Python so I can decide if this platform meets my application development needs and requirements.
22
+
ms.collection: M365-identity-device-management
23
+
---
24
+
25
+
# Active Directory Federation Services support in MSAL for Python
26
+
27
+
Active Directory Federation Services (AD FS) in Windows Server enables you to add OpenID Connect and OAuth 2.0 based authentication and authorization to your apps by using the Microsoft Authentication Library (MSAL) for Python. Using the MSAL for Python library, your app can authenticate users directly against AD FS. For more information about scenarios, see [AD FS Scenarios for Developers](https://docs.microsoft.com/windows-server/identity/ad-fs/overview/ad-fs-scenarios-for-developers).
28
+
29
+
There are usually two ways of authenticating against AD FS:
30
+
31
+
- MSAL Python talks to Azure Active Directory, which itself is federated with other identity providers. The federation happens through AD FS. MSAL Python connects to Azure AD, which signs in users that are managed in Azure AD (managed users) or users managed by another identity provider such as AD FS (federated users). MSAL Python doesn't know that a user is federated. It simply talks to Azure AD. The [authority](msal-client-application-configuration.md#authority) you use in this case is the usual authority (authority host name + tenant, common, or organizations).
32
+
- MSAL Python talks directly to an AD FS authority. This is only supported by AD FS 2019 and later.
33
+
34
+
## Connect to Active Directory federated with AD FS
35
+
36
+
### Acquire a token interactively for a federated user
37
+
38
+
The following applies whether you connect directly to Active Directory Federation Services (AD FS) or through Active Directory.
39
+
40
+
When you call `acquire_token_by_authorization_code` or `acquire_token_by_device_flow`, the user experience is typically as follows:
41
+
42
+
1. The user enters their account ID.
43
+
2. Azure AD displays briefly the message "Taking you to your organization's page" and the user is redirected to the sign-in page of the identity provider. The sign-in page is usually customized with the logo of the organization.
44
+
45
+
The supported AD FS versions in this federated scenario are:
46
+
- Active Directory Federation Services FS v2
47
+
- Active Directory Federation Services v3 (Windows Server 2012 R2)
48
+
- Active Directory Federation Services v4 (AD FS 2016)
49
+
50
+
### Acquire a token via username and password
51
+
52
+
The following applies whether you connect directly to Active Directory Federation Services (AD FS) or through Active Directory.
53
+
54
+
When you acquire a token using `acquire_token_by_username_password`, MSAL Python gets the identity provider to contact based on the username. MSAL Python gets a [SAML 1.1 token](reference-saml-tokens.md) from the identity provider, which it then provides to Azure AD which returns the JSON Web Token (JWT).
55
+
56
+
## Connecting directly to AD FS
57
+
58
+
When you connect directory to AD FS, the authority you'll want to use to build your application will be something like `https://somesite.contoso.com/adfs/`
59
+
60
+
MSAL Python supports ADFS 2019.
61
+
62
+
It does not support a direct connection to ADFS 2016 or ADFS v2. If you need to support scenarios requiring a direct connection to ADFS 2016, use the latest version of ADAL Python. Once you have upgraded your on-premises system to ADFS 2019, you can use MSAL Python.
63
+
64
+
## Next steps
65
+
66
+
- For the federated case, see [Configure Azure Active Directory sign in behavior for an application by using a Home Realm Discovery policy](../manage-apps/configure-authentication-for-federated-users-portal.md)
0 commit comments