vaadin / flow

Vaadin Flow is a Java framework binding Vaadin web components to Java. This is part of Vaadin 10+.
Apache License 2.0
621 stars 167 forks source link

Spring's impersonation does not work on Vaadin #20495

Open tbee opened 4 days ago

tbee commented 4 days ago

Description of the bug

Spring offers a default way of an administrator impersonating a regular user. This seems not to work on Vaadin-on-Spring because Authorization seems not to be setup yet in the start-impersonating request. More here https://vaadin.com/forum/t/how-to-do-impersonation-using-spring-security/167804

Expected behavior

Well, it should work 😄

Minimal reproducible example

On a Vaadin-on-Spring application with Spring security and login enabled: configure the SwitchUserServlet as per one of the many examples, preferable on GET (which makes test easier) and attempt an impersonation. Probably VaadinAwareSecurityContextHolderStrategy should be set as the strategy on the filter (but won't fix the problem).

https://stackoverflow.com/questions/72378146/user-impersonation-with-spring-security

Versions

mshabarov commented 3 days ago

This sounds to me more like an enhancement, however, we have to double check our integration with Spring Security, maybe there is something blocking this feature to work.

tbee commented 3 days ago

Assuming the integration with Spring security is supposed to encompass all standard functionality, than this should be supported IMHO.