Skip to content

Add BrowserSsoFragment for E2E testing of Browser SSO, Fixes AB#3501428#2470

Merged
shahzaibj merged 6 commits intodevfrom
shahzaibj/browser-sso-part4-e2e
Mar 16, 2026
Merged

Add BrowserSsoFragment for E2E testing of Browser SSO, Fixes AB#3501428#2470
shahzaibj merged 6 commits intodevfrom
shahzaibj/browser-sso-part4-e2e

Conversation

@shahzaibj
Copy link
Copy Markdown
Contributor

@shahzaibj shahzaibj commented Feb 22, 2026

Fixes AB#3501428

This pull request adds end-to-end (E2E) test support for the Browser SSO (Single Sign-On) flow in the test app. It introduces new UI fragments and layouts that allow developers to simulate browser SSO scenarios and inspect the results directly within the app. The navigation menu is updated to provide easy access to these new test flows.

Key changes:

1. Browser SSO E2E Test Feature:

  • Added a new BrowserSsoFragment class that implements a UI for testing the Browser SSO flow, simulating a browser calling AccountManager.getAuthToken with a placeholder account. The fragment allows input of SSO URL and optional correlation ID, displays the result bundle, and provides a button to copy results to the clipboard.
  • Added a new layout file fragment_browser_sso.xml to define the UI for the above fragment, including input fields, status, result area, and action buttons.

2. Browser SSO WebView E2E Test:

  • Added a new layout file fragment_browser_sso_webview.xml to support a WebView-based E2E test for Browser SSO, including a URL bar, progress indicator, WebView, and a collapsible log panel for debugging.

3. Navigation and Menu Integration:

  • Updated the navigation drawer menu (activity_main_drawer.xml) to include entries for "Browser SSO" and "Browser SSO E2E", making the new test flows accessible from the app’s main menu.
  • Updated MainActivity.java to handle navigation to the new fragments when the corresponding menu items are selected.

4. Submodule Update:

  • Updated the common submodule reference to the latest commit, ensuring dependencies are up to date.

- BrowserSsoFragment: New fragment that exercises the full Browser SSO
  flow via AccountManager.getAuthToken() with accountType=com.microsoft.entra
  and authTokenType=sso_header. Displays discovered Entra accounts,
  lets the tester supply an SSO URL and correlation ID, and shows the
  full result bundle returned by the broker.
- fragment_browser_sso.xml: Layout with URL input, correlation ID input,
  action button, progress indicator, account list, and result display.
- activity_main_drawer.xml: Add 'Browser SSO' nav item.
- MainActivity: Wire up nav_browser_sso to BrowserSsoFragment.
@shahzaibj shahzaibj self-assigned this Feb 22, 2026
@shahzaibj shahzaibj requested a review from a team as a code owner February 22, 2026 20:15
Copilot AI review requested due to automatic review settings February 22, 2026 20:15
@github-actions
Copy link
Copy Markdown

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

Click here to Learn more.

Copy link
Copy Markdown
Contributor

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 adds a new Browser SSO testing fragment to the MSAL Android test app, enabling end-to-end testing of the Browser SSO flow. The implementation simulates a browser calling AccountManager.getAuthToken() with a hardcoded placeholder account to retrieve SSO headers from the broker for all signed-in accounts on the device.

Changes:

  • Added navigation menu entry and fragment implementation for Browser SSO testing
  • Implemented UI with SSO URL input, correlation ID field, and result display
  • Integrated AccountManager API call to test broker's SSO header retrieval functionality

Reviewed changes

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

File Description
testapps/testapp/src/main/res/menu/activity_main_drawer.xml Adds "Browser SSO" menu item to navigation drawer
testapps/testapp/src/main/res/layout/fragment_browser_sso.xml New layout file with input fields for SSO URL and correlation ID, plus result display area
testapps/testapp/src/main/java/com/microsoft/identity/client/testapp/MainActivity.java Adds navigation case for BrowserSsoFragment in menu item selection handler
testapps/testapp/src/main/java/com/microsoft/identity/client/testapp/BrowserSsoFragment.java New fragment implementing Browser SSO E2E test with AccountManager integration and result handling

@shahzaibj shahzaibj requested a review from a team as a code owner March 13, 2026 18:00
Copy link
Copy Markdown
Contributor

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

Copilot reviewed 6 out of 6 changed files in this pull request and generated no new comments.

@github-actions github-actions Bot changed the title Add BrowserSsoFragment for E2E testing of Browser SSO Add BrowserSsoFragment for E2E testing of Browser SSO, Fixes AB#3501428 Mar 13, 2026
* <p>The broker's debug allow-list must include this test app's package name
* ({@code com.msft.identity.client.sample.local}) for the request to succeed.
*/
public class BrowserSsoFragment extends Fragment {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

BrowserSsoFragment

nit: make new files all kotlin

Copy link
Copy Markdown
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:

@shahzaibj shahzaibj merged commit afe0a83 into dev Mar 16, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants