Custom login page with spring security

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

Java Development Journal

Java Development Journal

Күн бұрын

Пікірлер: 21
@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.
@grcurzon
@grcurzon 3 жыл бұрын
Explanation is good. Thanks
@javadevjournal
@javadevjournal 3 жыл бұрын
Thanks!!!
@sagarsri4143
@sagarsri4143 4 жыл бұрын
Superb 👌
@javadevjournal
@javadevjournal 4 жыл бұрын
Thanks!!!
@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 3 жыл бұрын
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 3 жыл бұрын
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 3 жыл бұрын
@@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 3 жыл бұрын
@@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 3 жыл бұрын
@@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 М.
ROSÉ & Bruno Mars - APT. (Official Music Video)
02:54
ROSÉ
Рет қаралды 90 МЛН
Kluster Duo #настольныеигры #boardgames #игры #games #настолки #настольные_игры
00:47
User registration using spring security and spring boot
32:46
Java Development Journal
Рет қаралды 11 М.
Spring Security Architecture Explained
14:41
Amigoscode
Рет қаралды 110 М.
What is Spring security?
19:08
Java Development Journal
Рет қаралды 11 М.