Я пытаюсь добавить Spring Security в свой API-Gateway, но по какой-то причине он получает либо имя пользователя и пароль из приложения. /p>
GatewayConfig.java
@Configuration
@EnableWebSecurity
public class GatewayConfig
{
@Bean
public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
return http
.csrf(AbstractHttpConfigurer::disable)
.httpBasic(Customizer.withDefaults())
.formLogin(Customizer.withDefaults())
.authorizeHttpRequests(request->request.anyRequest().authenticated())
.build();
}
@Bean
public InMemoryUserDetailsManager getService()
{
UserDetails user1= User.withDefaultPasswordEncoder()
.username("Gojo")
.password("Gojo@123")
.build();
return new InMemoryUserDetailsManager(user1);
}
}
< /code>
Консоль вывод < /p>
Я пробовал все решения, но ни один из них не решает мою проблему, пожалуйста, помогите мне, как продолжить < /p>
попытался добавить конфигурацию безопасности, но пружина не читает ее.>
Подробнее здесь: https://stackoverflow.com/questions/794 ... ng-the-con