diff --git a/cas/src/main/java/org/springframework/security/cas/authentication/CasAuthenticationProvider.java b/cas/src/main/java/org/springframework/security/cas/authentication/CasAuthenticationProvider.java index 5b390fe19be..cdf020f0d03 100644 --- a/cas/src/main/java/org/springframework/security/cas/authentication/CasAuthenticationProvider.java +++ b/cas/src/main/java/org/springframework/security/cas/authentication/CasAuthenticationProvider.java @@ -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. @@ -56,6 +56,7 @@ * * @author Ben Alex * @author Scott Battaglia + * @author Kim Youngwoong */ public class CasAuthenticationProvider implements AuthenticationProvider, InitializingBean, MessageSourceAware { @@ -63,7 +64,7 @@ public class CasAuthenticationProvider implements AuthenticationProvider, Initia private AuthenticationUserDetailsService authenticationUserDetailsService; - private final UserDetailsChecker userDetailsChecker = new AccountStatusUserDetailsChecker(); + private UserDetailsChecker userDetailsChecker = new AccountStatusUserDetailsChecker(); protected MessageSourceAccessor messages = SpringSecurityMessageSource.getAccessor(); @@ -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; }