Spring Security Multiple Login Pages Examples (Admin - User and Admin - Customer)

preview_player
Показать описание
In this Spring Security video, I'd like to share with you guys about how to implement different login modules for different types of users in the same Spring Boot app with Spring Security:
- Admin Login and User Login: same authentication source
- Admin Login and Customer Login: different authentication sources

The code examples are tested with Spring Boot 2.7.0+ and Spring Security 5.7.1+. No use of WebSecurityConfigurerAdapter.

For simplicity, I use H2 in-memory database and user credentials are stored in plain text.

Technologies: Spring Web, Spring Data JPA, Spring Security, Thymeleaf, H2 database.

Software programs: Java Development Kit (OpenJDK / Oracle JDK) – Java version 11+, Spring Tool Suite IDE.

Рекомендации по теме
Комментарии
Автор

Fantastic tutorial! I was just curious why you opted not to include authorization, like JWT, in your implementation?

scholarway
Автор

Em chào anh Nam.
anh có thể ra video hướng dẫn login với nhiều Params không ạ.
ví dụ lúc đăng nhập yêu cầu nhập 3 trường:
- phone
- userName
- password
Mong nhận được phản hồi từ anh. Em cảm ơn!

vannguyen-rtbh
Автор

Is the code in
the video on git hub?

mavjudbeksokhibov
Автор

How can I have a registration page that is authenticated when the user registers I can not do this because I used the filter in security.

alitorabi
Автор

anh cho em xin source code với được không ạ?

nguyenxuanmanh
Автор

I do not know why, but when I try to log in under the user, an exception is thrown [nio-8080-exec-3] : Resolved Request method 'POST' is not supported] the html page and security config are similar to the admin, but in the case of the admin, everything is fine.

lewefun
Автор

Invocation of destroy method failed on bean with name Database is already closed (to disable automatic closing at VM shutdown, add ";DB_CLOSE_ON_EXIT=FALSE" to the db URL) I go this error i don't know what it is

gokuls
join shbcf.ru