Skip to content

Expose MSALResourceTenantIdKey for guest/MTO MAM (AB#3673092) - #3022

Draft
antonioalwan wants to merge 3 commits into
devfrom
antonio_alwan/mto_msal_resource_tenant_id
Draft

Expose MSALResourceTenantIdKey for guest/MTO MAM (AB#3673092)#3022
antonioalwan wants to merge 3 commits into
devfrom
antonio_alwan/mto_msal_resource_tenant_id

Conversation

@antonioalwan

@antonioalwan antonioalwan commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Work item

AB#3673092 — MSAL layer of the Guest/MTO cross-tenant MAM fix.

Summary

Exposes the resource tenant id from protection-policy-required broker errors to client apps (e.g. Teams) so they can enroll with the Intune MAM SDK against the correct resource tenant in guest / multi-tenant organization (MTO) scenarios.

Changes

  • MSALError.h/.m: new public MSALResourceTenantIdKey error userInfo constant.
  • MSALErrorConverter.m: map the broker MSIDResourceTenantIdKey onto MSALResourceTenantIdKey so it surfaces in the public NSError userInfo.
  • Unit test for the key mapping.

Testing

MSALErrorConverterTests pass (20 tests, 0 failures).

Dependencies

Requires the CommonCore change that defines MSIDResourceTenantIdKey and maps resource_tenant_id from broker responses:

Part of the broker-side fix:

  • Broker — AzureAD/azure-activedirectory-tokenbroker-for-objc antonio_alwan/mto_guest_mam_resource_tenant

…B#3673092)

Adds the public MSALResourceTenantIdKey constant and maps the broker
MSIDResourceTenantIdKey onto it in MSALErrorConverter so client apps can
read the resource tenant id from protection-policy-required errors and
enroll with the Intune MAM SDK against the correct tenant. Includes a
unit test for the key mapping.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 23, 2026 00:11
@antonioalwan
antonioalwan requested review from a team as code owners June 23, 2026 00:11

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 new public NSError.userInfo key to MSAL so client apps can retrieve the resource tenant ID from broker “protection policy required” errors, enabling correct Intune MAM enrollment in guest / multi-tenant organization (MTO) scenarios.

Changes:

  • Added new public constant MSALResourceTenantIdKey to MSALError.h/.m.
  • Mapped MSIDResourceTenantIdKeyMSALResourceTenantIdKey in MSALErrorConverter so the value surfaces on public MSAL errors.
  • Added a unit test covering the userInfo key mapping and updated the changelog entry.

Reviewed changes

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

Show a summary per file
File Description
MSAL/test/unit/MSALErrorConverterTests.m Adds a regression/unit test validating resource tenant ID key mapping and removal of the MSID key.
MSAL/src/public/MSALError.h Exposes the new public MSALResourceTenantIdKey constant with documentation for client usage.
MSAL/src/MSALErrorConverter.m Maps MSIDResourceTenantIdKey to the new public key during MSID→MSAL error conversion.
MSAL/src/MSALError.m Defines the new string constant backing MSALResourceTenantIdKey.
CHANGELOG.md Documents the new public error userInfo key in the 2.13.0 notes.

* dev:
  Update IdentityCore submodule for MSIDMobileOnboardingState (#3016)
Copilot AI review requested due to automatic review settings June 24, 2026 22:08

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

MSIDUserDisplayableIdkey: MSALDisplayableUserIdKey,
MSIDBrokerVersionKey: MSALBrokerVersionKey,
MSIDHomeAccountIdkey: MSALHomeAccountIdKey,
MSIDResourceTenantIdKey: MSALResourceTenantIdKey,
subError:nil
underlyingError:nil
correlationId:[NSUUID UUID]
userInfo:@{MSIDResourceTenantIdKey : resourceTenantId}
@antonioalwan
antonioalwan marked this pull request as draft June 24, 2026 22:15
Comment thread CHANGELOG.md
@@ -1,4 +1,5 @@
## [2.13.0]
* Expose `MSALResourceTenantIdKey` in error userInfo so client apps can enroll with the Intune MAM SDK against the correct resource tenant for guest / multi-tenant organization (MTO) scenarios.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This entry is under 2.13.0, but that version has already shipped and does not include this change. Please move it to the next unreleased version section.

@kaisong1990
kaisong1990 self-requested a review July 22, 2026 16:43
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.

3 participants