-
Notifications
You must be signed in to change notification settings - Fork 46
Expose a JavaScript API in brokered Webviews to facilitate Improved Same Device NumberMatch , Fixes AB#3203956 #2617
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 complete. Description contains link AB#3203956 to an Azure Boards work item. |
1 similar comment
|
✅ Work item link check complete. Description contains link AB#3203956 to an Azure Boards work item. |
...in/java/com/microsoft/identity/common/internal/numberMatch/NumberMatchJavaScriptInterface.kt
Outdated
Show resolved
Hide resolved
...in/java/com/microsoft/identity/common/internal/numberMatch/NumberMatchJavaScriptInterface.kt
Outdated
Show resolved
Hide resolved
...in/java/com/microsoft/identity/common/internal/numberMatch/NumberMatchJavaScriptInterface.kt
Outdated
Show resolved
Hide resolved
...va/com/microsoft/identity/common/internal/providers/oauth2/WebViewAuthorizationFragment.java
Outdated
Show resolved
Hide resolved
...in/java/com/microsoft/identity/common/internal/numberMatch/NumberMatchJavaScriptInterface.kt
Outdated
Show resolved
Hide resolved
...in/java/com/microsoft/identity/common/internal/numberMatch/NumberMatchJavaScriptInterface.kt
Outdated
Show resolved
Hide resolved
...in/java/com/microsoft/identity/common/internal/numberMatch/NumberMatchJavaScriptInterface.kt
Show resolved
Hide resolved
...in/java/com/microsoft/identity/common/internal/numberMatch/NumberMatchJavaScriptInterface.kt
Show resolved
Hide resolved
common/src/main/java/com/microsoft/identity/common/internal/broker/AuthUxJavaScriptInterface.kt
Outdated
Show resolved
Hide resolved
...va/com/microsoft/identity/common/internal/providers/oauth2/WebViewAuthorizationFragment.java
Outdated
Show resolved
Hide resolved
...va/com/microsoft/identity/common/internal/providers/oauth2/WebViewAuthorizationFragment.java
Outdated
Show resolved
Hide resolved
...va/com/microsoft/identity/common/internal/providers/oauth2/WebViewAuthorizationFragment.java
Outdated
Show resolved
Hide resolved
common/src/main/java/com/microsoft/identity/common/internal/broker/AuthUxJsonPayloadObject.kt
Outdated
Show resolved
Hide resolved
common/src/main/java/com/microsoft/identity/common/internal/broker/AuthUxJsonPayloadObject.kt
Outdated
Show resolved
Hide resolved
common/src/main/java/com/microsoft/identity/common/internal/broker/AuthUxJsonPayloadObject.kt
Outdated
Show resolved
Hide resolved
common/src/main/java/com/microsoft/identity/common/internal/broker/AuthUxJsonPayloadObject.kt
Outdated
Show resolved
Hide resolved
| // Call the method | ||
| authUxJavaScriptInterface.postMessageToBroker("NotAJson") | ||
|
|
||
| // Should not get an exception |
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.
Can we also validate that message was actually posted?
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.
What can be done to validate this? Copilot seems to want to validate the log statement, but can't get it to work
...n/src/test/java/com/microsoft/identity/common/internal/broker/AuthUxJsonPayloadObjectTest.kt
Outdated
Show resolved
Hide resolved
...n/src/test/java/com/microsoft/identity/common/internal/broker/AuthUxJsonPayloadObjectTest.kt
Outdated
Show resolved
Hide resolved
common/src/main/java/com/microsoft/identity/common/adal/internal/AuthenticationConstants.java
Outdated
Show resolved
Hide resolved
common/src/main/java/com/microsoft/identity/common/internal/broker/AuthUxJavaScriptInterface.kt
Outdated
Show resolved
Hide resolved
…956, Closed AB#3203956 (#2653) Minor change was made to the json schema, updated our code to match. Also put JavaScript API behind a flight. New schema: { "correlationID": "$UUID" "action_name":"write_data", "action_component":"broker", "params": { "operation": "number_matching", "sessionID": "$sessionID", "code_match": "$number" } } Original numberMatch PR: #2617 [AB#3203956](https://identitydivision.visualstudio.com/fac9d424-53d2-45c0-91b5-ef6ba7a6bf26/_workitems/edit/3203956)
SPEC: https://microsoft-my.sharepoint-df.com/:w:/r/personal/siddhijain_microsoft_com/_layouts/15/Doc.aspx?sourcedoc=%7BD1D944D5-2047-40AB-B8F9-98506BF212A3%7D&file=Engineering%20design%20-%20Number%20matching%20on%20same%20device.docx&action=default&mobileredirect=true&share=IQHVRNnRRyCrQLj5mFBr8hKjAbj81fEnpO6X-99laqs2j_M&wdOrigin=TEAMS-MAGLEV.p2p_ns.rwc&wdExp=TEAMS-TREATMENT&wdhostclicktime=1743094076241&web=1
Word Doc: for JavaScript Api: https://microsoft-my.sharepoint-df.com/:w:/p/veenasoman/EY1AZIeT8X5KrXVz97Vx520B3Jj0fBLSPlklnoRvcmbh0Q?e=ZVVUrw&nav=eyJoIjoiMjEzMzE1Mzg5NSJ9
Structure has changed a bit for this. To facilitate future work, we will have a generalized JavaScript API that takes in a json string payload. This is used to parse out a function name, and data field, both of which are used to call a specific function in broker code. This same functionality will be used next month for CA Block improvment work (I don't have a spec to this one yet).
Expected method call in JavaScript is now something like this, we are working on finalizing json schema:
BrokerJS.postToBroker('{function: NUMBER_MATCH,data: {sessionID: id, numberMatch: number}}')I added some unit tests in the broker PR, but primary validation will be when ests exposes a test slice that calls the JavaScript API. Did some testing in our webview class to call javascript code, and was able to prompt the numberMatch method.
Broker PR: https://github.com/AzureAD/ad-accounts-for-android/pull/3073
AB#3203956