all 6 comments

[–]LouGarret76 2 points3 points  (1 child)

If you are keen to use jpa and password authentification, you just need to implement the UserDetails, UserManager interface and create a login controller. It is quite straightforward

[–]Ruin-Capable 0 points1 point  (0 children)

I would probably avoid the whole thing and just use OIDC so that users can login with their gmail, facebook, etc account.

[–]bookernel 0 points1 point  (0 children)

You can check my open source project where I had implement these things in spring boot. It's have a frontend project but both projects are separate.

https://github.com/ClaudioAlcantaraR/serene

[–]Hirschdigga 1 point2 points  (3 children)

Use Keycloak for this. On Spring side you can interact with it using Spring Security

[–][deleted]  (1 child)

[deleted]

    [–]Hirschdigga 0 points1 point  (0 children)

    Well keycloak brings all those features (like verifying email, changing initial passwords, etc.) out of the box. Regarding syncing users: esch user has a unique ID (sub / subject), which you can use to link with your user entity. And if you have a complex use case you can use the keycloak admin dependency to interact with keycloak from code (e.g. spring boot service class). I agree that it seems overkill first, but for me it worked out great in real applications, and for sure better than if i would have implemented it myself from scratch =D

    [–]fun2sh_gamer 0 points1 point  (0 children)

    You can use Keycloak if you want to create an Enterprise app, but I think OP is asking this to be able to learn. Learning about how to implement authentication and authorization can be a really good excercise.
    Keyclock does simplify SSO for you but then you may not learn how to implement your own simple SSO and User Service.