handle app_link query parameter Intent Redirection, Fixes AB#3590136#3102
Conversation
|
❌ Work item link check failed. Description does not contain AB#{ID}. Click here to Learn more. |
|
@copilot update changelog with this pr id (3102) |
|
✅ Work item link check complete. Description contains link AB#3590136 to an Azure Boards work item. |
|
❌ Work item link check failed. Description contains AB#3590136 but the Bot could not link it to an Azure Boards work item. Click here to learn more. |
Agent-Logs-Url: https://github.com/AzureAD/microsoft-authentication-library-common-for-android/sessions/6ce19e27-5d80-4cc3-a775-6b67b229bdc6 Co-authored-by: rpdome <19558668+rpdome@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR hardens handling of app_link carried on broker-installation redirect URIs by introducing a strict allowlist validator and expanding test coverage for both safe and hostile app_link targets.
Changes:
- Add
BrokerInstallLinkValidatorto strictly allowlist eSTS-supported broker install links (Play Store + China fwlink) and reject everything else. - Update
RawAuthorizationResultto validateapp_linkbefore classifying the redirect asBROKER_INSTALLATION_TRIGGERED. - Add/extend unit tests covering additional allowlisted links and hostile
app_linkinputs.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| common4j/src/main/com/microsoft/identity/common/java/providers/RawAuthorizationResult.java | Enforces allowlist validation for app_link and rejects non-allowlisted redirects. |
| common4j/src/main/com/microsoft/identity/common/java/providers/BrokerInstallLinkValidator.kt | Implements strict allowlist validation logic for app_link URLs. |
| common4j/src/test/com/microsoft/identity/common/java/providers/RawAuthorizationResultTest.java | Adds tests for new allowlisted broker-install links and hostile app_link cases. |
| common4j/src/test/com/microsoft/identity/common/java/providers/Constants.java | Adds new redirect URI test constants for allowlisted and hostile app_link scenarios. |
| common4j/src/test/com/microsoft/identity/common/java/providers/BrokerInstallLinkValidatorTest.kt | Adds comprehensive positive/negative unit tests for the allowlist validator. |
Agent-Logs-Url: https://github.com/AzureAD/microsoft-authentication-library-common-for-android/sessions/661d7c1b-a1b8-4568-b694-4d3117aee265 Co-authored-by: rpdome <19558668+rpdome@users.noreply.github.com>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Agent-Logs-Url: https://github.com/AzureAD/microsoft-authentication-library-common-for-android/sessions/49c8165b-3274-40c7-8f95-d6443af2d739 Co-authored-by: rpdome <19558668+rpdome@users.noreply.github.com>
|
@copilot can you use the same library that common/common4j uses to handle url (instead of writing our own) |
…IBuilder Agent-Logs-Url: https://github.com/AzureAD/microsoft-authentication-library-common-for-android/sessions/13a906dc-73b5-4f22-bcfa-0f4590d7b9b3 Co-authored-by: rpdome <19558668+rpdome@users.noreply.github.com>
Done in commit |
|
@copilot resolve the merge conflicts in this pull request |
…lLinkValidator Agent-Logs-Url: https://github.com/AzureAD/microsoft-authentication-library-common-for-android/sessions/13ceb94d-f89c-41c5-bceb-26cefc278826 Co-authored-by: rpdome <19558668+rpdome@users.noreply.github.com>
Merge conflicts were already resolved in commit |
…rInstallLinkValidator Agent-Logs-Url: https://github.com/AzureAD/microsoft-authentication-library-common-for-android/sessions/06a6deb1-8715-4eca-b8ce-37327d9c84dc Co-authored-by: rpdome <19558668+rpdome@users.noreply.github.com>
AB#3590136