-
Notifications
You must be signed in to change notification settings - Fork 4k
Possible CSRF detected - state parameter was present but no state could be found #322
Comments
That depends on how you set up the |
In client side, i'm using:
This configuration |
The problem is the session then. You have 2 servers running on localhost, on different ports, but cookies don't record the host, only the path, and both are on the root path "/" so they are sharing a cookie. Put one of them in a sub context (e.g. using |
I tried that.
|
I can see that your client is not sending cookies. I think you can do it with curl, but it might take some effort. Does it work in a browser? |
I activated the cookies in curl, and now i have a different error: Error requesting token:
|
Looks like an access denied when the client tries to get the user details. Perfectly normal probably. This isn't really a Spring OAuth feature, but maybe you can share a bit more? How is the client trying to get the user details? Did you forget to set the access rule for the token info endpoint on the server? |
Duplicates spring-attic/spring-cloud-security#13 |
Just seen a similar issue while trying out https://spring.io/guides/tutorials/spring-boot-oauth2/ you can see that set-cookie is called twice as second login/facebook call is not passing previously set sessionid |
An alternative to @dsyer suggestion to change the context path is to change the cookie name one of your services use eg.
|
Note since Spring Boot 2, to change the cookie name, the parameter is server.servlet.session.cookie.name |
Hi,
When i try to create a Spring OAuth server, like this, in Spring blog, i get an error:
Apparently, state param is not maintained between different requests, by OAuthRestTemplate.
The text was updated successfully, but these errors were encountered: