Skip to content

Add net8.0-maccatalyst TFM to Microsoft.Identity.Client#5863

Draft
mattleibow wants to merge 1 commit intoAzureAD:mainfrom
mattleibow:add-maccatalyst-tfm
Draft

Add net8.0-maccatalyst TFM to Microsoft.Identity.Client#5863
mattleibow wants to merge 1 commit intoAzureAD:mainfrom
mattleibow:add-maccatalyst-tfm

Conversation

@mattleibow
Copy link
Copy Markdown

@mattleibow mattleibow commented Mar 16, 2026

Summary

Add Mac Catalyst target framework moniker (net8.0-maccatalyst) to the main MSAL.NET library so Mac Catalyst apps get full platform-specific functionality instead of falling back to the generic netstandard2.0 build.

Problem

The library currently targets net8.0-ios but not net8.0-maccatalyst. This means Mac Catalyst apps (including MAUI apps) consume the netstandard2.0 build, missing:

  • iOS Keychain-based token caching
  • System browser (ASWebAuthenticationSession) for interactive login
  • Embedded webview (WKWebView)
  • iOS Broker support
  • Platform-specific HTTP handling (NSUrlSessionHandler)
  • Intune/MDM enrollment support

Approach

Mac Catalyst uses UIKit (not AppKit), so all existing iOS platform code (Platforms/iOS/) is directly compatible. Rather than duplicating ~20 source files into a new Platforms/MacCatalyst/ directory, we reuse the iOS code by:

  1. Adding net8.0-maccatalyst as a new TFM
  2. Defining both MACCATALYST and iOS compilation symbols so existing #if iOS code paths activate
  3. Including Platforms/iOS/**/*.cs for the Mac Catalyst target (same as the iOS target)
  4. Using shared or conditions in PropertyGroups and ItemGroups to avoid duplication

Changes

Core Library (Microsoft.Identity.Client.csproj)

  • Added TargetFrameworkNetMacCatalyst property (net8.0-maccatalyst)
  • Added SupportedOSPlatformVersion 14.0 for Mac Catalyst
  • Shared JSON DefineConstants and source file includes with iOS via or conditions (no duplication)
  • Added to TargetFrameworks for Windows and OSX build platforms

Build Flags (platform_and_feature_flags.props)

  • Added MACCATALYST;iOS;SUPPORTS_BROKER constants for Mac Catalyst
  • Added Mac Catalyst to the MOBILE group alongside Android and iOS

Platform Proxy (iOSPlatformProxy.cs)

  • Differentiated product name telemetry: MSAL.MacCatalyst when on Mac Catalyst, MSAL.Xamarin.iOS on iOS

Public API (PublicApi/net8.0-maccatalyst/)

  • Added PublicAPI.Shipped.txt (copied from iOS — same API surface)
  • Added PublicAPI.Unshipped.txt

Build Validation

Successfully built all TFMs on macOS with 0 warnings, 0 errors:

  • net8.0-maccatalyst
  • net8.0-ios
  • netstandard2.0
  • net8.0

Copilot AI review requested due to automatic review settings March 16, 2026 14:50
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds net8.0-maccatalyst support to MSAL.NET so Mac Catalyst apps consume the platform-specific build (reusing existing iOS UIKit implementation) and updates build/sample infrastructure accordingly.

Changes:

  • Added net8.0-maccatalyst TFM wiring + compiler constants and iOS source inclusion for the new target.
  • Differentiated telemetry product name for Mac Catalyst.
  • Updated MAUI dev apps/CI to build against .NET 8 and install/build Mac Catalyst workloads.

Reviewed changes

Copilot reviewed 7 out of 9 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tests/devapps/MauiApps/MauiAppWithBroker/MauiAppWithBroker.csproj Bumps MAUI app TFMs to net8.0 variants.
tests/devapps/MauiApps/MauiAppBasic/MauiAppBasic.csproj Updates TFMs and iOS-specific IPA build conditions to net8.0.
tests/devapps/MauiApps/MauiAppB2C/MauiB2C.csproj Bumps MAUI app TFMs to net8.0 variants.
src/client/Microsoft.Identity.Client/PublicApi/net8.0-maccatalyst/PublicAPI.Shipped.txt Adds public API baseline for the new TFM.
src/client/Microsoft.Identity.Client/Platforms/iOS/iOSPlatformProxy.cs Uses a distinct product name for Mac Catalyst telemetry.
src/client/Microsoft.Identity.Client/Microsoft.Identity.Client.csproj Introduces net8.0-maccatalyst target + includes iOS platform sources for it.
build/template-build-on-mac.yaml Adds Mac Catalyst workload install and builds for MSAL + Mac MAUI app.
build/platform_and_feature_flags.props Adds MACCATALYST/iOS/MOBILE constants for the new TFM.

@mattleibow mattleibow force-pushed the add-maccatalyst-tfm branch from 65d1831 to 8c81002 Compare March 16, 2026 16:26
Add Mac Catalyst target framework moniker (net8.0-maccatalyst) to the
main MSAL.NET library. Mac Catalyst uses UIKit like iOS, so the existing
iOS platform code (keychain, broker, webviews, HTTP client) is reused
directly without duplication.

Changes:
- Add TargetFrameworkNetMacCatalyst property and include in multi-target builds
- Define MACCATALYST and iOS compilation symbols for Mac Catalyst
- Add SupportedOSPlatformVersion 14.0 for Mac Catalyst
- Reuse Platforms/iOS source files for Mac Catalyst target
- Add JSON build infrastructure DefineConstants (same as iOS)
- Create PublicApi/net8.0-maccatalyst tracking files (copied from iOS)
- Differentiate product name telemetry (MSAL.MacCatalyst vs MSAL.Xamarin.iOS)
- Update CI mac build template with maccatalyst workload and build steps

This enables Mac Catalyst apps to get full platform-specific MSAL
functionality (keychain token caching, ASWebAuthenticationSession,
broker support, NSUrlSessionHandler) instead of falling back to
the generic netstandard2.0 build.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings March 16, 2026 16:42
@mattleibow mattleibow force-pushed the add-maccatalyst-tfm branch from 8c81002 to ff9662b Compare March 16, 2026 16:42
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a net8.0-maccatalyst target to Microsoft.Identity.Client so Mac Catalyst apps can consume the iOS platform implementation (Keychain cache, ASWebAuthenticationSession / WKWebView, broker hooks, etc.) instead of falling back to the netstandard2.0 build.

Changes:

  • Adds net8.0-maccatalyst TFM to Microsoft.Identity.Client.csproj, reusing Platforms/iOS/**/*.cs for compilation.
  • Introduces MACCATALYST + iOS compilation symbols (and MOBILE) for the Mac Catalyst TFM via platform_and_feature_flags.props.
  • Adds Mac Catalyst public API tracking files and updates iOS telemetry product name to distinguish Mac Catalyst vs iOS.

Reviewed changes

Copilot reviewed 3 out of 5 changed files in this pull request and generated 1 comment.

File Description
src/client/Microsoft.Identity.Client/Microsoft.Identity.Client.csproj Adds Mac Catalyst TFM, sets SupportedOSPlatformVersion, reuses iOS sources for Mac Catalyst, wires PublicAPI files for the new TFM.
build/platform_and_feature_flags.props Defines MACCATALYST;iOS;SUPPORTS_BROKER and MOBILE constants for the new TFM.
src/client/Microsoft.Identity.Client/Platforms/iOS/iOSPlatformProxy.cs Adjusts telemetry product name when compiling for Mac Catalyst.
src/client/Microsoft.Identity.Client/PublicApi/net8.0-maccatalyst/PublicAPI.Shipped.txt Adds the shipped public API baseline for the new net8.0-maccatalyst target.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a net8.0-maccatalyst target to the main Microsoft.Identity.Client library so Mac Catalyst apps consume the Apple-platform build (reusing the existing iOS platform implementation) instead of falling back to netstandard2.0.

Changes:

  • Added net8.0-maccatalyst TFM to Microsoft.Identity.Client.csproj, sharing iOS compile items and mobile OS platform constraints via combined MSBuild conditions.
  • Introduced Mac Catalyst compilation constants (MACCATALYST plus iOS) and included Mac Catalyst in the MOBILE constant group.
  • Added Mac Catalyst PublicAPI baseline files and differentiated iOS vs Mac Catalyst telemetry product name.

Reviewed changes

Copilot reviewed 3 out of 5 changed files in this pull request and generated no comments.

File Description
src/client/Microsoft.Identity.Client/Microsoft.Identity.Client.csproj Adds the Mac Catalyst TFM and reuses iOS sources/conditions for compilation and OS platform constraints.
build/platform_and_feature_flags.props Defines MACCATALYST (and iOS) constants for the new TFM and includes it in MOBILE.
src/client/Microsoft.Identity.Client/Platforms/iOS/iOSPlatformProxy.cs Adjusts product name telemetry to report MSAL.MacCatalyst when compiled for Mac Catalyst.
src/client/Microsoft.Identity.Client/PublicApi/net8.0-maccatalyst/PublicAPI.Shipped.txt Introduces the Mac Catalyst public API baseline (matching the iOS surface).

@dalexsoto
Copy link
Copy Markdown

Hello! 👋 @bgavrilMS any chance you or someone from the team to have a look at this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support MacCatalyst

3 participants