Нужно login
и authenticate
пользователю, использующему spring boot
, Spring Security и angular 7
.
. Я создал приложение с пружинной и угловой загрузкой 7. Мне нужно аутентифицировать учетные данные пользователя.и успешно войти в систему пользователем в системе. Как отправить учетные данные для входа в систему с угловой на пружинную загрузку, используя конфигурацию безопасности Spring.
Ниже приведен мой SecurityConfig.java
@Configuration
@EnableWebSecurity
@EnableGlobalMethodSecurity(prePostEnabled=true)
public class SecurityConfig extends WebSecurityConfigurerAdapter{
private AuthenticationProvider authenticationProvider;
private AuthenticationSuccessHandler authSuccessHandler;
@Override
protected void configure(HttpSecurity http) throws Exception {
http
.authorizeRequests()
.antMatchers("/**").permitAll()
.antMatchers("/resources/**").permitAll()
.antMatchers("/resources/global/plugins/**").permitAll()
.and()
.csrf().disable();
}
@Override
protected void configure(AuthenticationManagerBuilder auth)
throws Exception {
auth
.inMemoryAuthentication()
.withUser("user")
.password("{noop}password")
.roles("USER");
}