what is the difference between loginPage vs loginProcessingURL.
.formLogin().loginPage("/login").usernameParameter("phone-number").passwordParameter("password")
Seems to be loginProcessingURL is like post method once user submits the data in the login page but when I remove also it is working fine. What is the significance of loginProcessingURL and how does it differ from loginPage?
loginProcessingUrl(): It specifies the URL using which username and password is validated. usernameParameter(): It specifies the field name to enter user name which is used by spring security to validate. If not specified then default is username.
From Spring Boot 2.7, WebSecurityConfigurerAdapter is deprecated.
Django, OAuth2, Keycloak, Auth0, and Amazon Cognito are the most popular alternatives and competitors to Spring Security.
The line loginPage("/login") instructs Spring Security
AND
.loginProcessingUrl("/login/process")
tells Spring Security to process the submitted credentials when sent the specified path and, by default, redirect user back to the page user came from. It will not pass the request to Spring MVC and your controller.
Refer documentation
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With