Hi everyone.i need help

I have just started to work with vaadin framework. I have created a login page with vaadin’s default login page. Can anyone tell me how to check the username and password with the database and move to next page on successful login. Im using postgresql.

Hi Savaş

If you are using Spring security, I can refer you to the tutorial [Securing your app with Spring Security]
(https://vaadin.com/learn/tutorials/securing-your-app-with-spring-security)

If you are not using spring security, then there aren’t many boundaries for how you want to implement it. The most direct approach would be to read the username and password from your input fields, run a query against your user db and either allow the user or you don’t. Then ofc you’d also have to [remember in the session]
(https://stackoverflow.com/questions/54246663/user-sessions-with-vaadin-flow) if the user is logged in so you can check in every secured view whether the user is allowed to see that view or if he needs to be redirected to the login view. The abovementioned spring security tutorial has some great tipps about this as well that can be done even without spring.

I can recommend using spring security though, it works great together with vaadin.

tnx for ur help but i need sample code for default login page.where i check entering username and password with database.

I want to say this. There are many code examples but I couldn’t adapt it. I want to verify it from the database using spring security.