Add BrowserSsoFragment for E2E testing of Browser SSO, Fixes AB#3501428#2470
Merged
Add BrowserSsoFragment for E2E testing of Browser SSO, Fixes AB#3501428#2470
Conversation
- 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.
|
❌ Work item link check failed. Description does not contain AB#{ID}. Click here to Learn more. |
Contributor
There was a problem hiding this comment.
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 |
mohitc1
reviewed
Mar 15, 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 { |
Contributor
melissaahn
approved these changes
Mar 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
BrowserSsoFragmentclass that implements a UI for testing the Browser SSO flow, simulating a browser callingAccountManager.getAuthTokenwith 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.fragment_browser_sso.xmlto define the UI for the above fragment, including input fields, status, result area, and action buttons.2. Browser SSO WebView E2E Test:
fragment_browser_sso_webview.xmlto 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:
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.MainActivity.javato handle navigation to the new fragments when the corresponding menu items are selected.4. Submodule Update:
commonsubmodule reference to the latest commit, ensuring dependencies are up to date.