Skip to content

Conversation

@PeterRodenkirchTNG
Copy link

Describe the PR
Add Proof Key for Code Exchange Support configurable with the OAuthConfig struct.

Relation issue
#99

Additional context
OAuth2 clients that only support Authorization Code Flow with PKCE do not work with the current feature set of echo-swagger.
There is a flag for it in Swagger UI 3.24.0+: usePkceWithAuthorizationCodeGrant and these small changes fix the problem.

@seilersTNG
Copy link

Hello, can you please consider reviewing and merging this PR. I think it is an important security feature that should be part of this library. Thank you. Best, Steffen

@andre-easygo
Copy link

andre-easygo commented Jan 12, 2026

The regex in https://github.com/swaggo/echo-swagger/blob/master/swagger.go#L138
needs to be updated to: ^(.*/)([^?]*)?(\?.*)?$

This is because if query parameters are included in the redirectUri, with the current regex they will be matched as the filename and the oauth2-redirect.html file won't be found, since it will be something like oauth2-redirect.html?state=blahblah. Without this change we can't adequately perform the PKCE flow from Swagger UI.

Thank you
cc @PeterRodenkirchTNG @seilersTNG

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants