Преглед изворни кода

Fix CAS packages for 4.0.1 and Jasig references

Issue gh-11674
hdeadman пре 2 година
родитељ
комит
e0284a4503
30 измењених фајлова са 78 додато и 80 уклоњено
  1. 1 1
      cas/spring-security-cas.gradle
  2. 1 1
      cas/src/main/java/org/springframework/security/cas/authentication/CasAssertionAuthenticationToken.java
  3. 3 3
      cas/src/main/java/org/springframework/security/cas/authentication/CasAuthenticationProvider.java
  4. 1 1
      cas/src/main/java/org/springframework/security/cas/authentication/CasAuthenticationToken.java
  5. 1 1
      cas/src/main/java/org/springframework/security/cas/authentication/SpringCacheBasedTicketCache.java
  6. 1 1
      cas/src/main/java/org/springframework/security/cas/authentication/package-info.java
  7. 4 4
      cas/src/main/java/org/springframework/security/cas/jackson2/AssertionImplMixin.java
  8. 5 5
      cas/src/main/java/org/springframework/security/cas/jackson2/AttributePrincipalImplMixin.java
  9. 2 2
      cas/src/main/java/org/springframework/security/cas/jackson2/CasAuthenticationTokenMixin.java
  10. 3 3
      cas/src/main/java/org/springframework/security/cas/jackson2/CasJackson2Module.java
  11. 3 3
      cas/src/main/java/org/springframework/security/cas/package-info.java
  12. 1 1
      cas/src/main/java/org/springframework/security/cas/userdetails/AbstractCasAssertionUserDetailsService.java
  13. 1 1
      cas/src/main/java/org/springframework/security/cas/userdetails/GrantedAuthorityFromAssertionAttributesUserDetailsService.java
  14. 1 2
      cas/src/main/java/org/springframework/security/cas/web/CasAuthenticationEntryPoint.java
  15. 5 6
      cas/src/main/java/org/springframework/security/cas/web/CasAuthenticationFilter.java
  16. 1 1
      cas/src/main/java/org/springframework/security/cas/web/authentication/DefaultServiceAuthenticationDetails.java
  17. 1 1
      cas/src/main/java/org/springframework/security/cas/web/authentication/ServiceAuthenticationDetails.java
  18. 1 1
      cas/src/main/java/org/springframework/security/cas/web/authentication/ServiceAuthenticationDetailsSource.java
  19. 1 1
      cas/src/main/java/org/springframework/security/cas/web/authentication/package-info.java
  20. 1 1
      cas/src/main/java/org/springframework/security/cas/web/package-info.java
  21. 3 3
      cas/src/test/java/org/springframework/security/cas/authentication/AbstractStatelessTicketCacheTests.java
  22. 3 3
      cas/src/test/java/org/springframework/security/cas/authentication/CasAuthenticationProviderTests.java
  23. 2 2
      cas/src/test/java/org/springframework/security/cas/authentication/CasAuthenticationTokenTests.java
  24. 8 7
      cas/src/test/java/org/springframework/security/cas/jackson2/CasAuthenticationTokenMixinTests.java
  25. 3 3
      cas/src/test/java/org/springframework/security/cas/userdetails/GrantedAuthorityFromAssertionAttributesUserDetailsServiceTests.java
  26. 4 5
      cas/src/test/java/org/springframework/security/cas/web/CasAuthenticationFilterTests.java
  27. 1 1
      cas/src/test/java/org/springframework/security/cas/web/authentication/DefaultServiceAuthenticationDetailsTests.java
  28. 7 7
      config/src/test/java/org/springframework/security/config/annotation/web/builders/HttpConfigurationTests.java
  29. 1 1
      dependencies/spring-security-dependencies.gradle
  30. 8 8
      docs/modules/ROOT/pages/servlet/authentication/cas.adoc

+ 1 - 1
cas/spring-security-cas.gradle

@@ -4,7 +4,7 @@ dependencies {
 	management platform(project(":spring-security-dependencies"))
 	api project(':spring-security-core')
 	api project(':spring-security-web')
-	api 'org.jasig.cas.client:cas-client-core'
+	api 'org.apereo.cas.client:cas-client-core'
 	api 'org.springframework:spring-beans'
 	api 'org.springframework:spring-context'
 	api 'org.springframework:spring-core'

+ 1 - 1
cas/src/main/java/org/springframework/security/cas/authentication/CasAssertionAuthenticationToken.java

@@ -18,7 +18,7 @@ package org.springframework.security.cas.authentication;
 
 import java.util.ArrayList;
 
-import org.jasig.cas.client.validation.Assertion;
+import org.apereo.cas.client.validation.Assertion;
 
 import org.springframework.security.authentication.AbstractAuthenticationToken;
 import org.springframework.security.core.SpringSecurityCoreVersion;

+ 3 - 3
cas/src/main/java/org/springframework/security/cas/authentication/CasAuthenticationProvider.java

@@ -18,9 +18,9 @@ package org.springframework.security.cas.authentication;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.jasig.cas.client.validation.Assertion;
-import org.jasig.cas.client.validation.TicketValidationException;
-import org.jasig.cas.client.validation.TicketValidator;
+import org.apereo.cas.client.validation.Assertion;
+import org.apereo.cas.client.validation.TicketValidationException;
+import org.apereo.cas.client.validation.TicketValidator;
 
 import org.springframework.beans.factory.InitializingBean;
 import org.springframework.context.MessageSource;

+ 1 - 1
cas/src/main/java/org/springframework/security/cas/authentication/CasAuthenticationToken.java

@@ -19,7 +19,7 @@ package org.springframework.security.cas.authentication;
 import java.io.Serializable;
 import java.util.Collection;
 
-import org.jasig.cas.client.validation.Assertion;
+import org.apereo.cas.client.validation.Assertion;
 
 import org.springframework.security.authentication.AbstractAuthenticationToken;
 import org.springframework.security.core.GrantedAuthority;

+ 1 - 1
cas/src/main/java/org/springframework/security/cas/authentication/SpringCacheBasedTicketCache.java

@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2013 the original author or authors.
+ * Copyright 2002-2023 the original author or authors.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.

+ 1 - 1
cas/src/main/java/org/springframework/security/cas/authentication/package-info.java

@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2016 the original author or authors.
+ * Copyright 2002-2023 the original author or authors.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.

+ 4 - 4
cas/src/main/java/org/springframework/security/cas/jackson2/AssertionImplMixin.java

@@ -1,5 +1,5 @@
 /*
- * Copyright 2015-2016 the original author or authors.
+ * Copyright 2015-2023 the original author or authors.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -24,11 +24,11 @@ import com.fasterxml.jackson.annotation.JsonCreator;
 import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
 import com.fasterxml.jackson.annotation.JsonProperty;
 import com.fasterxml.jackson.annotation.JsonTypeInfo;
-import org.jasig.cas.client.authentication.AttributePrincipal;
+import org.apereo.cas.client.authentication.AttributePrincipal;
 
 /**
  * Helps in jackson deserialization of class
- * {@link org.jasig.cas.client.validation.AssertionImpl}, which is used with
+ * {@link org.apereo.cas.client.validation.AssertionImpl}, which is used with
  * {@link org.springframework.security.cas.authentication.CasAuthenticationToken}. To use
  * this class we need to register with
  * {@link com.fasterxml.jackson.databind.ObjectMapper}. Type information will be stored
@@ -52,7 +52,7 @@ class AssertionImplMixin {
 
 	/**
 	 * Mixin Constructor helps in deserialize
-	 * {@link org.jasig.cas.client.validation.AssertionImpl}
+	 * {@link org.apereo.cas.client.validation.AssertionImpl}
 	 * @param principal the Principal to associate with the Assertion.
 	 * @param validFromDate when the assertion is valid from.
 	 * @param validUntilDate when the assertion is valid to.

+ 5 - 5
cas/src/main/java/org/springframework/security/cas/jackson2/AttributePrincipalImplMixin.java

@@ -1,5 +1,5 @@
 /*
- * Copyright 2015-2016 the original author or authors.
+ * Copyright 2015-2023 the original author or authors.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -23,11 +23,11 @@ import com.fasterxml.jackson.annotation.JsonCreator;
 import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
 import com.fasterxml.jackson.annotation.JsonProperty;
 import com.fasterxml.jackson.annotation.JsonTypeInfo;
-import org.jasig.cas.client.proxy.ProxyRetriever;
+import org.apereo.cas.client.proxy.ProxyRetriever;
 
 /**
- * Helps in deserialize {@link org.jasig.cas.client.authentication.AttributePrincipalImpl}
- * which is used with
+ * Helps in deserialize
+ * {@link org.apereo.cas.client.authentication.AttributePrincipalImpl} which is used with
  * {@link org.springframework.security.cas.authentication.CasAuthenticationToken}. Type
  * information will be stored in property named @class.
  * <p>
@@ -49,7 +49,7 @@ class AttributePrincipalImplMixin {
 
 	/**
 	 * Mixin Constructor helps in deserialize
-	 * {@link org.jasig.cas.client.authentication.AttributePrincipalImpl}
+	 * {@link org.apereo.cas.client.authentication.AttributePrincipalImpl}
 	 * @param name the unique identifier for the principal.
 	 * @param attributes the key/value pairs for this principal.
 	 * @param proxyGrantingTicket the ticket associated with this principal.

+ 2 - 2
cas/src/main/java/org/springframework/security/cas/jackson2/CasAuthenticationTokenMixin.java

@@ -1,5 +1,5 @@
 /*
- * Copyright 2015-2016 the original author or authors.
+ * Copyright 2015-2023 the original author or authors.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -23,7 +23,7 @@ import com.fasterxml.jackson.annotation.JsonCreator;
 import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
 import com.fasterxml.jackson.annotation.JsonProperty;
 import com.fasterxml.jackson.annotation.JsonTypeInfo;
-import org.jasig.cas.client.validation.Assertion;
+import org.apereo.cas.client.validation.Assertion;
 
 import org.springframework.security.cas.authentication.CasAuthenticationProvider;
 import org.springframework.security.cas.authentication.CasAuthenticationToken;

+ 3 - 3
cas/src/main/java/org/springframework/security/cas/jackson2/CasJackson2Module.java

@@ -1,5 +1,5 @@
 /*
- * Copyright 2015-2016 the original author or authors.
+ * Copyright 2015-2023 the original author or authors.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -18,8 +18,8 @@ package org.springframework.security.cas.jackson2;
 
 import com.fasterxml.jackson.core.Version;
 import com.fasterxml.jackson.databind.module.SimpleModule;
-import org.jasig.cas.client.authentication.AttributePrincipalImpl;
-import org.jasig.cas.client.validation.AssertionImpl;
+import org.apereo.cas.client.authentication.AttributePrincipalImpl;
+import org.apereo.cas.client.validation.AssertionImpl;
 
 import org.springframework.security.cas.authentication.CasAuthenticationToken;
 import org.springframework.security.jackson2.SecurityJackson2Modules;

+ 3 - 3
cas/src/main/java/org/springframework/security/cas/package-info.java

@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2016 the original author or authors.
+ * Copyright 2002-2023 the original author or authors.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -15,7 +15,7 @@
  */
 
 /**
- * Spring Security support for Jasig's Central Authentication Service
- * (<a href="https://www.jasig.org/cas">CAS</a>).
+ * Spring Security support for Apereo's Central Authentication Service
+ * (<a href="https://github.com/apereo/cas">CAS</a>).
  */
 package org.springframework.security.cas;

+ 1 - 1
cas/src/main/java/org/springframework/security/cas/userdetails/AbstractCasAssertionUserDetailsService.java

@@ -16,7 +16,7 @@
 
 package org.springframework.security.cas.userdetails;
 
-import org.jasig.cas.client.validation.Assertion;
+import org.apereo.cas.client.validation.Assertion;
 
 import org.springframework.security.cas.authentication.CasAssertionAuthenticationToken;
 import org.springframework.security.core.userdetails.AuthenticationUserDetailsService;

+ 1 - 1
cas/src/main/java/org/springframework/security/cas/userdetails/GrantedAuthorityFromAssertionAttributesUserDetailsService.java

@@ -19,7 +19,7 @@ package org.springframework.security.cas.userdetails;
 import java.util.ArrayList;
 import java.util.List;
 
-import org.jasig.cas.client.validation.Assertion;
+import org.apereo.cas.client.validation.Assertion;
 
 import org.springframework.security.core.GrantedAuthority;
 import org.springframework.security.core.authority.SimpleGrantedAuthority;

+ 1 - 2
cas/src/main/java/org/springframework/security/cas/web/CasAuthenticationEntryPoint.java

@@ -20,8 +20,7 @@ import java.io.IOException;
 
 import jakarta.servlet.http.HttpServletRequest;
 import jakarta.servlet.http.HttpServletResponse;
-
-import org.jasig.cas.client.util.CommonUtils;
+import org.apereo.cas.client.util.CommonUtils;
 
 import org.springframework.beans.factory.InitializingBean;
 import org.springframework.security.cas.ServiceProperties;

+ 5 - 6
cas/src/main/java/org/springframework/security/cas/web/CasAuthenticationFilter.java

@@ -22,10 +22,9 @@ import jakarta.servlet.FilterChain;
 import jakarta.servlet.ServletException;
 import jakarta.servlet.http.HttpServletRequest;
 import jakarta.servlet.http.HttpServletResponse;
-
-import org.jasig.cas.client.proxy.ProxyGrantingTicketStorage;
-import org.jasig.cas.client.util.CommonUtils;
-import org.jasig.cas.client.validation.TicketValidator;
+import org.apereo.cas.client.proxy.ProxyGrantingTicketStorage;
+import org.apereo.cas.client.util.CommonUtils;
+import org.apereo.cas.client.validation.TicketValidator;
 
 import org.springframework.core.log.LogMessage;
 import org.springframework.security.authentication.AnonymousAuthenticationToken;
@@ -133,7 +132,7 @@ import org.springframework.util.Assert;
  *     NOTE: In a real application you should not use an in memory implementation. You will also want
  *           to ensure to clean up expired tickets by calling ProxyGrantingTicketStorage.cleanup()
  *  --&gt;
- * &lt;b:bean id=&quot;pgtStorage&quot; class=&quot;org.jasig.cas.client.proxy.ProxyGrantingTicketStorageImpl&quot;/&gt;
+ * &lt;b:bean id=&quot;pgtStorage&quot; class=&quot;org.apereo.cas.client.proxy.ProxyGrantingTicketStorageImpl&quot;/&gt;
  * &lt;b:bean id=&quot;casAuthProvider&quot; class=&quot;org.springframework.security.cas.authentication.CasAuthenticationProvider&quot;
  *     p:serviceProperties-ref=&quot;serviceProperties&quot;
  *     p:key=&quot;casAuthProviderKey&quot;&gt;
@@ -145,7 +144,7 @@ import org.springframework.util.Assert;
  *     &lt;/b:property&gt;
  *     &lt;b:property name=&quot;ticketValidator&quot;&gt;
  *         &lt;b:bean
- *             class=&quot;org.jasig.cas.client.validation.Cas20ProxyTicketValidator&quot;
+ *             class=&quot;org.apereo.cas.client.validation.Cas20ProxyTicketValidator&quot;
  *             p:acceptAnyProxy=&quot;true&quot;
  *             p:proxyCallbackUrl=&quot;https://service.example.com/cas-sample/login/cas/proxyreceptor&quot;
  *             p:proxyGrantingTicketStorage-ref=&quot;pgtStorage&quot;&gt;

+ 1 - 1
cas/src/main/java/org/springframework/security/cas/web/authentication/DefaultServiceAuthenticationDetails.java

@@ -1,5 +1,5 @@
 /*
- * Copyright 2011-2016 the original author or authors.
+ * Copyright 2011-2023 the original author or authors.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.

+ 1 - 1
cas/src/main/java/org/springframework/security/cas/web/authentication/ServiceAuthenticationDetails.java

@@ -1,5 +1,5 @@
 /*
- * Copyright 2011-2016 the original author or authors.
+ * Copyright 2011-2023 the original author or authors.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.

+ 1 - 1
cas/src/main/java/org/springframework/security/cas/web/authentication/ServiceAuthenticationDetailsSource.java

@@ -1,5 +1,5 @@
 /*
- * Copyright 2011-2016 the original author or authors.
+ * Copyright 2011-2023 the original author or authors.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.

+ 1 - 1
cas/src/main/java/org/springframework/security/cas/web/authentication/package-info.java

@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2016 the original author or authors.
+ * Copyright 2002-2023 the original author or authors.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.

+ 1 - 1
cas/src/main/java/org/springframework/security/cas/web/package-info.java

@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2016 the original author or authors.
+ * Copyright 2002-2023 the original author or authors.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.

+ 3 - 3
cas/src/test/java/org/springframework/security/cas/authentication/AbstractStatelessTicketCacheTests.java

@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2016 the original author or authors.
+ * Copyright 2002-2023 the original author or authors.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -19,8 +19,8 @@ package org.springframework.security.cas.authentication;
 import java.util.ArrayList;
 import java.util.List;
 
-import org.jasig.cas.client.validation.Assertion;
-import org.jasig.cas.client.validation.AssertionImpl;
+import org.apereo.cas.client.validation.Assertion;
+import org.apereo.cas.client.validation.AssertionImpl;
 
 import org.springframework.security.core.authority.AuthorityUtils;
 import org.springframework.security.core.userdetails.User;

+ 3 - 3
cas/src/test/java/org/springframework/security/cas/authentication/CasAuthenticationProviderTests.java

@@ -19,9 +19,9 @@ package org.springframework.security.cas.authentication;
 import java.util.HashMap;
 import java.util.Map;
 
-import org.jasig.cas.client.validation.Assertion;
-import org.jasig.cas.client.validation.AssertionImpl;
-import org.jasig.cas.client.validation.TicketValidator;
+import org.apereo.cas.client.validation.Assertion;
+import org.apereo.cas.client.validation.AssertionImpl;
+import org.apereo.cas.client.validation.TicketValidator;
 import org.junit.jupiter.api.Test;
 
 import org.springframework.mock.web.MockHttpServletRequest;

+ 2 - 2
cas/src/test/java/org/springframework/security/cas/authentication/CasAuthenticationTokenTests.java

@@ -19,8 +19,8 @@ package org.springframework.security.cas.authentication;
 import java.util.Collections;
 import java.util.List;
 
-import org.jasig.cas.client.validation.Assertion;
-import org.jasig.cas.client.validation.AssertionImpl;
+import org.apereo.cas.client.validation.Assertion;
+import org.apereo.cas.client.validation.AssertionImpl;
 import org.junit.jupiter.api.Test;
 
 import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;

+ 8 - 7
cas/src/test/java/org/springframework/security/cas/jackson2/CasAuthenticationTokenMixinTests.java

@@ -1,5 +1,5 @@
 /*
- * Copyright 2015-2016 the original author or authors.
+ * Copyright 2015-2023 the original author or authors.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -23,9 +23,9 @@ import java.util.Date;
 
 import com.fasterxml.jackson.core.JsonProcessingException;
 import com.fasterxml.jackson.databind.ObjectMapper;
-import org.jasig.cas.client.authentication.AttributePrincipalImpl;
-import org.jasig.cas.client.validation.Assertion;
-import org.jasig.cas.client.validation.AssertionImpl;
+import org.apereo.cas.client.authentication.AttributePrincipalImpl;
+import org.apereo.cas.client.validation.Assertion;
+import org.apereo.cas.client.validation.AssertionImpl;
 import org.json.JSONException;
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
@@ -79,14 +79,15 @@ public class CasAuthenticationTokenMixinTests {
 			+ "\"keyHash\": " + KEY.hashCode() + "," + "\"principal\": " + USER_JSON + ", " + "\"credentials\": "
 			+ PASSWORD + ", " + "\"authorities\": " + AUTHORITIES_ARRAYLIST_JSON + "," + "\"userDetails\": " + USER_JSON
 			+ "," + "\"authenticated\": true, " + "\"details\": null," + "\"assertion\": {"
-			+ "\"@class\": \"org.jasig.cas.client.validation.AssertionImpl\", " + "\"principal\": {"
-			+ "\"@class\": \"org.jasig.cas.client.authentication.AttributePrincipalImpl\", "
+			+ "\"@class\": \"org.apereo.cas.client.validation.AssertionImpl\", " + "\"principal\": {"
+			+ "\"@class\": \"org.apereo.cas.client.authentication.AttributePrincipalImpl\", "
 			+ "\"name\": \"assertName\", " + "\"attributes\": {\"@class\": \"java.util.Collections$EmptyMap\"}, "
 			+ "\"proxyGrantingTicket\": null, " + "\"proxyRetriever\": null" + "}, "
 			+ "\"validFromDate\": [\"java.util.Date\", " + START_DATE.getTime() + "], "
 			+ "\"validUntilDate\": [\"java.util.Date\", " + END_DATE.getTime() + "],"
 			+ "\"authenticationDate\": [\"java.util.Date\", " + START_DATE.getTime() + "], "
-			+ "\"attributes\": {\"@class\": \"java.util.Collections$EmptyMap\"}" + "}" + "}";
+			+ "\"attributes\": {\"@class\": \"java.util.Collections$EmptyMap\"},"
+			+ "\"context\": {\"@class\":\"java.util.HashMap\"}" + "}" + "}";
 
 	private static final String CAS_TOKEN_CLEARED_JSON = CAS_TOKEN_JSON.replaceFirst(PASSWORD, "null");
 

+ 3 - 3
cas/src/test/java/org/springframework/security/cas/userdetails/GrantedAuthorityFromAssertionAttributesUserDetailsServiceTests.java

@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2017 the original author or authors.
+ * Copyright 2002-2023 the original author or authors.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -21,8 +21,8 @@ import java.util.HashMap;
 import java.util.Map;
 import java.util.Set;
 
-import org.jasig.cas.client.authentication.AttributePrincipal;
-import org.jasig.cas.client.validation.Assertion;
+import org.apereo.cas.client.authentication.AttributePrincipal;
+import org.apereo.cas.client.validation.Assertion;
 import org.junit.jupiter.api.Test;
 
 import org.springframework.security.cas.authentication.CasAssertionAuthenticationToken;

+ 4 - 5
cas/src/test/java/org/springframework/security/cas/web/CasAuthenticationFilterTests.java

@@ -17,8 +17,7 @@
 package org.springframework.security.cas.web;
 
 import jakarta.servlet.FilterChain;
-
-import org.jasig.cas.client.proxy.ProxyGrantingTicketStorage;
+import org.apereo.cas.client.proxy.ProxyGrantingTicketStorage;
 import org.junit.jupiter.api.AfterEach;
 import org.junit.jupiter.api.Test;
 
@@ -41,8 +40,8 @@ import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.BDDMockito.given;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.verifyNoInteractions;
 import static org.mockito.Mockito.verifyNoMoreInteractions;
-import static org.mockito.Mockito.verifyZeroInteractions;
 
 /**
  * Tests {@link CasAuthenticationFilter}.
@@ -173,7 +172,7 @@ public class CasAuthenticationFilterTests {
 		assertThat(SecurityContextHolder.getContext().getAuthentication()).isNotNull()
 				.withFailMessage("Authentication should not be null");
 		verify(chain).doFilter(request, response);
-		verifyZeroInteractions(successHandler);
+		verifyNoInteractions(successHandler);
 		// validate for when the filterProcessUrl matches
 		filter.setFilterProcessesUrl(request.getServletPath());
 		SecurityContextHolder.clearContext();
@@ -193,7 +192,7 @@ public class CasAuthenticationFilterTests {
 		filter.setProxyGrantingTicketStorage(mock(ProxyGrantingTicketStorage.class));
 		filter.setProxyReceptorUrl(request.getServletPath());
 		filter.doFilter(request, response, chain);
-		verifyZeroInteractions(chain);
+		verifyNoInteractions(chain);
 	}
 
 }

+ 1 - 1
cas/src/test/java/org/springframework/security/cas/web/authentication/DefaultServiceAuthenticationDetailsTests.java

@@ -1,5 +1,5 @@
 /*
- * Copyright 2011-2016 the original author or authors.
+ * Copyright 2011-2023 the original author or authors.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.

+ 7 - 7
config/src/test/java/org/springframework/security/config/annotation/web/builders/HttpConfigurationTests.java

@@ -32,7 +32,6 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
 import org.springframework.security.cas.web.CasAuthenticationFilter;
-import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
 import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
 import org.springframework.security.config.test.SpringTestContext;
 import org.springframework.security.config.test.SpringTestContextExtension;
@@ -125,18 +124,19 @@ public class HttpConfigurationTests {
 	}
 
 	@EnableWebSecurity
-	static class CasAuthenticationFilterConfig extends WebSecurityConfigurerAdapter {
+	static class CasAuthenticationFilterConfig {
 
-		static CasAuthenticationFilter CAS_AUTHENTICATION_FILTER;
-
-		@Override
-		protected void configure(HttpSecurity http) {
+		@Bean
+		SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
 			// @formatter:off
 			http
-				.addFilter(CAS_AUTHENTICATION_FILTER);
+					.addFilter(CAS_AUTHENTICATION_FILTER);
 			// @formatter:on
+			return http.build();
 		}
 
+		static CasAuthenticationFilter CAS_AUTHENTICATION_FILTER;
+
 	}
 
 	@Configuration

+ 1 - 1
dependencies/spring-security-dependencies.gradle

@@ -57,7 +57,7 @@ dependencies {
 		api "org.hamcrest:hamcrest:2.2"
 		api "org.hibernate.orm:hibernate-core:6.1.5.Final"
 		api "org.hsqldb:hsqldb:2.7.1"
-		api "org.jasig.cas.client:cas-client-core:3.6.4"
+		api "org.apereo.cas.client:cas-client-core:4.0.1"
 		api "org.opensaml:opensaml-core:$openSamlVersion"
 		api "org.opensaml:opensaml-saml-api:$openSamlVersion"
 		api "org.opensaml:opensaml-saml-impl:$openSamlVersion"

+ 8 - 8
docs/modules/ROOT/pages/servlet/authentication/cas.adoc

@@ -163,7 +163,7 @@ Next you need to add a `CasAuthenticationProvider` and its collaborators:
 </property>
 <property name="serviceProperties" ref="serviceProperties" />
 <property name="ticketValidator">
-	<bean class="org.jasig.cas.client.validation.Cas20ServiceTicketValidator">
+	<bean class="org.apereo.cas.client.validation.Cas20ServiceTicketValidator">
 	<constructor-arg index="0" value="https://localhost:9443/cas" />
 	</bean>
 </property>
@@ -208,7 +208,7 @@ Below are updates to the Spring Security configuration that handle Single Logout
 </security:http>
 
 <!-- This filter handles a Single Logout Request from the CAS Server -->
-<bean id="singleLogoutFilter" class="org.jasig.cas.client.session.SingleSignOutFilter"/>
+<bean id="singleLogoutFilter" class="org.apereo.cas.client.session.SingleSignOutFilter"/>
 
 <!-- This filter redirects to the CAS Server to signal Single Logout should be performed -->
 <bean id="requestSingleLogoutFilter"
@@ -235,7 +235,7 @@ With the configuration above, the flow of logout would be:
 * The logout success page, `/cas-logout.jsp`, should instruct the user to click a link pointing to `/logout/cas` in order to logout out of all applications.
 * When the user clicks the link, the user is redirected to the CAS single logout URL (https://localhost:9443/cas/logout).
 * On the CAS Server side, the CAS single logout URL then submits single logout requests to all the CAS Services.
-On the CAS Service side, JASIG's `SingleSignOutFilter` processes the logout request by invalidating the original session.
+On the CAS Service side, Apereo's `SingleSignOutFilter` processes the logout request by invalidating the original session.
 
 
 
@@ -259,14 +259,14 @@ The next step is to add the following to your web.xml
 </filter-mapping>
 <listener>
 <listener-class>
-	org.jasig.cas.client.session.SingleSignOutHttpSessionListener
+	org.apereo.cas.client.session.SingleSignOutHttpSessionListener
 </listener-class>
 </listener>
 ----
 
 When using the SingleSignOutFilter you might encounter some encoding issues.
 Therefore it is recommended to add the `CharacterEncodingFilter` to ensure that the character encoding is correct when using the `SingleSignOutFilter`.
-Again, refer to JASIG's documentation for details.
+Again, refer to Apereo CAS's documentation for details.
 The `SingleSignOutHttpSessionListener` ensures that when an `HttpSession` expires, the mapping used for single logout is removed.
 
 
@@ -293,7 +293,7 @@ NOTE: In a real application you should not use an in memory implementation.
 You will also want to ensure to clean up expired tickets by calling
 ProxyGrantingTicketStorage.cleanup()
 -->
-<bean id="pgtStorage" class="org.jasig.cas.client.proxy.ProxyGrantingTicketStorageImpl"/>
+<bean id="pgtStorage" class="org.apereo.cas.client.proxy.ProxyGrantingTicketStorageImpl"/>
 ----
 
 The next step is to update the `CasAuthenticationProvider` to be able to obtain proxy tickets.
@@ -308,7 +308,7 @@ You can find an example of the configuration changes that should be made below.
 	class="org.springframework.security.cas.authentication.CasAuthenticationProvider">
 ...
 <property name="ticketValidator">
-	<bean class="org.jasig.cas.client.validation.Cas20ProxyTicketValidator">
+	<bean class="org.apereo.cas.client.validation.Cas20ProxyTicketValidator">
 	<constructor-arg value="https://localhost:9443/cas"/>
 		<property name="proxyCallbackUrl"
 		value="https://localhost:8443/cas-sample/login/cas/proxyreceptor"/>
@@ -439,7 +439,7 @@ You can find an example of the updates required to accept all proxies below.
 	class="org.springframework.security.cas.authentication.CasAuthenticationProvider">
 ...
 <property name="ticketValidator">
-	<bean class="org.jasig.cas.client.validation.Cas20ProxyTicketValidator">
+	<bean class="org.apereo.cas.client.validation.Cas20ProxyTicketValidator">
 	<constructor-arg value="https://localhost:9443/cas"/>
 	<property name="acceptAnyProxy" value="true"/>
 	</bean>