No video

Custom login page with spring security

  Рет қаралды 13,343

Java Development Journal

Java Development Journal

Күн бұрын

how to use the custom login page with spring security? How to handle and provide a custom login page with #springsecurity using #springmvc and #springboot.
Spring security provide a default login page in case no custom login page is configured with security. In this video, we will look in to each and every step to customize the login process and use a custom login page. We will cover the following information in this #springsecuritytutorial.
1. Create custom login page in spring security.
2. Define a custom login controller.
3. Create a custom user detail service to get customer information and pass it to Spring security.
4. How to configure DAOAuthenticationProvider and pass our user detail service.
Spring Security Authentication Providers - www.javadevjournal.com/spring...
Spring Security UserDetailsService - www.javadevjournal.com/spring...
#springsecurity #springsecuritycourse #springsecuritytutorial #springsecuritylogin #springboot #springmvc #springbootcourse #springsecuritycustomloginpage

Пікірлер: 21
@grcurzon
@grcurzon 3 жыл бұрын
Explanation is good. Thanks
@javadevjournal
@javadevjournal 3 жыл бұрын
Thanks!!!
@sagarsri4143
@sagarsri4143 3 жыл бұрын
Superb 👌
@javadevjournal
@javadevjournal 3 жыл бұрын
Thanks!!!
@ravindrabhatt8699
@ravindrabhatt8699 Жыл бұрын
Hello just wondering on which class we are generating cookie, I know how we can change cookie name and other configs but can you point me where exactly we are creating cookie and setting it to response. Also does this cookie creation logic remains same on oauth2 flow as well. thanks in advance.
@Lukas-dw8jm
@Lukas-dw8jm 3 жыл бұрын
I have a problem, does anyone know how I can free up the static resources of the login page? I already released the configure method (WebSecurity web) and added ("/ resources / **", "/ static / **") but it still didn't work, I read it in the documentation and says to do the same, but I don't know why that is not working.
@javadevjournal
@javadevjournal 3 жыл бұрын
What is the issue you are facing? resources not loading? if possible, create a small GitHub repo with your sample code and we can look in to it.
@Lukas-dw8jm
@Lukas-dw8jm 3 жыл бұрын
@@javadevjournal thank you man, the problem is the resources are not loading and i don't understand why being that i did the same shows your video and how it is in the documentation. segue o link do git: github.com/Lukasrsv/Resources
@javadevjournal
@javadevjournal 3 жыл бұрын
@@Lukas-dw8jm I did not run the code but looking at the code on GitHub, I can see that you are using the @EnableWebMvc annotation. Please note that with the @EnableWebMvc annotation, Spring Boot auto configuration will not be activated automatically. Check this out docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#boot-features-spring-mvc-auto-configuration. I will suggest to remove the @EnableWebMvc annotationand let Spring Boot do work for you until you want to control it yourself else you can use WebMvcConfigurer to customize the behavior.
@Lukas-dw8jm
@Lukas-dw8jm 3 жыл бұрын
@@javadevjournal Good morning, so I did what you said, I removed the @EnableWebMvc annotation, but it's still not working.
@javadevjournal
@javadevjournal 3 жыл бұрын
@@Lukas-dw8jm Let me take a look at your GitHub code? I see you have added lot of annotation there, any reason for that? like you are specifying explicit component scan etc?
@sarvavideovice4209
@sarvavideovice4209 2 жыл бұрын
Hi bro I want to pass Username, Password and one selectoption value How can i get the value inside loadUserByUsername method. PLease reply me bro
@javadevjournal
@javadevjournal 2 жыл бұрын
Still not sure what is your requirement, in any case, you can extend the UsernamePasswordAuthenticationFilter to handle those additional parameters. They will be part of the HTTP request and it's up to you as how do you want to use them (ma be store in session or somewhere)
@sarvavideovice4209
@sarvavideovice4209 2 жыл бұрын
@@javadevjournal Thank you bro I will explain my requirement in my login Page I want to pass three input parameters 1.Compamyid 2. Username, 3 password based on this three value authentication needs work brother please suggest me if any possible way to do this
@javadevjournal
@javadevjournal 2 жыл бұрын
@@sarvavideovice4209 Yes, As suggested use the Filter to combine both username and company id and than in your userdetails service, you can use same logic to split both the information to run your logic. This is the most simple option we have
@sarvavideovice4209
@sarvavideovice4209 2 жыл бұрын
@@javadevjournal sure bro I will try that way thanks for your suggestion can you please put video regarding this requirement it will help more people 😊
@yaserrasheed2390
@yaserrasheed2390 3 жыл бұрын
One doubt. in CustomUserDetailService.java you are calling User.withUsername(... What is the User class, I could not see it in the tutorial
@javadevjournal
@javadevjournal 3 жыл бұрын
User class is provide by Spring security to represent the User and withUsername is the method in the builder. Take a look at org.springframework.security.core.userdetails.User to see how this class look like
Spring Security - Email verification registration
29:49
Java Development Journal
Рет қаралды 18 М.
Introduction to spring security authentication providers
15:10
Java Development Journal
Рет қаралды 6 М.
MISS CIRCLE STUDENTS BULLY ME!
00:12
Andreas Eskander
Рет қаралды 20 МЛН
Useful gadget for styling hair 🤩💖 #gadgets #hairstyle
00:20
FLIP FLOP Hacks
Рет қаралды 10 МЛН
Smart Sigma Kid #funny #sigma #comedy
00:40
CRAZY GREAPA
Рет қаралды 29 МЛН
WORLD'S SHORTEST WOMAN
00:58
Stokes Twins
Рет қаралды 114 МЛН
User registration using spring security and spring boot
32:46
Java Development Journal
Рет қаралды 11 М.
Why The Windows Phone Failed
24:08
Apple Explained
Рет қаралды 123 М.
What is Spring security?
19:08
Java Development Journal
Рет қаралды 11 М.
Spring Security Architecture Explained
14:41
Amigoscode
Рет қаралды 102 М.
OAuth 2.0 explained with examples
10:03
ByteMonk
Рет қаралды 115 М.
MISS CIRCLE STUDENTS BULLY ME!
00:12
Andreas Eskander
Рет қаралды 20 МЛН