私は、春のチュートリアル「OAuth2:SSA with Angular JS and Spring Security Part V」に従った。スプリングブートOauthカスタムログインフォーム
カスタムログインフォームがもう動作しなくなった後、「authserver」プロジェクトをmavenからgradleに変換しました。
ログインフォームに必要なpom.xmlのwroタスクは機能していますか?
どちらか私はまた、このチュートリアルを試してみましたが、それは私のシナリオでは動作しませんでした: http://docs.spring.io/spring-security/site/docs/3.2.x/guides/form.html
私はあなたが私を助けることができることを願っています。
ログファイル:
2016年5月18日11:14:53.667 DEBUG 22312 --- [NIO-9999-EXEC-9] ossecurity.web.FilterChainProxy:14の5位に/ログイン追加のフィルターチェーンで。 [Nio-9999-exec-9] osswumatcher.AntPathRequestMatcher:リクエスト 'GET/login'が 'POST/logout'と一致しません 2016-05-18 11:14:53.667 DEBUG 22312 --- [nio-9999-exec-9] ossecurity.web.FilterChainProxy:/追加のフィルタチェーンの14の位置6にログインします。フィルタリング: 'UsernamePasswordAuthenticationFilter' 2016-05-18 11:14:53.667 DEBUG 22312 --- [nio-9999-exec-9] osswumatcher.AntPathRequestMatcher:リクエスト 'GET/login'が 'POST/login'と一致しません 2016-05-18 11:14:53.667 DEBUG 22312 --- [nio-9999-exec-9] ossecurity.web.FilterChainProxy:/追加のフィルタチェーン内の14の位置7にログインします。ファイアウォールフィルタ: 'DefaultLoginPageGeneratingFilter' 2016-05-18 11:14:53.667 DEBUG 22312 --- [nio-9999-exec-9] wcHttpSessionSecurityContextRepository:SecurityContextが空であるか内容が匿名です - コンテキストが格納されませんHttpSession。
コードOAuth2ServerConfigurationで:
@Override
public void configure(HttpSecurity http) throws Exception {
http.formLogin().loginPage("/login").permitAll()
.and().requestMatchers()
.antMatchers("/login", "/oauth/authorize", "/oauth/confirm_access")
.and().authorizeRequests()
.anyRequest().authenticated();
}
MainAuthserverApplication.java: @ComponentScan
@SessionAttributes("authorizationRequest") @EnableAutoConfiguration()
@EnableConfigurationProperties({AuthProperties.class}) public class MainAuthserverApplication extends WebMvcConfigurerAdapter {
@Override
public void addViewControllers(ViewControllerRegistry registry) {
registry.addViewController("/login").setViewName("login");
registry.setOrder(Ordered.HIGHEST_PRECEDENCE);
registry.addViewController("/oauth/confirm_access").setViewName("authorize");
}