Skip to content

Commit

Permalink
only one failure url in SpringSocialConfigurer, fixec javadoc param name
Browse files Browse the repository at this point in the history
  • Loading branch information
sfussenegger committed Dec 8, 2015
1 parent fd6558b commit d4d91b2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ public void setAlwaysUsePostLoginUrl(boolean alwaysUsePostLoginUrl) {

/**
* The URL to redirect to if authentication fails or if authorization is denied by the user.
* @param defaultFailureUrl The failure URL. Defaults to "/signin" (relative to the servlet context).
* @param postFailureUrl The failure URL. Defaults to "/signin" (relative to the servlet context).
*/
public void setPostFailureUrl(String postFailureUrl) {
AuthenticationFailureHandler failureHandler = getFailureHandler();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,6 @@ public class SpringSocialConfigurer extends SecurityConfigurerAdapter<DefaultSec

private String connectionAddedRedirectUrl;

private String defaultFailureUrl;

private boolean alwaysUsePostLoginUrl = false;

/**
Expand Down Expand Up @@ -99,10 +97,6 @@ public void configure(HttpSecurity http) throws Exception {
if (connectionAddedRedirectUrl != null) {
filter.setConnectionAddedRedirectUrl(connectionAddedRedirectUrl);
}

if (defaultFailureUrl != null) {
filter.setDefaultFailureUrl(defaultFailureUrl);
}

http.authenticationProvider(
new SocialAuthenticationProvider(usersConnectionRepository, socialUsersDetailsService))
Expand Down Expand Up @@ -149,9 +143,9 @@ public SpringSocialConfigurer alwaysUsePostLoginUrl(boolean alwaysUsePostLoginUr
}

/**
* Sets the URL to land on after a failed login.
* @param postFailureUrl the URL to redirect to after a failed login
* @return this SpringSocialConfigurer for chained configuration
* Sets the URL to redirect to if authentication fails or if authorization is denied by the user.
* @param postFailureUrl the URL to redirect to after an authentication fail or authorization deny
* @return this SpringSocialConfigurer for chained configuration
*/
public SpringSocialConfigurer postFailureUrl(String postFailureUrl) {
this.postFailureUrl = postFailureUrl;
Expand Down Expand Up @@ -179,12 +173,11 @@ public SpringSocialConfigurer connectionAddedRedirectUrl(String connectionAddedR
}

/**
* Sets the URL to redirect to if authentication fails or if authorization is denied by the user.
* @param defaultFailureUrl the URL to redirect to after an authentication fail or authorization deny
* @return this SpringSocialConfigurer for chained configuration
* @deprecated use {@link #postFailureUrl(String)} instead
*/
@Deprecated
public SpringSocialConfigurer defaultFailureUrl(String defaultFailureUrl) {
this.defaultFailureUrl = defaultFailureUrl;
postFailureUrl(defaultFailureUrl);
return this;
}

Expand Down

0 comments on commit d4d91b2

Please sign in to comment.