feat(oauth): PKCE exemption for allowlisted confidential clients (Copilot Studio) - #884
Merged
Merged
Conversation
Power Platform connectors (Microsoft Copilot Studio) run a plain OAuth 2.0 authorization code flow with a client secret and cannot send PKCE, so the S256 requirement on /authorize locked them out. OAUTH_PKCE_EXEMPT_CLIENT_IDS names the clients that may omit the challenge; the exemption only applies while the registration is confidential (client_secret_basic/post with a stored secret), so the token endpoint still refuses the code without the secret. Unlisted clients, including every DCR client, are unchanged and never cause a database lookup.
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Power Platform connectors, which is what a Microsoft Copilot Studio certified MCP connector is, use a plain OAuth 2.0 authorization code flow with a client secret and cannot send PKCE. Our /authorize requires S256, so such a connector could never sign in.
OAUTH_PKCE_EXEMPT_CLIENT_IDS(comma-separated) lists clients that may omit the challenge.client_secret_basic/client_secret_postwith a stored secret. The token endpoint then refuses the code without the secret, and the code stays bound to the registered redirect URI.docker-compose.cloud.yml(default empty) and documented in.env.example.Tests: 9 new cases in
authorize-pkce.middleware.spec.ts;src/auth+src/mcp-server563/563 green.