私は春のブートプロジェクトで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