Skip to content
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

Keycloak Auth endpoint sends a 405 Method Not Allowed on Preflight Request #519

Open
1 of 2 tasks
ItsJuzoSuzuya opened this issue Nov 19, 2024 · 0 comments
Open
1 of 2 tasks

Comments

@ItsJuzoSuzuya
Copy link

Before reporting an issue

  • I have read and understood the above terms for submitting issues, and I understand that my issue may be closed without action if I do not follow them.

Area

adapter/javascript

Describe the bug

Keycloak returns a 405 Method Not Allowed on an OPTION preflight request after an express server tries to forward an unauthenticated user from the browser to the keycloak login page.

Version

26.0.5

Regression

  • The issue is a regression

Expected behavior

My React frontend sends a request to a secured endpoint in my express proxy. The proxy returns a 302 Found to the frontend. The frontend sends a preflight request that returns the Access-Control-Allow-Origin header and forwards my frontend to the login page.

Actual behavior

When the preflight request happens the request returns a 405 Method Not Allowed error and lables it as a CORS Missing Allow Origin, since the Access-Control-Allow-Origin header is not returned.

How to Reproduce?

Send a Get request from a react frontend to a keycloak-connect protected express endpoint.

Anything else?

No response

@jonkoops jonkoops transferred this issue from keycloak/keycloak Nov 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant