Skip to content

[Feature Request] Id.Web supports CIAM custom user domains #2690

@jennyf19

Description

@jennyf19

API experience

Add support for CIAM CUD authorities. See https://microsoft-my.sharepoint-df.com/:w:/p/jmprieur/EbtMcuWkuyRKnWTR8Fg9EAsBMn22Sy5Kni6YWOxTfYWjtg?e=GGad0r for spec

"AzureAd": {
    "ClientId": "12345-cdd4-46d4-9e68-db03240b4baa",      
    "Authority": "https://cats.ciamextensibility.com/111111-43bb-4ff9-89af-30ed8fe31c6d/v2.0"
},

Technical details

In MergedOptions:

  • Add a new boolean property named PreserveAuthority
  • in MergedOptions.ParseAuthorityIfNecessary, only set the mergedOptions.TenantId if mergedOptions.PreserveAuthority is false (as MSAL.NET does not want a tenantId when .WithOidcAuthority is used)

In AuthorityHelper.BuildCiamAuthorityIfNeeded, have a new out bool parameter preserveAuthority, which will be set to false if the authority is a CiamLogin.com authority and otherwise to true

In MicrosoftIdentityWebApiAuthenticationBuilderExtensions.cs and WebAppExtensions\MicrosoftIdentityWebAppAuthenticationBuilderExtensions.cs, after calling AuthorityHelper.BuildCiamAuthorityIfNeeded, set mergedOptions.PreserveAuthority based on the value of the out parameter.

In TokenAcquisition.BuildConfidentialClientApplicationAsync()

  • if mergedOptions.PreserveAuthority is true, set the authority to mergedOptions.Authority and call builder.WithOidcAuthority(authority),
    otherwise do as today (WithAuthority, and WithB2CAuthority)

Need to MSAL 4.60.0-preview to get builder.WithOidcAuthority(authority)

Testing resources

MSAL 4.60.0-preview and a CIAM CUD test tenant can be found at https://microsofteur-my.sharepoint.com/:f:/g/personal/bogavril_microsoft_com/EoEwmcgN3oJAplznhkE-OosBAQc4xl7I2sNVC8TfDFR_JA?e=8M82R9

CIAM CUD is not currently available in the Lab.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions