-
Notifications
You must be signed in to change notification settings - Fork 38
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
Conversation
❌ Work item link check failed. Description does not contain AB#{ID}. Click here to Learn more. |
There was a problem hiding this 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) {
...ava/com/microsoft/identity/common/internal/ui/webview/AzureActiveDirectoryWebViewClient.java
Show resolved
Hide resolved
...ava/com/microsoft/identity/common/internal/ui/webview/AzureActiveDirectoryWebViewClient.java
Outdated
Show resolved
Hide resolved
✅ Work item link check complete. Description contains link AB#3135912 to an Azure Boards work item. |
f39525c
to
c6b42e0
Compare
❌ 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. |
✅ Work item link check complete. Description contains link AB#3307594 to an Azure Boards work item. |
common4j/src/main/com/microsoft/identity/common/java/interfaces/ITenantInfoProvider.kt
Show resolved
Hide resolved
4c6af40
to
a73004d
Compare
...ava/com/microsoft/identity/common/internal/ui/webview/AzureActiveDirectoryWebViewClient.java
Outdated
Show resolved
Hide resolved
...ava/com/microsoft/identity/common/internal/ui/webview/AzureActiveDirectoryWebViewClient.java
Show resolved
Hide resolved
...ava/com/microsoft/identity/common/internal/ui/webview/AzureActiveDirectoryWebViewClient.java
Outdated
Show resolved
Hide resolved
common/src/test/java/com/microsoft/identity/common/internal/mocks/MockCommonFlightsManager.java
Show resolved
Hide resolved
common4j/src/main/com/microsoft/identity/common/java/broker/CommonTenantInfoProvider.kt
Outdated
Show resolved
Hide resolved
common4j/src/main/com/microsoft/identity/common/java/flighting/CommonFlight.java
Show resolved
Hide resolved
...ava/com/microsoft/identity/common/internal/ui/webview/AzureActiveDirectoryWebViewClient.java
Outdated
Show resolved
Hide resolved
...ava/com/microsoft/identity/common/internal/ui/webview/AzureActiveDirectoryWebViewClient.java
Show resolved
Hide resolved
...ava/com/microsoft/identity/common/internal/ui/webview/AzureActiveDirectoryWebViewClient.java
Show resolved
Hide resolved
common4j/src/main/com/microsoft/identity/common/java/broker/CommonTenantInfoProvider.kt
Outdated
Show resolved
Hide resolved
} | ||
|
||
private String getHomeTenantIdFromUrl(@NonNull final String url) { | ||
final String username = StringExtensions.getUrlParameters(url).get(AuthenticationConstants.AAD.LOGIN_HINT); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
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.
6a9f4ba
to
31cb0b0
Compare
1a57f90
to
bfffc9f
Compare
a6a2186
to
f9055dd
Compare
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.
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