Repository navigation
Conversation
Remove the legacy caller-managed state exception. Reserve SDK-generated state for every callback path, as in #1726, and cover rejection for legacy, response-aware, and default callbacks. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Contributor
Author
|
Closing in favor of #1949, which backports #1700 and requires advertised S256 PKCE support by default without introducing the newer callback API into 1.x. RFC 9700 section 4.7.1 permits relying on PKCE for CSRF protection when authorization-server support has been established. The replacement also rejects the unverified no-metadata fallback by default, with an explicit AppContext escape hatch for trusted legacy deployments whose PKCE support is independently known. This is a narrower servicing approach for existing 1.x callbacks; state validation remains additional protection in 2.x. No changes are being made to main. |
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.
Summary
Backport #1726 (merge commit 9c635ff) to
release/1.x, keeping its OAuth state behavior aligned with main.statefor every OAuth authorization-code transaction, including legacy callbacks.stateinAdditionalAuthorizationParametersfor all callback paths; attempts to override it are rejected, as in Validate OAuth authorization state #1726.AuthorizationCallbackHandlerand the built-in handler. The legacy code-only delegate retains the same validation limitation as main.Required 1.x adaptations
release/1.xdoes not have theAuthorizationCallbackHandler,AuthorizationCallbackContext, orAuthorizationResultAPIs introduced by #1605, which #1726 depends on. This backport includes the callback plumbing needed to returnCodeandState; it does not bring over RFC 9207 issuer validation or unrelated #1605 changes. These prerequisites prevent applying #1726 alone as a literal clean cherry-pick, but the state generation, reservation, and validation behavior follows the original change.The existing 1.x
AuthorizationRedirectDelegateis not newly marked obsolete, avoiding an unrelated warning-as-error source break. As on main, it remains functional but returns only a code, so SDK response-state validation is skipped. There is no special exception for caller-supplied state.The built-in console flow now requires the full redirect URL, not just an authorization code, matching #1726. Code-only callbacks remain supported, but applications using
AdditionalAuthorizationParameters["state"]must remove that override, just as on main.Validation
dotnet build --no-restore --nologo --verbosity quietpassed with zero warnings/errors.