-
Notifications
You must be signed in to change notification settings - Fork 46
Fix a few small switch browser bugs #2710
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 failed. Description does not contain AB#{ID}. Click here to Learn more. |
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.
Pull Request Overview
This PR addresses several small bugs in the switch browser flow by updating URI construction, ensuring the Authorization header includes the Bearer prefix, and correcting URL handling in the web view client.
- Use
Uri.parseandbuildUponinstead of manual string splitting to construct switch browser URIs. - Prepend
"Bearer "to the authorization code when building resume headers. - Fix inconsistent URL variable usage in
processSwitchBrowserRequest.
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| common/src/main/java/com/microsoft/identity/common/internal/ui/webview/switchbrowser/SwitchBrowserUriHelper.kt | Replace manual URI building with Uri.parse(actionUri).buildUpon(). |
| common/src/main/java/com/microsoft/identity/common/internal/ui/webview/switchbrowser/SwitchBrowserProtocolCoordinator.kt | Add "Bearer " prefix to authorization header value. |
| common/src/main/java/com/microsoft/identity/common/internal/ui/webview/AzureActiveDirectoryWebViewClient.java | Use url instead of formattedURL in processSwitchBrowserRequest. |
| changelog.txt | Add patch entry for switch browser bug fixes. |
Comments suppressed due to low confidence (1)
common/src/main/java/com/microsoft/identity/common/internal/ui/webview/switchbrowser/SwitchBrowserProtocolCoordinator.kt:137
- Add or update a unit test to verify that the
Authorizationheader value correctly includes theBearerprefix when building the resume URI headers.
val authorizationHeaderValue = "Bearer $code"
...ava/com/microsoft/identity/common/internal/ui/webview/AzureActiveDirectoryWebViewClient.java
Show resolved
Hide resolved
...va/com/microsoft/identity/common/internal/ui/webview/switchbrowser/SwitchBrowserUriHelper.kt
Show resolved
Hide resolved
|
seems we need to update the unit test |
1f05987 to
a158dd5
Compare
Updated the UTs! |
This PR fixes the above mentioned issues.