Common: gate silent shared-FOCI refresh-token redemption on caller authorization (AB#3687466), Fixes AB#3687466#3188
Open
Prvnkmr337 wants to merge 2 commits into
Open
Conversation
…thorization (AB#3687466)
Problem
-------
BaseController.getAccountWithFRTIfAvailable redeems the device-wide shared
family-of-client-id (FOCI) refresh token for any silent request whose named
client id belongs to a token family, without checking whether the calling app
is authorized to share FOCI tokens. On the brokered silent path this lets an
unauthorized local app mint a token from another app's shared FOCI refresh
token by naming a first-party family client id.
Phased delivery
---------------
AB#3687466 is delivered in phases, each as its own independently reviewable
and independently flighted PR:
- Phase 1: re-pin the silent bound-service caller on acquireTokenSilently.
- Phase 2: gate device-wide FOCI account enumeration on getAccounts.
- Phase 3 (this PR): gate silent shared-FOCI token redemption (broker-side
backstop).
- Phase 4: staged flight rollout (observe -> enforce).
Cross-repo changes merge common-first, then broker; this Common change is the
base dependency for the corresponding broker PR.
Solution
--------
Carry the caller's FOCI authorization on the silent command parameters and
gate the shared-FOCI redemption on it, while leaving the caller's own
UID-partitioned cache path untouched:
- Add SilentTokenCommandParameters.callerAuthorizedForFoci, a @Builder.Default
boolean defaulting to true. Default-true keeps non-brokered silent flows
(e.g. LocalMSALController, which owns its tokens and has no cross-app
"authorized to share" concept) and every existing caller unaffected; no
interface change.
- In BaseController.getAccountWithFRTIfAvailable, before redeeming the shared
family refresh token, return null when callerAuthorizedForFoci is false. This
falls through to the caller's own UID-partitioned cache only (same as the
"no FRT found" path), so an unauthorized caller never has the device-wide
shared FOCI RT redeemed on its behalf.
The authorization decision itself is evaluated in the broker layer and set on
the parameters; this change is a pure, backward-compatible controller-layer
gate with no schema change.
Testing
-------
Unit tests (BaseControllerFociRedemptionGateTest):
- callerAuthorizedForFoci = false -> shared FoCI RT redemption skipped
(returns null, falls through to the caller's own cache);
- callerAuthorizedForFoci = true -> redemption proceeds (no regression for
legitimate family apps and non-brokered callers).
Work item: AB#3687466
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 0436fb4a-df54-48de-a086-55aadb1eb200
|
✅ Work item link check complete. Description contains link AB#3687466 to an Azure Boards work item. |
|
❌ Work item link check failed. Description contains AB#3687466 but the Bot could not link it to an Azure Boards work item. Click here to learn more. |
|
Azure Pipelines: Some pipeline(s) encountered errors during trigger evaluation. |
…FoCI redemption gate (AB#3687466) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 0436fb4a-df54-48de-a086-55aadb1eb200
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.
Problem
BaseController.getAccountWithFRTIfAvailable redeems the device-wide shared family-of-client-id (FOCI) refresh token for any silent request whose named client id belongs to a token family, without checking whether the calling app is authorized to share FOCI tokens. On the brokered silent path this lets an unauthorized local app mint a token from another app's shared FOCI refresh token by naming a first-party family client id.
Phased delivery
AB#3687466 is delivered in phases, each as its own independently reviewable and independently flighted PR:
Solution
Carry the caller's FOCI authorization on the silent command parameters and gate the shared-FOCI redemption on it, while leaving the caller's own UID-partitioned cache path untouched:
The authorization decision itself is evaluated in the broker layer and set on the parameters; this change is a pure, backward-compatible controller-layer gate with no schema change.
Testing
Unit tests (BaseControllerFociRedemptionGateTest):
Work item: AB#3687466
Copilot-Session: 0436fb4a-df54-48de-a086-55aadb1eb200