1
この設定は、訪問site.comた後、私はメインページを参照してくださいが、ページ春のセキュリティ、セキュアでないルートパス私のopitionで
@Override
protected void configure(HttpSecurity http) throws Exception {
http.csrf()
.disable()
.authorizeRequests()
.antMatchers("/resources/**").permitAll()
.antMatchers("/register").permitAll()
.antMatchers("/login").permitAll()
.and();
http.formLogin()
.loginPage("/login")
.loginProcessingUrl("/j_spring_security_check")
.successHandler(getAuthenticationSuccess())
.failureUrl("/login?error=accessDenied")
.usernameParameter("j_username")
.passwordParameter("j_password")
.permitAll()
.and()
.authorizeRequests()
.antMatchers("/**").authenticated()
.anyRequest().authenticated()
.and();
http.logout()
.logoutSuccessUrl("/")
.logoutUrl("/logout")
.permitAll();
http.headers().xssProtection();
ログインにリダイレクトされなければならないルート
からサイトのすべてのページにセキュリティを可能にしなければなりません
Thxをログアウトして、ログインURLを入力して、メインページを参照してください後にログアウトしなければなりません! –