I created the configuration class telling all requests must be authorized and setting httpBasic()
:
@Configuration
@EnableWebSecurity
public class WebConfig extends WebSecurityConfigurerAdapter {
@Override
protected void configure(HttpSecurity http) throws Exception {
http
.authorizeRequests().anyRequest().authenticated().and()
.httpBasic();
}
}
But despite that, the password generated when restarting the server seems to be always wrong and not authorizing. If I comment it out it will naturally allow access to an endpoint I have. What could be wrong?