vaadin4spring icon indicating copy to clipboard operation
vaadin4spring copied to clipboard

Investigate conflicts between Vaadin and Spring Security

Open peholmst opened this issue 9 years ago • 10 comments

There are a few things such as CSRF protection and session management that both Vaadin and Spring Security try to handle. This can lead to conflicts and strange errors. We have to investigate what features are duplicated and how to handle them.

peholmst avatar Mar 04 '15 09:03 peholmst

For CSRF, I've opted in all samples to disable its' use within Spring Security. What kind of strange errors are you getting ?

I believe only one should be enabled.

gjrtimmer avatar Mar 05 '15 08:03 gjrtimmer

My experience is also that you should just disable Spring Security CSRF protection when using Vaadin4Spring. Since I did, everything seems to work pretty well in my current project.

pesse avatar Mar 05 '15 08:03 pesse

We've experienced push stability problems with Spring Security. Sometimes, the UI freezes and you have to do a hard refresh to get a new UI. We don't know what's causing this, but one possibility is that Spring Security does something with the session that is not compatible with Vaadin push.

peholmst avatar Mar 05 '15 08:03 peholmst

Do you have some reproduction steps for me ?

gjrtimmer avatar Mar 05 '15 09:03 gjrtimmer

No we don't, this problem is completely random. We have not been able to reproduce it, but still it happens every now and then. However, sometimes, we've seen this message in the logs: "Session expired before push was disconnected. This should never happen."

peholmst avatar Mar 05 '15 10:03 peholmst

The FileDownloader extension is not working with "frameOptions" enabled. I've also experienced some problems with push months ago, I've figured out that web filters were completely ignored by push requests.. That's maybe a clue.

monp avatar Mar 05 '15 11:03 monp

@monp What transport protocol were you using for push? Websockets, long polling or streaming?

peholmst avatar Mar 05 '15 11:03 peholmst

It was Websockets... that's probably why ^^.

monp avatar Mar 05 '15 11:03 monp

@monp OK. The problems we're experiencing show up when using long polling.

peholmst avatar Mar 05 '15 12:03 peholmst

doesn't Vaadin have CSRF protection built-in? If so would there be any need to enable csrf on the Spring WebSecurityConfigurerAdapter?

FearlessHyena avatar Apr 29 '15 21:04 FearlessHyena