-
Notifications
You must be signed in to change notification settings - Fork 92
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
Handling http OPTIONS calls #1
Comments
Your problem must be fixed on the client-side. I have it perfectly working with cross site requests. I dont know why a request with OPTIONS made in your case. Have you added Cross site Filter (I added a filter to make it work, check http://spring.io/guides/gs/rest-service-cors/) ? |
Hey all! I was at the same trouble. But I've solved the problem adding the following line at attemptAuthentication at StatelessLoginFilter:
I think it's ok because we don't need to authenticate options requests. It doens't retrieves any business data and so on. If there's a better solution, please let me know. |
That's actually what I've done too
|
Hello,
When dealing with Cross-site requests, a first OPTIONS request is sent to the server before the real request.
Namely, when trying to authenticate through a POST to /api/login, first an OPTIONS request is sent, gets intercepted by the StatelessAuthenticationFilter, which then crashes because the request body is empty (no parameters are passed).
I've tried adding an exception to the config:
but it doesn't change anything - the filter is still called (I've also tried defining the exception before the POST to /api/login)
Doing a GET directly to /api/login results in the same thing (even when changing the order of the configuration), ie the following test causes a jackson exception in StatelessLoginFilter:
Do you know how I should proceed here?
Thanks!
Sébastien
The text was updated successfully, but these errors were encountered: