저는 봄 부팅 프로젝트에서 basicAuth
을 사용하고 있습니다.SpringBoot 기본 인증 .wsdl로 끝나는 URL을 무시합니다.
서비스 URL을 인증해야한다는 요구 사항이 있지만 WSDL에서는 인증이 없어야합니다.
인증 된 모든 & URL을 application.yml
파일로 유지 관리하고 싶습니다. 같은
뭔가 : 코드 위
auth.authenticated: /onlineshop/v1/ecart,/onlineshop/v1/wishlist
auth.ignored: /onlineshop/v1/ecart.wsdl,/onlineshop/v1/wishlist.wsdl
@EnableWebSecurity
@Configuration
class WebSecurityConfig extends WebSecurityConfigurerAdapter {
@Value("${auth.authenticated}")
String[] allAuthenticated;
@Value("${auth.ignored}")
String[] allIgnored;
@Override
protected void configure(HttpSecurity http) throws Exception {
// Something like
for (String ignored: allIgnored) {
http.authorizeRequests().antMatchers(ignored).permitAll();
}
// Something like
for (String authenticated: allAuthenticated) {
http.authorizeRequests().antMatchers(authenticated).authenticated();
}
....
}
}
(즉 죄송 ) 초안이지만, 나는이 라인을 따라 코딩 해봤지만 작동하지 않습니다.
인증을 적용하지 않습니다.
이 작업을 어떻게 수행 할 수 있는지 제안하십시오. 내가 된 .wsdl
로 끝나는 모든 URL을 무시할 수있는 방법을
또한, 대신 된 .wsdl 종료 선택적 URL을 무시하고 당신에게 모든
나는 당신이 내가 대답 한 것과 똑같은 말을했다는 것을 보았습니다. 보상 할 수 있도록 ;-) – GhostCat