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 |
connectionAddedRedirectUrl(String connectionAddedRedirectUrl)
Sets the URL to land on after an a connection was added.
|
SpringSocialConfigurer |
defaultFailureUrl(String defaultFailureUrl)
Sets the URL to redirect to if authentication fails or if authorization is denied by the user.
|
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 |
signupUrl(String signupUrl)
Sets the URL to land on after an authentication failure so that the user can register with the application.
|
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>Exceptionpublic SpringSocialConfigurer userIdSource(UserIdSource userIdSource)
UserIdSource to use for authentication. Defaults to AuthenticationNameUserIdSource.userIdSource - the UserIdSource to use when authenticatingpublic SpringSocialConfigurer postLoginUrl(String postLoginUrl)
postLoginUrl - the URL to redirect to after a successful loginpublic SpringSocialConfigurer alwaysUsePostLoginUrl(boolean alwaysUsePostLoginUrl)
alwaysUsePostLoginUrl - if true, always redirect to the postLoginUrlpublic SpringSocialConfigurer postFailureUrl(String postFailureUrl)
postFailureUrl - the URL to redirect to after a failed loginpublic SpringSocialConfigurer signupUrl(String signupUrl)
signupUrl - the URL to redirect to after an authentication failurepublic SpringSocialConfigurer connectionAddedRedirectUrl(String connectionAddedRedirectUrl)
connectionAddedRedirectUrl - the URL to redirect after a connection was addedpublic SpringSocialConfigurer defaultFailureUrl(String defaultFailureUrl)
defaultFailureUrl - the URL to redirect to after an authentication fail or authorization deny