Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation cleanup/fixes #423

Merged
merged 21 commits into from
May 23, 2024
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
12 changes: 12 additions & 0 deletions .openpublishing.redirection.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,18 @@
{
"source_path": "dotnet/api/overview/msal-public-client/index.md",
"redirect_url": "/dotnet/api/overview/core-msal-net-libraries/"
},
{
"source_path": "msal-dotnet-articles/resources/ios12-security-advisory.md",
"redirect_url": "/entra/msal/dotnet/"
},
{
"source_path": "msal-dotnet-articles/acquiring-tokens/desktop-mobile/uwp.md",
"redirect_url": "/entra/msal/dotnet/"
},
{
"source_path": "msal-dotnet-articles/acquiring-tokens/desktop-mobile/xamarin.md",
"redirect_url": "/entra/msal/dotnet/acquiring-tokens/desktop-mobile/mobile-applications"
}
]
}
6 changes: 1 addition & 5 deletions msal-dotnet-articles/TOC.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@
- name: Using MSAL.NET with Web Account Manager (WAM)
href: acquiring-tokens/desktop-mobile/wam.md
- name: Xamarin
href: acquiring-tokens/desktop-mobile/xamarin.md
- name: Universal Windows Platform
href: acquiring-tokens/desktop-mobile/uwp.md
href: acquiring-tokens/desktop-mobile/mobile-applications.md
- name: Sign-in users with social identities
href: acquiring-tokens/desktop-mobile/social-identities.md
- name: Integrated Windows Authentication for domain or Microsoft Entra joined machines
Expand Down Expand Up @@ -185,8 +183,6 @@
href: resources/telemetry-overview.md
- name: Handling of personally identifiable information
href: resources/handling-pii.md
- name: iOS12 security advisory
href: resources/ios12-security-advisory.md
- name: Releases
href: https://github.com/AzureAD/microsoft-authentication-library-for-dotnet/releases
- name: MSAL.NET reference documentation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,13 +196,10 @@ Depending on the platform, additional configuration might be required for intera

- [Configuration requirements and troubleshooting tips for Xamarin Android with MSAL.NET](/entra/identity-platform/msal-net-xamarin-android-considerations)
- [Considerations for using Xamarin iOS with MSAL.NET](/entra/identity-platform/msal-net-xamarin-ios-considerations)
- [Using MSAL.NET with UWP applications](./uwp.md)

## Samples

| Sample | Platform | Description |
|------ | -------- | ----------- |
| [active-directory-dotnet-desktop-msgraph-v2](https://github.com/azure-samples/active-directory-dotnet-desktop-msgraph-v2) | Desktop (WPF) | Windows Desktop .NET (WPF) application calling the Microsoft Graph API. ![WPF app topology](../../media/wpf-app-topology.png) |
| [active-directory-dotnet-native-uwp-v2](https://github.com/azure-samples/active-directory-dotnet-native-uwp-v2) | UWP | A Windows Universal Platform client application using MSAL.NET, accessing the Microsoft Graph for a user authenticating with Azure AD v2.0 endpoint. ![UWP app topology](../../media/uwp-app-topology.png) |
| [https://github.com/Azure-Samples/active-directory-xamarin-native-v2](https://github.com/Azure-Samples/active-directory-xamarin-native-v2) | Xamarin iOS, Android, UWP | A simple Xamarin Forms app showcasing how to use MSAL to authenticate Microsoft accounts and Microsoft Entra ID via the Microsoft identity platform endpoint, and access the Microsoft Graph with the resulting token. ![Xamarin Forms app topology](../../media/xamarin-forms-topology.png) |
| [https://github.com/Azure-Samples/active-directory-dotnet-native-aspnetcore-v2](https://github.com/Azure-Samples/active-directory-dotnet-native-aspnetcore-v2) | WPF, ASP.NET Core 2.0 Web API | A WPF application calling an ASP.NET Core Web API using Azure AD v2.0. ![Desktop and web app interaction topology](../../media/desktop-web-topology.png) |
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ If your desktop or mobile application runs on Windows and on a machine connected

- **Federated** users only, i.e. those created in an Active Directory and backed by Microsoft Entra ID. Users created directly in Microsoft Entra ID, without AD backing - **managed** users - cannot use this auth flow. This limitation does not affect the Username/Password flow.
- Does not work for MSA users. For MSA uses try out [WAM](./wam.md)
- IWA is for apps written for .NET Framework, .NET Core and UWP platforms
- IWA is for applications written for .NET and .NET Framework.
- IWA does NOT bypass MFA (multi factor authentication). If MFA is configured, IWA might fail if an MFA challenge is required, because MFA requires user interaction.
> This one is tricky. IWA is non-interactive, but 2FA requires user interactivity. You do not control when the identity provider requests 2FA to be performed, the tenant admin does. From our observations, 2FA is required when you login from a different country, when not connected via VPN to a corporate network, and sometimes even when connected via VPN. Don’t expect a deterministic set of rules, Microsoft Entra ID uses AI to continuously learn if 2FA is required. You should fallback to a [user prompt](./acquiring-tokens-interactively.md) if IWA fails

Expand Down Expand Up @@ -120,10 +120,7 @@ static async Task GetATokenForGraph()
// Explanation: the library was unable to query the current Windows logged-in user or this user is not AD or Azure AD
// joined (work-place joined users are not supported).

// Mitigation 1: on UWP, check that the application has the following capabilities: Enterprise Authentication,
// Private Networks (Client and Server), User Account Information

// Mitigation 2: Implement your own logic to fetch the username (e.g. [email protected]) and use the
// Mitigation: Implement your own logic to fetch the username (e.g. [email protected]) and use the
// AcquireTokenByIntegratedWindowsAuth form that takes in the username

// Error Code: integrated_windows_auth_not_supported_managed_user
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
title: Using MSAL.NET With MAUI and Xamarin
title: Using MSAL.NET With .NET MAUI
description: "How to use MSAL.NET on mobile platforms."
---

# Using MSAL.NET With MAUI and Xamarin
# Using MSAL.NET With MAUI

MSAL.NET can run on mobile devices (both iOS and Android) through applications built with [.NET Multi-platform App UI (MAUI)](https://dotnet.microsoft.com/apps/maui).

Expand All @@ -14,19 +14,19 @@ MSAL.NET can run on mobile devices (both iOS and Android) through applications b

MSAL.NET can be used with authentication brokers on mobile devices, such as Microsoft Authenticator or the Company Portal. To learn more about how to configure applications to use brokers on iOS and Android, refer to [Use Microsoft Authenticator or Intune Company Portal on Xamarin applications](/azure/active-directory/develop/msal-net-use-brokers-with-xamarin-apps).

## MAUI and Xamarin Android
## MAUI on Android

To get started with MSAL.NET integration on Android, refer to the following resources:

- [How to migrate Xamarin ADAL apps to MSAL for Android](/azure/active-directory/develop/msal-net-migration-android-broker)
- [Xamarin Android Configuration Tips + Troubleshooting](/azure/active-directory/develop/msal-net-xamarin-android-considerations)
- [Xamarin Android System Browser Info](/azure/active-directory/develop/msal-net-system-browser-android-considerations)
- [How to migrate Xamarin ADAL apps to MSAL for Android](/entra/identity-platform/msal-net-migration-android-broker)
- [Xamarin Android Configuration Tips + Troubleshooting](/entra/identity-platform/msal-net-xamarin-android-considerations)
- [Xamarin Android System Browser Info](/entra/identity-platform/msal-net-system-browser-android-considerations)

To learn more about testing MSAL on Android devices, refer to the [MSAL for Android Wiki](https://github.com/AzureAD/microsoft-authentication-library-for-android/wiki/Android-Emulator-with-MSAL).

## MAUI and Xamarin iOS
## MAUI on iOS

To get started with MSAL.NET integration on iOS, refer to the following resources:

- [How to migrate Xamarin ADAL apps to MSAL for iOS](/azure/active-directory/develop/msal-net-migration-ios-broker)
- [Xamarin iOS Configuration Tips + Troubleshooting](/azure/active-directory/develop/msal-net-xamarin-ios-considerations)
- [How to migrate Xamarin ADAL apps to MSAL for iOS](/entra/identity-platform/msal-net-migration-ios-broker)
- [Xamarin iOS Configuration Tips + Troubleshooting](/entra/identity-platform/msal-net-xamarin-ios-considerations)
Original file line number Diff line number Diff line change
Expand Up @@ -220,9 +220,3 @@ One option is to use the "name" claim as the preferred username. The process is
## Customizing the UI

[Customize the user interface with Azure AD B2C](/azure/active-directory-b2c/customize-ui-overview).

## Samples illustrating acquiring tokens interactively with MSAL.NET for B2C applications

Sample | Platform | Description
------ | -------- | -----------
[active-directory-b2c-xamarin-native](https://github.com/Azure-Samples/active-directory-b2c-xamarin-native) | Xamarin iOS, Xamarin Android, UWP | A simple Xamarin Forms app showcasing how to use MSAL.NET to authenticate users via Azure Active Directory B2C, and access a Web API with the resulting tokens.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ In addition to the [Integrated Windows Authentication constraints](integrated-wi
- Available starting with MSAL 2.1.0.
- Not compatible with conditional access and multi-factor authentication. As a consequence, if the app runs in a Microsoft Entra tenant where the tenant admin requires multi-factor authentication, the flow cannot be used.
- Only available for work and school accounts and **not** personal Microsoft accounts.
- Available on .NET Framework and .NET/.NET Core, but not for Universal Windows Platform (UWP) applications.
- Available on .NET Framework and .NET/.NET Core.

### Authority implications

Expand Down
73 changes: 0 additions & 73 deletions msal-dotnet-articles/acquiring-tokens/desktop-mobile/uwp.md

This file was deleted.

6 changes: 2 additions & 4 deletions msal-dotnet-articles/acquiring-tokens/desktop-mobile/wam.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ WAM support is split across two packages:
>[!NOTE]
>For migration purposes, and if you have a .NET 6, .NET Core, or a .NET Standard application that needs to use _both_ WAM and the [embedded browser](/azure/active-directory/develop/msal-net-web-browsers#embedded-vs-system-web-ui), you will also need to use the [Microsoft.Identity.Client.Desktop](https://www.nuget.org/packages/Microsoft.Identity.Client.Desktop/) package. Once added, developers can use [`WithWindowsDesktopFeatures`](xref:Microsoft.Identity.Client.Desktop.DesktopExtensions.WithWindowsDesktopFeatures*) when setting up their public client application.
>
>If your application targets UWP or `net-windows` (version-dependent Target Framework Moniker for Windows), WAM is included in the MSAL.NET package (applicable to versions 4.60.3 and below).
>If your application targets `net-windows` (version-dependent Target Framework Moniker for Windows), WAM is included in the MSAL.NET package.

After referencing the relevant packages, call [`WithBroker(BrokerOptions)`](xref:Microsoft.Identity.Client.Desktop.WamExtension.WithBroker*) with broker configuration options and [a window handle](#parent-window-handles) that the broker will be bound to.

>[!NOTE]
>Most apps need to reference the [`Microsoft.Identity.Client.Broker`](https://www.nuget.org/packages/Microsoft.Identity.Client.Broker/) package to use this integration. .NET MAUI and UWP applications don't need to add the dependency because the functionality is embedded into MSAL.
>Most apps need to reference the [`Microsoft.Identity.Client.Broker`](https://www.nuget.org/packages/Microsoft.Identity.Client.Broker/) package to use this integration. .NET MAUI applications don't need to add the dependency because the functionality is embedded into MSAL.

```csharp
var scopes = new[] { "User.Read" };
Expand Down Expand Up @@ -158,8 +158,6 @@ This flow, also known as Resource Owner Password Credentials (ROPC), is not reco

- Azure B2C and Active Directory Federation Services (ADFS) authorities aren't supported. MSAL will fall back to using a browser for user authentication.
- On Mac, Linux, and versions of Windows earlier than 10 or Windows Server 2019, MSAL will fall back to a browser.
- Updated WAM broker is not available on UWP due to Windows API limitations. UWP apps will use the legacy WAM implementation.
- At this time, WAM uses EdgeHTML as the browser engine for authentication flows. Organizations and identity providers need to ensure that EdgeHTML is an allowed browser engine on customer devices for WAM-based applications to work.

## Package availability

Expand Down
6 changes: 3 additions & 3 deletions msal-dotnet-articles/acquiring-tokens/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ As explained in [Scenarios](../getting-started/scenarios.md), there are many way

For both public and confidential client applications, MSAL.NET supports adding a token cache that preserves authentication and refresh tokens, as well as proactively refreshes those on an as-needed basis. For details, see [Token cache serialization in MSAL.NET](../how-to/token-cache-serialization.md).

In the case of Universal Windows Platform (UWP) applications, Xamarin for iOS, and Xamarin for Android, token cache serialization to an isolated storage is automatically provided by MSAL.NET and developers do not need to add any custom caching logic. For .NET desktop applications (.NET, .NET Framework, and .NET Core) the application needs to handle the token cache serialization and storage directly; however, helper classes are available to help simplify the process.
For .NET desktop applications (.NET, .NET Framework, and .NET Core) the application needs to handle the token cache serialization and storage directly; however, helper classes are available to help simplify the process.

## Token acquisition methods

Expand All @@ -42,8 +42,8 @@ The following table summarizes the available approaches to acquire tokens in pub
| Operating system | Platform | App type | [Interactive](./desktop-mobile/acquiring-tokens-interactively.md) | [IWA](./desktop-mobile/integrated-windows-authentication.md) | [Device Code](./desktop-mobile/device-code-flow.md) |
|:----------------------|:----------------|:---------|:------------------------------------------------------------------|:-------------------------------------------------------------|:----------------------------------------------------|
| Windows (desktop) | .NET | Desktop (WPF, Windows Forms, Console) | ✅ | ✅ | ✅ |
| Android | Xamarin Android | Mobile | ✅ | ❌ | ❌ |
| iOS | Xamarin iOS | Mobile | ✅ | ❌ | ✅ |
| Android | .NET MAUI | Mobile | ✅ | ❌ | ❌ |
| iOS | .NET MAUI | Mobile | ✅ | ❌ | ✅ |
| macOS, Linux, Windows | .NET Core | Console | N/A see [Using web browsers](../acquiring-tokens/using-web-browsers.md) | ✅ | ✅ |

### Confidential client applications
Expand Down
Loading
Loading