Skip to content

Implement a WebView handler to facilitate broker app installation via the Play Store, Fixes AB#3277229 #2643

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

Open
wants to merge 8 commits into
base: dev
Choose a base branch
from

Conversation

p3dr0rv
Copy link
Contributor

@p3dr0rv p3dr0rv commented May 15, 2025

AB#3277229

ON BYOD MFA, there is a flow where users are invited to install the broker app from the Play Store.
This flow is currently broken on WebView as we do not have a handler for this type of URLS.
This PR introduces a handler to facilitate the installation of the broker app via the Play Store
image

Copy link

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

Click here to Learn more.

@p3dr0rv p3dr0rv requested a review from Copilot May 16, 2025 00:03
Copy link

@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

Adds handling for broker app installation intents in the WebView client.

  • Detects intent:// URLs targeting known broker packages
  • Parses and launches intents to install or open the broker app
  • Introduces INTENT_PREFIX constant and updates changelog

Reviewed Changes

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

File Description
common/src/main/java/com/microsoft/identity/common/internal/ui/webview/AzureActiveDirectoryWebViewClient.java Added intent detection (isIntentRequestForBrokerApp) and processing (processIntentRequestForBrokerApp) methods
common/src/main/java/com/microsoft/identity/common/adal/internal/AuthenticationConstants.java Defined INTENT_PREFIX constant for intent URI matching
changelog.txt Documented the new minor feature
Comments suppressed due to low confidence (2)

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

  • Remove the unused PackageHelper import to clean up the code.
import com.microsoft.identity.common.internal.broker.PackageHelper;

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

  • The new intent-handling branch lacks unit tests. Add tests for matching and non-matching URIs, and for successful and failure paths in processIntentRequestForBrokerApp.
} else if (isIntentRequestForBrokerApp(formattedURL)) {

p3dr0rv and others added 4 commits May 16, 2025 12:00
…al/AuthenticationConstants.java

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…/webview/AzureActiveDirectoryWebViewClient.java

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@p3dr0rv p3dr0rv requested a review from Copilot May 16, 2025 19:45
Copy link

@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 a WebView handler to facilitate broker app installation via the Play Store. Key changes include:

  • Adding new error string constants for URI syntax errors, missing activities, and unexpected errors.
  • Introducing methods to detect and process intent requests for broker app installation in the WebView client.
  • Updating authentication constants to include an intent URI prefix.

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/exception/ErrorStrings.java Added error strings for URI syntax errors, activity not found, and unexpected errors.
common/src/main/java/com/microsoft/identity/common/internal/ui/webview/AzureActiveDirectoryWebViewClient.java Added intent request detection and processing logic for broker app installation.
common/src/main/java/com/microsoft/identity/common/adal/internal/AuthenticationConstants.java Added a new constant (INTENT_PREFIX) to support intent URI handling.
changelog.txt Updated with a minor changelog entry for the new feature.

Copy link

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

@github-actions github-actions bot changed the title Implement a WebView handler to facilitate broker app installation via the Play Store Implement a WebView handler to facilitate broker app installation via the Play Store, Fixes AB#3277229 May 16, 2025
@p3dr0rv p3dr0rv marked this pull request as ready for review May 16, 2025 20:13
@p3dr0rv p3dr0rv requested review from a team as code owners May 16, 2025 20:13
@shahzaibj
Copy link
Contributor

I'm a little confused. Didn't we already have handling for PlayStore redirects? I see inside AzureActiveDirectoryWebViewClient we have handling for playstore URL.

Also before the LTW era (no broker preinstalled), we used to be able to ask for deviceid and this would cause eSTS to ask user to install AuthApp (broker) and IIRC, this would take us to playstore and work fine.

Is the issue here that the scheme has changed from market to intent? So essentially this was a regression from server?

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