In essence I can successfully log in from the login and enter my main view, but then if I reload the page, or go to another view that that user has permission to, I am returned to the login. When I tested something strange happens, the first time I enter the main view I print the current user in the console and it works fine, but I print the same thing in any other event and it already tells me AnonymousUser.
I have attached two txt, one with my security class that extends VaadinWebSecurity and the other with the login method that I use in my login view. I use a DaoAuthenticationProvider as a provider. SecurityConfig.txt (1.55 KB) login_method.txt (557 Bytes)
Oh thank you very much first of all for answering me so quickly, forgive my skills, I’m new to Spring and Vaadin. In my User class that implements UserDetails I have this configured:
Thank you very much for this documentation, I read it carefully and it seems that all my configuration is fine. This behavior drives me crazy because it is very uncomfortable that the client has to log in continuously.
P.S: I even changed the SecurityContextHolder strategy to global, so that regardless of the thread of execution the same security context is shared since my application is a monolithic application, but nothing, the same problem. I do not know what else to do.