Skip to content

Conversation

@fadidurah
Copy link
Contributor

@fadidurah fadidurah commented Apr 2, 2025

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

@fadidurah fadidurah requested a review from a team as a code owner April 2, 2025 06:18
@github-actions
Copy link

github-actions bot commented Apr 2, 2025

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

1 similar comment
@github-actions
Copy link

github-actions bot commented Apr 2, 2025

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

@github-actions github-actions bot changed the title Expose a JavaScript API in brokered Webviews to facilitate Improved Same Device NumberMatch Expose a JavaScript API in brokered Webviews to facilitate Improved Same Device NumberMatch , Fixes AB#3203956 Apr 2, 2025
@fadidurah fadidurah requested a review from a team as a code owner April 15, 2025 22:45
// Call the method
authUxJavaScriptInterface.postMessageToBroker("NotAJson")

// Should not get an exception
Copy link
Contributor

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?

Copy link
Contributor Author

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

@fadidurah fadidurah merged commit c8acef3 into dev May 24, 2025
24 of 25 checks passed
fadidurah added a commit that referenced this pull request May 30, 2025
…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)
@fadidurah fadidurah deleted the fadi/numberMatch branch June 16, 2025 16:13
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.

4 participants