public class SpringSocialConfigurer
extends org.springframework.security.config.annotation.SecurityConfigurerAdapter<org.springframework.security.web.DefaultSecurityFilterChain,org.springframework.security.config.annotation.web.builders.HttpSecurity>
SocialAuthenticationFilter
to Spring Security's filter chain.
Used with Spring Security 3.2's Java-based configuration support, when overriding WebSecurityConfigurerAdapter#configure(HttpSecurity):
protected void configure(HttpSecurity http) throws Exception { http. // HTTP security configuration details snipped .and() .apply(new SpringSocialHttpConfigurer()); }
Constructor and Description |
---|
SpringSocialConfigurer()
Constructs a SpringSocialHttpConfigurer.
|
Modifier and Type | Method and Description |
---|---|
SpringSocialConfigurer |
alwaysUsePostLoginUrl(boolean alwaysUsePostLoginUrl)
If true, always redirect to postLoginUrl, even if a pre-signin target is in the request cache.
|
void |
configure(org.springframework.security.config.annotation.web.builders.HttpSecurity http) |
SpringSocialConfigurer |
postFailureUrl(String postFailureUrl)
Sets the URL to land on after a failed login.
|
SpringSocialConfigurer |
postLoginUrl(String postLoginUrl)
Sets the URL to land on after a successful login.
|
SpringSocialConfigurer |
userIdSource(UserIdSource userIdSource)
Sets the
UserIdSource to use for authentication. |
public SpringSocialConfigurer()
UsersConnectionRepository
, SocialAuthenticationServiceLocator
, and
SocialUserDetailsService
beans be available in the application context.public void configure(org.springframework.security.config.annotation.web.builders.HttpSecurity http) throws Exception
configure
in interface org.springframework.security.config.annotation.SecurityConfigurer<org.springframework.security.web.DefaultSecurityFilterChain,org.springframework.security.config.annotation.web.builders.HttpSecurity>
configure
in class org.springframework.security.config.annotation.SecurityConfigurerAdapter<org.springframework.security.web.DefaultSecurityFilterChain,org.springframework.security.config.annotation.web.builders.HttpSecurity>
Exception
public SpringSocialConfigurer userIdSource(UserIdSource userIdSource)
UserIdSource
to use for authentication. Defaults to AuthenticationNameUserIdSource
.public SpringSocialConfigurer postLoginUrl(String postLoginUrl)
public SpringSocialConfigurer alwaysUsePostLoginUrl(boolean alwaysUsePostLoginUrl)
public SpringSocialConfigurer postFailureUrl(String postFailureUrl)