我正在尝试将Spring Social引入Spring Security的现有Web应用程序.现有的Web应用程序使用XML配置,即:
<security:http
disable-url-rewriting="true"
use-expressions="true"
xmlns="http://www.springframework.org/schema/security">
...
<intercept-url
pattern="/w/configuration/**"
access="hasRole ('ROLE_ADMIN')"/>
...
<form-login
login-page="/w/welcome"
authentication-success-handler-ref="authSuccessHandler"
authentication-failure-handler-ref="authFailureHandler"/>
<logout logout-success-url="/w/welcome"/>
</security:http>
Run Code Online (Sandbox Code Playgroud)
如何将SpringSocialConfigurer()添加到配置中?关于Spring Social的所有文档都使用了我想要避免的基于Java的配置,例如:
@Override
protected void configure(HttpSecurity http) throws Exception
{
http
.formLogin()
.loginPage("/signin")
.loginProcessingUrl("/signin/authenticate")
.failureUrl("/signin?param.error=bad_credentials")
.and()
.logout()
.logoutUrl("/signout")
.deleteCookies("JSESSIONID")
.and()
.apply(new SpringSocialConfigurer());
}
Run Code Online (Sandbox Code Playgroud)
apply()方法的XML等价物是什么?