I'm using SpringBoot 2.4.7
and I'm trying to implement jdbc Authentication. The problem is that I can't reach the backend via http. I have read that with following configuration:
@Override
protected void configure(final HttpSecurity http) throws Exception {
http.authorizeRequests()
.antMatchers("/login")
.permitAll()
.and()
.formLogin()
....
I can reach a default login page at my context application address. But I would like to call a POST
login endpoint with username
and password
parameters.
How can I do this?
If you are trying to receive the user credentials via a REST Endpoint and manually authenticate the user you can do this way:
This way, the
Filters
will take care of the rest of the authentication steps for you. The Spring Security documentation can be researched for more details.If you want to use the endpoint generated with the default login page, you can follow the steps from the documentation to make your own request: