검증되지 않고, 내가 MYGlobalAuthenticationConfigurerAdapter 이 같은 만든봄 부팅 기본 인증 사용자 이름은 내가 봄의 보안 안돼서
그것을 밖으로 시도하는 나의 봄 부팅 응용 프로그램에 대한 기본 인증을 만들었습니다
@Value("${username}")
String username;
@Value("${password}")
String password;
@Override
public void init(AuthenticationManagerBuilder auth) throws Exception {
auth.userDetailsService(userDetailsService());
}
@Bean
public UserDetailsService userDetailsService() {
return new UserDetailsService() {
@Override
public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
return new User(username, password, true, true, true, true,
AuthorityUtils.createAuthorityList("USER"));
}
};
}
을 내가 속성에서 사용자 이름과 암호를로드
참고 파일 및 I 값
이 같은및 MyWebSecurityConfigurerAdapter에 대해 검증 :
,@Override
protected void configure(HttpSecurity http) throws Exception {
http.authorizeRequests().anyRequest().fullyAuthenticated().and().
httpBasic().and().
csrf().disable();
}
@EnableWebSecurity
주석이있는.
제 질문은 @md zahid raza를 참조 할 수 있습니까? https://stackoverflow.com/questions/46065063/spring-boot-basic-authentication –