У меня проблема с моей клавиатурой и конфигурацией Spring Boot. Когда я пытаюсь выполнить запрос ресурса, которого не существует, я получаю статус 401 Http. Это конфигурация клавиатуры по умолчанию? Можно ли переопределить его, чтобы статус 404 не найден, когда URL-адрес не существует (какой-то порядок фильтрации?) Или это правильное поведение? Спасибо за любую подсказку. Ниже моей конфигурации keycloak:
@KeycloakConfiguration
public class SecurityConfiguration extends KeycloakWebSecurityConfigurerAdapter {
@Autowired
public void configureGlobal(AuthenticationManagerBuilder auth) {
auth.authenticationProvider(keycloakAuthenticationProvider());
}
@Bean
public KeycloakSpringBootConfigResolver keycloakSpringBootConfigResolver() {
return new KeycloakSpringBootConfigResolver();
}
@Override
protected SessionAuthenticationStrategy sessionAuthenticationStrategy() {
return new RegisterSessionAuthenticationStrategy(new SessionRegistryImpl());
}
@Override
protected void configure(HttpSecurity http) throws Exception {
super.configure(http);
http.authorizeRequests()
.antMatchers("/api/users")
.permitAll()
.anyRequest()
.fullyAuthenticated();
}
}