Skip to content

Flighting webcp in webview, Fixes AB#3307594 #2686

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

Merged
merged 27 commits into from
Jun 30, 2025
Merged

Conversation

somalaya
Copy link
Contributor

@somalaya somalaya commented Jun 25, 2025

  1. Flighting for webcp in webview is divided into 3 parts
  • Not flighting this feature for brokerless scenarios. The flight will be off by default for brokerless scenarios as Intune team is ok to only target brokered flows since this is the majority case.
  • Now coming to brokered scenarios, we have below
    •  Simple flighting with ENABLE_WEB_CP_IN_WEBVIEW which will be used for rollout starting October.
      
    •  Using tenantId list TENANT_LIST_TO_ENABLE_WEB_CP_IN_WEBVIEW. This flight will be used first in the months of August and September. This will be 100% rolled out in the beginning itself. This flight will hold upto 25 tenantIds. See below snapshot 
      

image

  1. I intentionally added a global variable to keep the flight value instead of calling isWebCpInWebviewFeatureEnabled method because I do not want to invoke code to get tenantId multiple times. Also, this value must remain the same once the webcp url is loaded in webview.

  2. Apart from this, I have added a special method to handle google enrollment URL which has extra intent flags needed for this scenario.

Related PR : https://github.com/AzureAD/ad-accounts-for-android/pull/3140

Fixes AB#3307594

@Copilot Copilot AI review requested due to automatic review settings June 25, 2025 20:49
@somalaya somalaya requested a review from a team as a code owner June 25, 2025 20:49
Copy link

❌ Work item link check failed. Description does not contain AB#{ID}.

Click here to Learn more.

Copy link
Contributor

@Copilot 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 implements flighting support for the WebCP feature in WebView for brokered flows by introducing new flight flags and tenant information interfaces while also refining URL handling for special enrollment scenarios.

  • Introduces ITenantInfoProvider and its broker implementation to obtain tenant IDs.
  • Extends flight configuration with TENANT_LIST_TO_ENABLE_WEB_CP_IN_WEBVIEW for targeted rollout.
  • Updates AzureActiveDirectoryWebViewClient to conditionally process WebCP URLs and use a dedicated Google enrollment URL handler.

Reviewed Changes

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

File Description
common4j/src/main/com/microsoft/identity/common/java/interfaces/ITenantInfoProvider.kt Adds a new interface for retrieving tenant IDs.
common4j/src/main/com/microsoft/identity/common/java/flighting/CommonFlight.java Adds a new flight flag to manage tenant-based feature rollout.
common4j/src/main/com/microsoft/identity/common/java/broker/CommonTenantInfoProvider.kt Provides a broker-specific implementation for tenant info retrieval.
common/src/main/java/com/microsoft/identity/common/internal/ui/webview/AzureActiveDirectoryWebViewClient.java Updates URL handling logic with feature flag checks and a dedicated Google enrollment URL method.
Comments suppressed due to low confidence (1)

common/src/main/java/com/microsoft/identity/common/internal/ui/webview/AzureActiveDirectoryWebViewClient.java:614

  • [nitpick] Consider aligning the naming convention between the method isWebCpInWebviewFeatureEnabled and the field mIsWebCpInWebViewFeatureEnabled (e.g., using consistent casing for 'WebView') for clarity.
    private boolean isWebCpInWebviewFeatureEnabled(@NonNull final String originalUrl) {

@somalaya somalaya changed the title Flighting webcp in webview Flighting webcp in webview, Fixes AB#3135912 Jun 25, 2025
Copy link

✅ Work item link check complete. Description contains link AB#3135912 to an Azure Boards work item.

@somalaya somalaya force-pushed the somalaya/flightWebCpFeature branch from f39525c to c6b42e0 Compare June 25, 2025 23:17
@somalaya somalaya changed the title Flighting webcp in webview, Fixes AB#3135912 Flighting webcp in webview, Fixes AB#3307594 Jun 26, 2025
Copy link

❌ Work item link check failed. Description contains AB#3307594 but the Bot could not link it to an Azure Boards work item.

Click here to learn more.

Copy link

✅ Work item link check complete. Description contains link AB#3307594 to an Azure Boards work item.

@somalaya somalaya requested a review from a team as a code owner June 26, 2025 19:52
@somalaya somalaya force-pushed the somalaya/flightWebCpFeature branch from 4c6af40 to a73004d Compare June 26, 2025 19:55
}

private String getHomeTenantIdFromUrl(@NonNull final String url) {
final String username = StringExtensions.getUrlParameters(url).get(AuthenticationConstants.AAD.LOGIN_HINT);
Copy link
Contributor

Choose a reason for hiding this comment

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

final String username = StringExtensions.getUrlParameters(url).get(AuthenticationConstants.AAD.LOGIN_HINT);

Is it guaranteed that, login hint will always be there in this URL?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am seeing this code in eSTS url has login hint param which always adds the device ca param (ismdmurl=1) and upn.

@somalaya somalaya force-pushed the somalaya/flightWebCpFeature branch from 6a9f4ba to 31cb0b0 Compare June 30, 2025 15:33
@somalaya somalaya added the Skip-Consumers-Check Only include this if making a breaking change purposefully, and there is an MSAL/ADAL/Broker PR label Jun 30, 2025
@somalaya somalaya force-pushed the somalaya/flightWebCpFeature branch from 1a57f90 to bfffc9f Compare June 30, 2025 17:50
@somalaya somalaya force-pushed the somalaya/flightWebCpFeature branch from a6a2186 to f9055dd Compare June 30, 2025 18:35
@somalaya somalaya merged commit 8691851 into dev Jun 30, 2025
19 of 20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Skip-Consumers-Check Only include this if making a breaking change purposefully, and there is an MSAL/ADAL/Broker PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants