-
-
Notifications
You must be signed in to change notification settings - Fork 528
Swagger UI: X-XSRF-TOKEN is sent to OAuth2 token url #1036
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
|
@bnasslahsen what I meant is that the The CSRF support is meant for the application, not for the OAuth2 provider. My endpoints (using Spring Security) still expects |
If Keycloak doesn't respect any CSRF token, why do you add |
Because my application endpoints needs the CSRF token. Keycloak is only used to authenticate/authorize. |
Who generates the CSRF token ? |
The application. I don't think there is much value for an OAuth2 provider to have CSRF protection (but may have to test if Spring Security OAuth2 Server in a project with CSRF protection enabled expects a CSRF token in the OAuth2 token url). |
This doesn't seem to be an issue in springdoc-openapi. You can check springdoc-openapi to dig further. If you really feel you are facing an issue, make sure to analyse root cause. |
As you said, it might be between Swagger UI and Keycloak projects. I am locking this conversation, as we do not provide support for third party products configuration... |
Describe the bug
When configuring OpenAPI with OAuth2 security scheme and springdoc-openapi-ui with
springdoc.csrf.enabled=true
, Swagger UI will includeX-XSRF-TOKEN
in the request to the OAuth2 token url.Certain OAuth2 providers (in my case, Keycloak) with CORS protection may cause the browser to block the request due to the presence of
X-XSRF-TOKEN
, since it is not typically in theAccess-Control-Allow-Headers
list.To Reproduce
Steps to reproduce the behavior:
Expected behavior
Swagger UI should not include
X-XSRF-TOKEN
for OAuth2 token url requests.Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: