Skip to content

Use Broker Content Provider for number match, Fixes AB#3308440 #2699

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 11 commits into from
Jul 1, 2025

Conversation

siddhijain
Copy link
Contributor

@siddhijain siddhijain commented Jul 1, 2025

AB#3308440
This PR adds constants used by AADAuthenticator module for number match scenarios.

@Copilot Copilot AI review requested due to automatic review settings July 1, 2025 15:05
@siddhijain siddhijain requested a review from a team as a code owner July 1, 2025 15:05
Copy link

github-actions bot commented Jul 1, 2025

❌ 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 introduces a Content Provider for number match storage and updates related modules and tests accordingly.

  • Updated NumberMatchHelper to use a Content Provider instead of a static HashMap.
  • Modified tests and Auth UX interfaces to work with the new storage mechanism.
  • Added broker operation and constants for number match retrieval.

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
common/src/test/java/com/microsoft/identity/common/internal/numberMatch/NumberMatchHelperTest.kt Updated tests to validate the new Content Provider-based storage for number match data.
common/src/test/java/com/microsoft/identity/common/internal/broker/AuthUxJavaScriptInterfaceTest.kt Modified test setup to include context injection for the updated Auth UX JavaScript interface.
common/src/main/java/com/microsoft/identity/common/internal/ui/webview/AzureActiveDirectoryWebViewClient.java Updated to pass the application context when attaching the Auth UX JavaScript interface.
common/src/main/java/com/microsoft/identity/common/internal/numberMatch/NumberMatchHelper.kt Replaced static map usage with Content Provider interactions for storing and retrieving number match values.
common/src/main/java/com/microsoft/identity/common/internal/numberMatch/NumberMatchDbHelper.kt New SQLiteOpenHelper implementation to support the number match Content Provider.
common/src/main/java/com/microsoft/identity/common/internal/numberMatch/NumberMatchContentProvider.kt New Content Provider implementation managing number match data persistence.
common/src/main/java/com/microsoft/identity/common/internal/broker/ipc/BrokerOperationBundle.java Added new broker operation for retrieving number match information.
common/src/main/java/com/microsoft/identity/common/internal/broker/AuthUxJavaScriptInterface.kt Modified the constructor to require a context and updated the number match storage call accordingly.
common/src/main/java/com/microsoft/identity/common/adal/internal/AuthenticationConstants.java Added new constants for the number match result and API path.

Copy link

github-actions bot commented Jul 1, 2025

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

@github-actions github-actions bot changed the title Use Broker Content Provider for number match Use Broker Content Provider for number match, Fixes AB#3308440 Jul 1, 2025
@siddhijain siddhijain added the No-Changelog This Pull-Request has no associated changelog entry. label Jul 1, 2025
@@ -127,6 +130,9 @@ class AuthUxJavaScriptInterface {
}

val operation = parameters.operation
if (operation != null) {
Copy link
Contributor

Choose a reason for hiding this comment

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

In what cases would this be null?

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 will let @fadidurah answer since it is a part of his changes.

Copy link
Contributor

@fadidurah fadidurah Jul 1, 2025

Choose a reason for hiding this comment

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

As part of the AuthUx platform agnostic JS API discussion, operation is not a mandatory field at this time, future usages of this interface may not have this field, and may only rely on action_name and action_component

Copy link
Contributor

@fadidurah fadidurah left a comment

Choose a reason for hiding this comment

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

LGTM

@mohitc1
Copy link
Contributor

mohitc1 commented Jul 1, 2025

    fun clearNumberMatchMap() {

When is this called?


Refers to: common/src/main/java/com/microsoft/identity/common/internal/numberMatch/NumberMatchHelper.kt:75 in 4d1f92f. [](commit_id = 4d1f92f, deletion_comment = False)

@siddhijain siddhijain added the Skip-Consumers-Check Only include this if making a breaking change purposefully, and there is an MSAL/ADAL/Broker PR label Jul 1, 2025
Copy link
Contributor

@mohitc1 mohitc1 left a comment

Choose a reason for hiding this comment

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

:shipit:

@siddhijain siddhijain merged commit c9ce6fb into dev Jul 1, 2025
27 of 28 checks passed
siddhijain added a commit that referenced this pull request Jul 1, 2025
siddhijain added a commit that referenced this pull request Jul 1, 2025
[AB#3308440](https://identitydivision.visualstudio.com/fac9d424-53d2-45c0-91b5-ef6ba7a6bf26/_workitems/edit/3308440)
This PR adds constants used by AADAuthenticator module for number match
scenarios.

---------

Co-authored-by: fadidurah <[email protected]>
siddhijain added a commit that referenced this pull request Jul 1, 2025
[AB#3308440](https://identitydivision.visualstudio.com/fac9d424-53d2-45c0-91b5-ef6ba7a6bf26/_workitems/edit/3308440)
This PR adds constants used by AADAuthenticator module for number match
scenarios.

---------

Co-authored-by: fadidurah <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
No-Changelog This Pull-Request has no associated changelog entry. 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