Skip to content

Commit

Permalink
Add setter method for userDetailsChecker in CasAuthenticationProvider(#…
Browse files Browse the repository at this point in the history
…10277)

This commit introduces a setter method for the userDetailsChecker property in the CasAuthenticationProvider class. Previously, the userDetailsChecker was initialized with a default AccountStatusUserDetailsChecker instance, limiting customization options. Now, users can inject their own UserDetailsChecker implementation through the setter method, providing greater flexibility in handling user details validation.
  • Loading branch information
Kyoungwoong committed May 12, 2024
1 parent 746ee27 commit b0e87b3
Showing 1 changed file with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2004, 2005, 2006 Acegi Technology Pty Limited
* Copyright 2004, 2005, 2006, 2024 Acegi Technology Pty Limited
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -56,14 +56,15 @@
*
* @author Ben Alex
* @author Scott Battaglia
* @author Kim Youngwoong
*/
public class CasAuthenticationProvider implements AuthenticationProvider, InitializingBean, MessageSourceAware {

private static final Log logger = LogFactory.getLog(CasAuthenticationProvider.class);

private AuthenticationUserDetailsService<CasAssertionAuthenticationToken> authenticationUserDetailsService;

private final UserDetailsChecker userDetailsChecker = new AccountStatusUserDetailsChecker();
private UserDetailsChecker userDetailsChecker = new AccountStatusUserDetailsChecker();

protected MessageSourceAccessor messages = SpringSecurityMessageSource.getAccessor();

Expand Down Expand Up @@ -187,6 +188,16 @@ public void setAuthenticationUserDetailsService(
this.authenticationUserDetailsService = authenticationUserDetailsService;
}

/**
* Sets the UserDetailsChecker to be used for checking the status of retrieved user details.
* This allows customization of the UserDetailsChecker implementation.
*
* @param userDetailsChecker the UserDetailsChecker to be set
*/
public void setUserDetailsChecker(UserDetailsChecker userDetailsChecker) {
this.userDetailsChecker = userDetailsChecker;
}

public void setServiceProperties(final ServiceProperties serviceProperties) {
this.serviceProperties = serviceProperties;
}
Expand Down

0 comments on commit b0e87b3

Please sign in to comment.