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

Support CIAM custom URL domains #2029

Merged
merged 19 commits into from
Feb 27, 2024
Merged

Support CIAM custom URL domains #2029

merged 19 commits into from
Feb 27, 2024

Conversation

SammyO
Copy link
Contributor

@SammyO SammyO commented Jan 31, 2024

This PR adds support for CIAM custom URL domains (CUD), through addressing the following:

  1. Account.getAuthority() looks at the iss claim to determine whether an authority is of type CIAM.
    Since CIAM token issuer split, the issuer claim will contain ciamlogin.com.
    Note: this solution will work as long as the issuer of a CUD is not updated to reflect the custom domain. This will happen, in +- 1 year.

  2. Account.getAuthority() returns a CIAM authority with URL format https://<authorityUrl>/<tenantId>(e.g. https://custom.domain.com/<tenantId> or https://<tenantName>.ciamlogin.com/<tenantId>), rather than the previous https://<authorityUrl>/<tenantName>.onmicrosoft.com. The latter can't be used to compose OpenID connect URL for CUD variants.

Note: no E2E tests can be built for this feature yet, as the Labs environment is not set up. This is an ongoing effort (by Sammy and Ryan), see: https://identitydivision.visualstudio.com/Engineering/_dashboards/dashboard/4398d9a6-a49b-4a4a-a9b8-58ca2d24c6ab

MSAL common PR: AzureAD/microsoft-authentication-library-common-for-android#2314

@github-actions github-actions bot added the msal label Jan 31, 2024
@SammyO SammyO requested a review from iambmelt February 12, 2024 16:01
@SammyO SammyO marked this pull request as ready for review February 21, 2024 15:27
@SammyO SammyO requested a review from a team as a code owner February 21, 2024 15:27
// be a custom-URL-domain variant, which won't contain ciamlogin.com.
// Note: this will work as long as the issuer for CUD doesn't change, which it will
// in the future. See https://identitydivision.visualstudio.com/Engineering/_workitems/edit/2832277
if (iss.contains(CIAMAuthority.CIAM_LOGIN_URL_SEGMENT) && !StringUtil.isEmpty(getEnvironment())
Copy link
Contributor

Choose a reason for hiding this comment

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

Comment is a little confusing, so we know the issuer will change eventually? Linked Item has no description

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's highly likely that the issuer will change, yes. But the full scope and business requirements of that effort are unknown (as well as timeline), so it doesn't make sense to optimise for that now.
Indeed the ADO ticket has no description; it's been difficult to get clarity on this from the owning PM and EM. They're working on other more high priority stuff.

Let me know if there is a better way to deal with this.

SammyO added a commit to AzureAD/microsoft-authentication-library-common-for-android that referenced this pull request Feb 27, 2024
This PR adds support for CIAM custom URL domains (CUD), through
addressing the following:
1. A new way of composing authority URL, with format
`https://<tenantName>.ciamlogin.com/<tenantId>` or
`https://custom.domain.com/<tenantId>` to allow for OIDC lookup.
2. Token endpoint is taken from OIDC document, if available.
(authorization endpoint was already taken from OIDC document)

MSAL PR:
AzureAD/microsoft-authentication-library-for-android#2029
@SammyO SammyO merged commit 7d48e03 into dev Feb 27, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants