Postgre data for login

Hi. I want to use the list of users(username/password) from a certain postgre database to my login page and my vaadin app. Vaadin version 23. I used this guide and want the data from db to be used in my login.

Hi! That is just essentially configuring Spring Security. If you want a code example, create a project via with these settings: enable access check (for example for logged in users on), make the project use postgresql on the settings tab.

There may be minor differences with Vaadin 23, but mostly package name changes.

So basically I want my app to have a functioning login with usernames and passwords from postgre database instead of the hardcoded once from the guide.

If you don’t wanna follow Matti’s advice, you can also go the Baeldung route.

Thank you @quirky-zebra. I am trying Matti’s advice and will check on this one as well.

Hi. For some reasons it says this error.

I checked out a project and indeed with PostgreSQL I seem to get the same exception. Some sort of regression, my guess is with the DB schema as same works with H2 perfectly.

Yes, seems to be related to the profile picture part in the user entity. If you remove that and the related sample data from data.sql, it works.

Isn’t the first time I hear about that :sweat_smile: remove that from the starter, it’s not worth that hassle

I couldn’t agree more, the examples should show how to do Vaadin coding, not PostgreSQL + Hibernate hacks :slightly_smiling_face:

There seems to be an issue with a workaround as well: PostgreSQL and LOB · Issue #94 · vaadin/starters · GitHub

Yeah… Working with Lobs is painful and literally all DBMS want different JPA annotations to work perfect… had some annoying days in the past to support Postgre, Oracle and H2 at the same time in one of our products…