私はSpring Securityでいくつかの従来のAngularアプリケーションを保護しようとしています。 全体の角度静的なものがSpring Security - AngularJS - 角型静的コンテンツの保護
src/main/resources/static
下にあり、確保の対象とすべきすべてのものは、ここで
src/main/resources/static/protected-stuff
下にある私の設定は(それが全体的な春ブーツアプリの構成の一部である)である。
@Override
protected void configure(HttpSecurity http) throws Exception {
http.formLogin()
.loginPage("/login.html").permitAll()
.loginProcessingUrl("/dologin")
.failureForwardUrl("/login.html?isError=true")
.failureUrl("/login.html?isError=true")
.defaultSuccessUrl("/protected-stuff/index.html")
.and()
.authorizeRequests()
.antMatchers(HttpMethod.GET, "/", "/index.html", "/home.html", "/login/**").permitAll()
.antMatchers("/protected-stuff/**").authenticated()
.and()
.csrf().disable();
}
今、私には問題がある部分がある:
.antMatchers("/protected-stuff/**").authenticated()
errorneusログイン時にリダイレクトすると、認証リクエストが処理されます(AuthenticationProviderに遭遇します)などが動作しますが、認証が成功した後は保護されたものにリダイレクトされ、ログインページにリダイレクトされます。今私はリソースフィルタとSpring Secインターセプタ(ok、再び、フィルタ)が互いに衝突していると思われますが、このような状況を克服することは本当に確実ではありませんか?
ご協力いただきありがとうございます。