Admin and User Registration and Login Application with Spring Data JPA and MySQL Database

If you enjoyed this video, then please 👍LIKE and SUBSCRIBE this channel & press the bell icon for future videos. Thank you.
/ @codingtechniques2220
Admin and User Registration and Login Application
Learn how to build a secure Spring Security Registration and Login Application with User and Admin Pages in this step-by-step tutorial. This video covers the implementation of user registration with User and Admin by implementating AuthenticationSuccessHandler interface, and has authourity method to distribute permission across users, login functionality, and password encryption using Spring Security. Whether you're a beginner or an experienced developer, this tutorial will guide you through the entire process, providing valuable insights and best practices for creating a robust authentication system.
source code link: github.com/aliyusahaboadam/Ad...
🚀 Timestamps:
00:00 Introduction
00:15 What You will Learn
01:08 User and Admin Registration Channel
01:54 Application Architecture
02:20 What you will build
05:31 Creating new Spring starter Project
07:00 Adding Dependencies
07:54 Checking the initialized Project
09:13 Configuring MySQL Database
11:32 Creating JPA Entity (Model Class)
16:56 Back-end Implementation for Registration
17:17 Testing MySQL Database Config
19:59 Creating repository
21:49 Creating UserSerive Interface
23:21 Creating User Dto
25:07 Adding Dto to UserService interface
25:55 Implementing UserService Interface
30:38 Creating User Controller
31:07 creating endpoint for registration
36:45 front-end implementation for registration
53:14 Testing the registrion page
54:21 Spring Security Configuration
54:37 Creating CustomUserDetails
55:36 Implementing UserDetails interface
58:31 Creating CustomUserDetailsService
59:44 Implementing loadByUsername method
1:05:43 Encoding User Password
1:07:06 Creating Security Configuration Class
1:08:31 Adding BCrypt Password Encoder Bean
1:09:52 Configuring Endpoint
1:20:39 Registering Password Encoder and UserDetailService
1:23:38 Login method handler in Controller
1:24:50 Front-end for login
1:28:23 Testing the login implementation
1:31:59 Creating Custom Success Handler
1:36:15 Adding Custom Success Handler to Security Config
1:37:19 Giving Access Permission
1:38:13 Creating Admin and User Dashboard
1:46:57 Testing the project
What you will learn
1. how to build spring MVC application using spring
2. how to configure spring security and implementation of AuthenticationSuccessHandler
3. spring security authentication with user details and userdetailsservice
4. how to develop login and registration for Admin and User
5. spring logout features
6. how to configure MySQL database in spring boot
7. how to display authenticated user information using user details and principal interface
8. implementing Authentication Success handler to redirect User and Admin to different URL (pages)
9. Using hasAuthority Method for access permission to User and Admin Pages
Important Video Links
1. Introduction to JSON Web Token in Java
• Java JWT: Json Web Tok...
2. Admin and User Registration in Spring Boot with Spring Security
• Admin and User Registr...
3. Login and Registration Application with Spring Security
• Spring Security Regist...
4. Spring Security Tutorial Series Bigginer to Advance
• Spring Boot Security: ...
5. User Registration Form Using Spring Boot + MySQL Database + Thymeleaf + Spring Data JPA
• User Registration Form...
6. Spring Boot JWT Authentication and Authorization: JWT + Spring Security [NEW]
• Spring Boot JWT Authen...
7. Spring Boot Multi-Factor Authentication (MFA) with SMS OTP Token (One Time Password)
• Spring Boot Multi-Fact...
8. Forgot Password Spring Boot Tutorial Example
• Forgot Password Spring...
9. Cross-Origin Request Sharing (CORS) with Spring Boot and Spring Security
• Cross-Origin Request S...
10. Spring Security Roles and Authorities Explained - Spring Boot Security
• Spring Security Roles ...
11: Employee Magament System with Spring Boot and Spring Data JPA
• Employee Management Sy...
12: Spring Boot React Social Networking Application
• Spring Boot & React: C...
13: Integrate Spring Boot with React
• Spring Boot with React...
Other Links
Facebook: profile.php?...
WhatsApp: chat.whatsapp.com/JMCCpFZeGTy...
X Account:
x.com/codingtechnique?t=a7cva...
#User_Admin_Registration_and_Login_Tutorial
#Spring_security_registration_and login_tutorial
#Registration_and_login_in_spring boot
#User_Registration

Пікірлер: 63

  • @codingtechniques2220
    @codingtechniques22209 ай бұрын

    Subscribe our channel for more videos youtube.com/@codingtechniques2220?si=kphuQ8XQGtjpPx8K src code link github.com/aliyusahaboadam/Admin_User_Registration_Login_Spring_Boot_Application

  • @pslvgaming8588
    @pslvgaming85885 ай бұрын

    Thank you sir

  • @zafaransari2855
    @zafaransari28558 ай бұрын

    thank you sir .

  • @codingtechniques2220

    @codingtechniques2220

    8 ай бұрын

    Thanks

  • @mikoajjastrzebski9065
    @mikoajjastrzebski90655 ай бұрын

    Thank You so much! The only tutorial that works for current version of spring security

  • @codingtechniques2220

    @codingtechniques2220

    5 ай бұрын

    Thank you

  • @ashishkumarsrivastav9106
    @ashishkumarsrivastav91067 ай бұрын

    Great🎉

  • @kaiservonwien4826
    @kaiservonwien48268 ай бұрын

    Great video anyway, thanks to you

  • @codingtechniques2220

    @codingtechniques2220

    8 ай бұрын

    Thanks I really appreciate 🙏

  • @juliotorres0101
    @juliotorres01019 ай бұрын

    Thank you for you help

  • @codingtechniques2220

    @codingtechniques2220

    9 ай бұрын

    Thanks a lot

  • @thesongsof..........7783
    @thesongsof..........77834 ай бұрын

    really sir very very very very helpful video

  • @codingtechniques2220

    @codingtechniques2220

    4 ай бұрын

    Thanks I really appreciate

  • @user-xk2hm2vy5t
    @user-xk2hm2vy5t3 ай бұрын

    bro you are the best. The best infact

  • @codingtechniques2220

    @codingtechniques2220

    3 ай бұрын

    Thanks a lot bro 👍

  • @rohitshukla001
    @rohitshukla001Ай бұрын

    Video is slow and also Audio quality is poor else this, everything is on point. great content 👌

  • @codingtechniques2220

    @codingtechniques2220

    Ай бұрын

    Thank you for your review, I really appreciate 👍

  • @Errushijoshi
    @ErrushijoshiАй бұрын

    you are excellent!!

  • @codingtechniques2220

    @codingtechniques2220

    Ай бұрын

    Thank you I really appreciate

  • @imkawtarr
    @imkawtarr2 ай бұрын

    I cannot thank u enough! Just a question ( i want the admin to have acces to the users pages too what should i add?) thanks in advance !

  • @codingtechniques2220

    @codingtechniques2220

    2 ай бұрын

    For the user endpoint in security config where you call hasRole methods just add comma and ADMIN eg hasRole(USER, ADMIN)

  • @harishkumarsb3848
    @harishkumarsb38482 ай бұрын

    Great Thank you, i have one question here, if i want to hit the post/get request from postman what changes should i make? Thanks in advance

  • @codingtechniques2220

    @codingtechniques2220

    2 ай бұрын

    Thank you, I think you can just call it without any changes

  • @08_b_himanshusharma30
    @08_b_himanshusharma306 ай бұрын

    in this where is the Postmapping(/login) which you used in login.html file at form tag ????

  • @codingtechniques2220

    @codingtechniques2220

    6 ай бұрын

    There is no post mapping for login spring security automatically handles the case

  • @masekoamin3494
    @masekoamin34944 ай бұрын

    Thank you sir!!. For me everything is working fine except the success handler.. aftr entering correct details it redirects to /error It seems as if the success handler is not working Can u kindly assist

  • @codingtechniques2220

    @codingtechniques2220

    4 ай бұрын

    Join here and report chat.whatsapp.com/JMCCpFZeGTy9b4mQLVCRQO

  • @rajirajeswari2199
    @rajirajeswari21994 ай бұрын

    Hello sir, where u created user details and user details service class?? I'm unable to see ..

  • @codingtechniques2220

    @codingtechniques2220

    4 ай бұрын

    56: to 59:44

  • @codingtechniques2220

    @codingtechniques2220

    4 ай бұрын

    Is an interface provided by spring Security we just implements it

  • @chienphung9633
    @chienphung96333 ай бұрын

    i have a question, each time we register, we need fill in database with field role, it is not convinient

  • @codingtechniques2220

    @codingtechniques2220

    3 ай бұрын

    That's because the owner of the apps have to decide who is admin and who is not

  • @Brookistaken
    @BrookistakenАй бұрын

    when I open mySQL work bench and create the table, the table is not there. I followed the code exactly. did anyone experience this and how did you fix it?

  • @codingtechniques2220

    @codingtechniques2220

    Ай бұрын

    You just have to create the DB and run the program, the table will automatically created

  • @Brookistaken

    @Brookistaken

    Ай бұрын

    @@codingtechniques2220 when I created the DB on MySQL workbench and run the code it works but i can not open the table to see the string that was created in User.java. when i delete the DB and run the code an error pops up saying there is no user DB. so it picks it up but it can not open it

  • @RajeshChauhan-wy7yu
    @RajeshChauhan-wy7yu9 ай бұрын

    Hello sir, i didn't catch how you resolve white level error please breif about this

  • @codingtechniques2220

    @codingtechniques2220

    9 ай бұрын

    By creating new authentication success handler and mapping for user and admin, the white lebel arror is test for login at path this "/"

  • @Know_by_AI
    @Know_by_AI8 ай бұрын

    Hello sir we are modifying the role of the person but how can I get user as default when the person is registered

  • @codingtechniques2220

    @codingtechniques2220

    8 ай бұрын

    set the user role as null provide statements that if the user is null then redirect him to USER URL. And you can used form to accept the roles of person and in this case you have no authourity over your data everyone will every role.

  • @Know_by_AI

    @Know_by_AI

    8 ай бұрын

    @@codingtechniques2220 thank you sir

  • @TranVanHuyPH

    @TranVanHuyPH

    8 ай бұрын

    @@codingtechniques2220 Where should I handle this problem? securityconfig or customUserDetail?

  • @Zhurman
    @Zhurman2 ай бұрын

    Hello, Sir! Hello guys. Well, I’m writing in a case of issue. I have configured security filter chain, but login request always redirects me to login page. By debugger I can’t get to the point where I should take user info by name from repository. But when I set login by default it works. Maybe someone had same issue ?

  • @codingtechniques2220

    @codingtechniques2220

    2 ай бұрын

    Report it here in pictures chat.whatsapp.com/JMCCpFZeGTy9b4mQLVCRQO

  • @eswarreddy5046
    @eswarreddy50464 ай бұрын

    Hello sir,Cannot resolve parameter name for user_dto error occurred how to resolve it

  • @codingtechniques2220

    @codingtechniques2220

    4 ай бұрын

    Report here chat.whatsapp.com/JMCCpFZeGTy9b4mQLVCRQO

  • @Hacquees
    @Hacquees2 ай бұрын

    hey my index.html is getting open directly even login page is also working fine.can you help me ?

  • @codingtechniques2220

    @codingtechniques2220

    2 ай бұрын

    report here in pictures chat.whatsapp.com/JMCCpFZeGTy9b4mQLVCRQO

  • @user-zk6mm6xb6j
    @user-zk6mm6xb6j8 ай бұрын

    How to set the role as USER by default after registration? Thanks for the video though

  • @codingtechniques2220

    @codingtechniques2220

    8 ай бұрын

    You could simply set all the roles to users and change the needed one to admin in Database

  • @user-zk6mm6xb6j

    @user-zk6mm6xb6j

    8 ай бұрын

    How can i set role to USER? I am new to spring boot 😅@@codingtechniques2220

  • @chiman75

    @chiman75

    7 ай бұрын

    i thought about this myself not really connected to this tutorial. 1 way i can think of (have not tried it myself) would be when delivering the app it would be delivered with 1 admin account. And that admin user can create other admins or set others as admin otherwise all others would be normal users.

  • @codingtechniques2220

    @codingtechniques2220

    7 ай бұрын

    @@chiman75 you could simply make all users to USER by registration and set the needed one to admin (it gives ability to modify admin, you can change your admin if the person is not longer suitable for the ADMIN )

  • @chiman75

    @chiman75

    7 ай бұрын

    @@codingtechniques2220 my idea was to make some app features only visible to admin. Admin can there grant or revoke admin or other rights or elevate read write privileges on the pages only accessible n visible to admins.

  • @weekly_t_e_c_h6529
    @weekly_t_e_c_h65298 ай бұрын

    Sir ,how to implement forgot password for the above project

  • @codingtechniques2220

    @codingtechniques2220

    8 ай бұрын

    here is the link for the forgot password Tutorial: kzread.info/dash/bejne/noSpl5SkgZi7pdI.htmlsi=1MP0H4DqrKunUEy0

  • @divyanuthakki1559
    @divyanuthakki15593 ай бұрын

    Im getting login error

  • @codingtechniques2220

    @codingtechniques2220

    3 ай бұрын

    check this repository compare it with the code and check the tutorial github.com/aliyusahaboadam/Admin_User_Registration_Login_Spring_Boot_Application

  • @pratikkhodke9666
    @pratikkhodke96668 ай бұрын

    How to fetch, update and delete... please tell 🙌

  • @codingtechniques2220

    @codingtechniques2220

    7 ай бұрын

    Using JPA I will provide the JPA Tutorials in series

Келесі