Edge TB: PoP support for WebApps (Edge Token Broker), Fixes AB#3501329#3006
Edge TB: PoP support for WebApps (Edge Token Broker), Fixes AB#3501329#3006melissaahn merged 9 commits intodevfrom
Conversation
Co-authored-by: melissaahn <97474059+melissaahn@users.noreply.github.com>
|
❌ Work item link check failed. Description does not contain AB#{ID}. Click here to Learn more. |
|
@copilot can you please update the PR description based on the changes I made? For example, parsePopAuthSchemeFromRequest() is not in this PR anymore. |
Updated the PR description to remove the |
|
✅ Work item link check complete. Description contains link AB#3501329 to an Azure Boards work item. |
There was a problem hiding this comment.
Pull request overview
Adds Common-library support for a new WebApps/Edge Token Broker Proof-of-Possession (PoP) flow by introducing a pre-generated req_cnf PoP authentication scheme and wiring it through token request creation, auth-scheme (de)serialization, and cache filtering.
Changes:
- Introduces
WebAppsPopAuthenticationSchemeInternal(PoP_Pregenerated) to represent pre-generatedreq_cnfPoP for WebApps/Edge TB. - Plumbs the new scheme through request (de)serialization (
AuthenticationSchemeTypeAdapter), PoP detection (AuthenticationSchemeFactory), and MSSTS token request creation (MicrosoftStsOAuth2Strategy). - Extends WebApps request DTO (
WebAppsGetTokenSubOperationRequest) and updates cache logic to recognize the new PoP scheme; updates changelog and affected tests.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| common4j/src/main/com/microsoft/identity/common/java/providers/microsoft/microsoftsts/MicrosoftStsOAuth2Strategy.java | Sets token_type=pop and req_cnf when using the new WebApps PoP scheme. |
| common4j/src/main/com/microsoft/identity/common/java/commands/webapps/WebAppsGetTokenSubOperationRequest.kt | Adds optional tokenType / reqCnf fields to the WebApps request contract. |
| common4j/src/main/com/microsoft/identity/common/java/cache/MicrosoftStsAccountCredentialAdapter.java | Stores WebApps PoP ATs as AccessToken_With_AuthScheme without a kid. |
| common4j/src/main/com/microsoft/identity/common/java/cache/AbstractAccountCredentialCache.java | Treats PoP_Pregenerated as a valid PoP scheme during AT filtering. |
| common4j/src/main/com/microsoft/identity/common/java/authscheme/WebAppsPopAuthenticationSchemeInternal.java | New internal auth scheme carrying pre-generated req_cnf. |
| common4j/src/main/com/microsoft/identity/common/java/authscheme/AuthenticationSchemeFactory.java | Classifies the new scheme as PoP for downstream logic. |
| common/src/test/java/com/microsoft/identity/common/internal/controllers/BrokerMsalControllerTest.java | Updates WebApps request construction to include the new optional fields. |
| common/src/main/java/com/microsoft/identity/common/internal/request/AuthenticationSchemeTypeAdapter.java | Adds serialize/deserialize support for PoP_Pregenerated. |
| changelog.txt | Adds vNext entry for “Edge TB: PoP support (#3006)”. |
...in/com/microsoft/identity/common/java/authscheme/WebAppsPopAuthenticationSchemeInternal.java
Show resolved
Hide resolved
...ain/java/com/microsoft/identity/common/internal/request/AuthenticationSchemeTypeAdapter.java
Show resolved
Hide resolved
...rosoft/identity/common/java/providers/microsoft/microsoftsts/MicrosoftStsOAuth2Strategy.java
Show resolved
Hide resolved
...ain/java/com/microsoft/identity/common/internal/request/AuthenticationSchemeTypeAdapter.java
Show resolved
Hide resolved
common4j/src/main/com/microsoft/identity/common/java/cache/AbstractAccountCredentialCache.java
Show resolved
Hide resolved
.../src/main/com/microsoft/identity/common/java/cache/MicrosoftStsAccountCredentialAdapter.java
Show resolved
Hide resolved
...rosoft/identity/common/java/providers/microsoft/microsoftsts/MicrosoftStsOAuth2Strategy.java
Show resolved
Hide resolved
...c/test/java/com/microsoft/identity/common/internal/controllers/BrokerMsalControllerTest.java
Show resolved
Hide resolved
p3dr0rv
left a comment
There was a problem hiding this comment.
left a few comments, do not feel obligated to do it, this can be improved down the road.
Adds common-side support for Proof of Possession (PoP) tokens in the Edge Token Broker WebApps flow. The new protocol introduces
tokenType("pop"/"bearer", case-insensitive) andreqCnf(request confirmation) fields that can arrive either as top-level fields on the request or insideextraParameters, with top-level taking priority.New:
WebAppsPopAuthenticationSchemeInternalTokenAuthenticationScheme, implementsITokenAuthenticationSchemeInternalreq_cnf(not device-key-derived likePopAuthenticationSchemeInternal)"PoP_Pregenerated";getAccessTokenForScheme()returns the raw AT (ESTS returns it already in PoP format)New fields on
WebAppsGetTokenSubOperationRequesttokenTypeandreqCnf— both optional; each resolved independently (top-level →extraParametersfallback)Updated existing infrastructure to handle the new scheme
AuthenticationSchemeTypeAdapter— added serialize/deserialize cases forWebAppsPopAuthenticationSchemeInternalAuthenticationSchemeFactory.isPopAuthenticationScheme()— returnstruefor the new schemeMicrosoftStsOAuth2Strategy—createTokenRequestForAuthCode()andcreateRefreshTokenRequest()settoken_type=popandreq_cnffrom the schemeAbstractAccountCredentialCache—SCHEME_POP_PREGENERATEDadded to the PoP AT-type matching checkMicrosoftStsAccountCredentialAdapter— usesAccessToken_With_AuthSchemecredential type (no kid since req_cnf is pre-generated)AB#3501329
🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.
🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.