Add code_challenge_method to return type and support configurable PKCE methods#41
Conversation
Co-authored-by: crouchcd <19394466+crouchcd@users.noreply.github.com>
Co-authored-by: crouchcd <19394466+crouchcd@users.noreply.github.com>
| method: PKCEChallengeMethod = "S256" | ||
| ) { | ||
| if (method === "plain") { | ||
| return code_verifier; |
There was a problem hiding this comment.
@copilot code_verifier should still be base64-url encoded even if we are using a plain method
There was a problem hiding this comment.
Fixed in 2e0dc90. The code_verifier now uses only base64url-safe characters (A-Za-z0-9-_) instead of the previous set that included '.' and '~'. For the plain method, the challenge still equals the verifier per the PKCE spec, but both are now guaranteed to be base64url-compatible.
Co-authored-by: crouchcd <19394466+crouchcd@users.noreply.github.com>
…eatures-from-issue-40' into copilot/implement-features-from-issue-40
This reverts commit 2e0dc90.
Updated the PR description to reflect all recent changes including RFC 7636 compliance, improved error handling, and the complete implementation 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:
|
Implementation for Issue #40: PKCE Challenge Method Support ✅
This PR adds support for exposing the PKCE challenge method and allowing consumers to choose between different methods.
Changes Made
1. Added
code_challenge_methodto return typeThe
pkceChallenge()function now returns an object with acode_challenge_methodfield:2. Configurable Challenge Methods
All functions now accept an optional
methodparameter:3. RFC 7636 Compliant Implementation
The implementation now follows RFC 7636 Appendix A guidance:
4. Enhanced Error Handling
Errorobjects instead of string literals5. Type Safety
PKCEChallengeMethodtype for TypeScript consumersAPI Changes
Testing
Backward Compatibility
Implementation Details
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.