Vaadin 23 + spring secirty + authentication. How to modify this bean so that I can find if the user

exists in the database. and how to find out username from the loginform in this bean
public UserDetailsManager userDetailsService() {
UserDetails user =
UserDetails admin =
return new InMemoryUserDetailsManager(user, admin);

Additionally I dont want to use “in memory”

thanks for quick reply. I had seen that before but I dont have DataSource set up. i am using service, repository and entity classes to access database. How do I set up DataSource?

thanks. I will check this out. one more question.

how do I get username (from the loginform) in this bean?

You don’t. You provide Spring Security a way to authenticate users by implementing the UserDetailsService interface configure your security setup to use that implementation.

Ok. I will try that out.

Thanks for your help

I will get back to you once I have tested it.

its working now. Thanks