Skip to content

Commit

Permalink
Updates related to removal of UWP, Xamarin, NET6-Win support in 4.61.0
Browse files Browse the repository at this point in the history
  • Loading branch information
pmaytak committed May 7, 2024
1 parent 8ebe70c commit 6872ca0
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 21 deletions.
3 changes: 3 additions & 0 deletions msal-dotnet-articles/acquiring-tokens/desktop-mobile/uwp.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ ms.custom: devx-track-csharp, aaddev, devx-track-dotnet

# Using MSAL.NET with UWP applications

> [!NOTE]
> MSAL.NET versions 4.61.0 and above do not provide support for UWP.
Developers of applications that use Universal Windows Platform (UWP) with MSAL.NET should consider the concepts this article presents.

>[!NOTE]
Expand Down
16 changes: 10 additions & 6 deletions msal-dotnet-articles/acquiring-tokens/desktop-mobile/wam.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ An authentication broker is an application that runs on a user’s machine that
- **Enhanced security.** Many security enhancements will be delivered with the broker, without needing to update the application logic.
- **Feature support.** With the help of the broker developers can access rich OS and service capabilities such as Windows Hello, conditional access policies, and FIDO keys without writing extra scaffolding code.
- **System integration.** Applications that use the broker plug-and-play with the built-in account picker, allowing the user to quickly pick an existing account instead of reentering the same credentials over and over.
- **Token Protection.** WAM ensures that the refresh tokens are device bound and [enables apps](../../advanced/proof-of-possession-tokens.md) to acquire device bound access tokens. See [Token Protection](/azure/active-directory/conditional-access/concept-token-protection)
- **Token Protection.** WAM ensures that the refresh tokens are device bound and [enables apps](../../advanced/proof-of-possession-tokens.md) to acquire device bound access tokens. See [Token Protection](/azure/active-directory/conditional-access/concept-token-protection).

## Enabling WAM

Expand All @@ -33,7 +33,7 @@ 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.
>If your application targets UWP or `net-windows` (version-dependent Target Framework Moniker for Windows), WAM is included in the MSAL.NET package (for versions 4.60.3 or below).
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.

Expand Down Expand Up @@ -167,10 +167,14 @@ To use the broker, developers will need to call <xref:Microsoft.Identity.Client.

| Framework | [Microsoft.Identity.Client](https://www.nuget.org/packages/Microsoft.Identity.Client/) | [Microsoft.Identity.Client.Broker](https://www.nuget.org/packages/Microsoft.Identity.Client.Broker/) | [Microsoft.Identity.Client.Desktop](https://www.nuget.org/packages/Microsoft.Identity.Client.Desktop/) |
|:--------------------------------|:--------------------------|:---------------------------------|:----------------------------------|
| net48 ||| ✅ (not recommended) |
| net6.0 ||||
| net6.0-windows ||||
| .NET MAUI ||||
| .NET 6+ | ⛔ No | ✅ Yes | ⛔ No |
| .NET 6+ Windows† | ⛔ No | ✅ Yes | ✅ Yes (not recommended) |
| .NET MAUI | ✅ Yes | ⛔ No | ⛔ No |
| .NET 4.6.2+ | ⛔ No | ✅ Yes | ✅ Yes (not recommended) |
| .NET Standard | ⛔ No | ✅ Yes | ✅ Yes (not recommended) |
| .NET Core | ⛔ No | ✅ Yes | ✅ Yes (not recommended) |

**** `Microsoft.Identity.Client` versions 4.61.0 and above no longer include `net6.0-windows7.0` binary. Existing desktop applications targeting `net6.0-windows` should reference `Microsoft.Identity.Client.Broker` when using interactive authentication with Windows Broker and call <xref:Microsoft.Identity.Client.Broker.BrokerExtension.WithBroker(Microsoft.Identity.Client.PublicClientApplicationBuilder,Microsoft.Identity.Client.BrokerOptions)>; or reference `Microsoft.Identity.Client.Desktop` when [authenticating with browser](https://aka.ms/msal-net-uses-web-browser) and call <xref:Microsoft.Identity.Client.Desktop.DesktopExtensions.WithWindowsEmbeddedBrowserSupport(Microsoft.Identity.Client.PublicClientApplicationBuilder)>.

## Troubleshooting

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ description: "How to use MSAL.NET on mobile platforms."
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).

>[!NOTE]
>The .NET team recommends [migrating existing Xamarin applications to MAUI](/dotnet/maui/migration/). New applications should always use MAUI.
>The .NET team recommends [migrating existing Xamarin applications to MAUI](/dotnet/maui/migration/). New applications should always use MAUI. MSAL.NET versions 4.61.0 and above do not provide support for Xamarin Android and Xamarin iOS.
## Using MSAL.NET with brokers on mobile devices

Expand Down
33 changes: 19 additions & 14 deletions msal-dotnet-articles/acquiring-tokens/using-web-browsers.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,25 +41,27 @@ Generally, it's recommended that you use the platform default, and this is typic

### Browser availability

| Framework | Embedded | System | Default |
| ------------- |-------------| -----| ----- |
| .NET 6.0+ Windows | Yes | Yes| Embedded |
| .NET 6.0+ | No†† | Yes| System |
| .NET 5.0 | No†† | Yes| System |
| .NET Classic | Yes | Yes| Embedded |
| .NET Core | No | Yes| System |
| .NET Standard | No††† | Yes| System |
| UWP | Yes | No | Embedded |
| Xamarin.Android | Yes | Yes | System |
| Xamarin.iOS | Yes | Yes | System |
| Xamarin.Mac| Yes | No | Embedded |

**** Requires `http://localhost` redirect URI.
| Framework | Embedded | System| Default |
|:--------------------------------|:-------------------------|:-----------------------|:----------------------|
| .NET 6+†† | ⛔ No |Yes | System |
| .NET 6+ Windows |No††|Yes | System |
| .NET MAUI | ✅ Yes |Yes | System |
| .NET 5+†† | ⛔ No |Yes | System |
| .NET 4.6.2+ | ✅ Yes |Yes | Embedded |
| .NET Standard |No††† |Yes | System |
| .NET Core | ⛔ No††† | ✅ Yes | System |
| UWP†††† |Yes | ⛔ No | Embedded |
| Xamarin.Android†††† |Yes |Yes | System |
| Xamarin.iOS†††† |Yes | ✅ Yes | System |

**** System browser requires `http://localhost` redirect URI.

**††** Target `net6.0-windows` or above to use the embedded browser.

**†††** Reference [Microsoft.Identity.Client.Desktop](https://www.nuget.org/packages/Microsoft.Identity.Client.Desktop) and call <xref:Microsoft.Identity.Client.Desktop.DesktopExtensions.WithWindowsDesktopFeatures%2A> to use the embedded browser.

**††††**MSAL.NET versions 4.61.0 and above do not provide support for UWP, Xamarin Android, and Xamarin iOS.

## System web browser

Using the system browser has the significant advantage of sharing the Single Sign-On (SSO) state with web applications and other applications without needing a broker (WAM, Company Portal, Authenticator, etc.).
Expand Down Expand Up @@ -138,6 +140,9 @@ var options = new SystemWebViewOptions()

## Web views on Xamarin.Android and Xamarin.iOS

> [!NOTE]
> MSAL.NET versions 4.61.0 and above do not provide support for Xamarin Android and Xamarin iOS.

Embedded web views can be enabled in Xamarin.Android and Xamarin.iOS apps. As a developer using MSAL.NET targeting Xamarin, you may choose to use either embedded web views or system browsers. This is your choice depending on the user experience and security concerns you want to target.

### Differences between embedded web view and system browser
Expand Down

0 comments on commit 6872ca0

Please sign in to comment.