diff --git a/.github/workflows/continuous-integration-workflow.yml b/.github/workflows/continuous-integration-workflow.yml
index f10dcdde5d6..7442161f9b6 100644
--- a/.github/workflows/continuous-integration-workflow.yml
+++ b/.github/workflows/continuous-integration-workflow.yml
@@ -28,8 +28,8 @@ jobs:
name: Determine if should continue
if: env.RUN_JOBS == 'true'
run: echo "::set-output name=runjobs::true"
- build_jdk_11:
- name: Build JDK 11
+ build_jdk_17:
+ name: Build JDK 17
needs: [prerequisites]
strategy:
matrix:
@@ -38,10 +38,10 @@ jobs:
if: needs.prerequisites.outputs.runjobs
steps:
- uses: actions/checkout@v2
- - name: Set up JDK 11
+ - name: Set up JDK 17
uses: actions/setup-java@v1
with:
- java-version: '11'
+ java-version: '17'
- name: Setup gradle user name
run: |
mkdir -p ~/.gradle
@@ -67,7 +67,7 @@ jobs:
- name: Set up JDK
uses: actions/setup-java@v1
with:
- java-version: '11'
+ java-version: '17'
- name: Setup gradle user name
run: |
mkdir -p ~/.gradle
@@ -88,7 +88,7 @@ jobs:
- name: Set up JDK
uses: actions/setup-java@v1
with:
- java-version: '11'
+ java-version: '17'
- name: Setup gradle user name
run: |
mkdir -p ~/.gradle
@@ -109,7 +109,7 @@ jobs:
- name: Set up JDK
uses: actions/setup-java@v1
with:
- java-version: '11'
+ java-version: '17'
- name: Setup gradle user name
run: |
mkdir -p ~/.gradle
@@ -122,14 +122,14 @@ jobs:
./gradlew check s101 --stacktrace
deploy_artifacts:
name: Deploy Artifacts
- needs: [build_jdk_11, snapshot_tests, check_samples, check_tangles]
+ needs: [build_jdk_17, snapshot_tests, check_samples, check_tangles]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK
uses: actions/setup-java@v1
with:
- java-version: '11'
+ java-version: '17'
- name: Setup gradle user name
run: |
mkdir -p ~/.gradle
@@ -149,14 +149,14 @@ jobs:
ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
deploy_docs:
name: Deploy Docs
- needs: [build_jdk_11, snapshot_tests, check_samples, check_tangles]
+ needs: [build_jdk_17, snapshot_tests, check_samples, check_tangles]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK
uses: actions/setup-java@v1
with:
- java-version: '11'
+ java-version: '17'
- name: Setup gradle user name
run: |
mkdir -p ~/.gradle
@@ -173,14 +173,14 @@ jobs:
DOCS_HOST: ${{ secrets.DOCS_HOST }}
deploy_schema:
name: Deploy Schema
- needs: [build_jdk_11, snapshot_tests, check_samples, check_tangles]
+ needs: [build_jdk_17, snapshot_tests, check_samples, check_tangles]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK
uses: actions/setup-java@v1
with:
- java-version: '11'
+ java-version: '17'
- name: Setup gradle user name
run: |
mkdir -p ~/.gradle
@@ -197,7 +197,7 @@ jobs:
DOCS_HOST: ${{ secrets.DOCS_HOST }}
notify_result:
name: Check for failures
- needs: [build_jdk_11, snapshot_tests, check_samples, check_tangles, deploy_artifacts, deploy_docs, deploy_schema]
+ needs: [build_jdk_17, snapshot_tests, check_samples, check_tangles, deploy_artifacts, deploy_docs, deploy_schema]
if: failure()
runs-on: ubuntu-latest
steps:
diff --git a/.github/workflows/pr-build-workflow.yml b/.github/workflows/pr-build-workflow.yml
index 0e7d5e7fdf0..d9a5c571343 100644
--- a/.github/workflows/pr-build-workflow.yml
+++ b/.github/workflows/pr-build-workflow.yml
@@ -16,7 +16,7 @@ jobs:
if: env.RUN_JOBS == 'true'
uses: actions/setup-java@v1
with:
- java-version: '11'
+ java-version: '17'
- name: Cache Gradle packages
if: env.RUN_JOBS == 'true'
uses: actions/cache@v2
diff --git a/README.adoc b/README.adoc
index 80d2f102e55..272b99ff6d0 100644
--- a/README.adoc
+++ b/README.adoc
@@ -6,8 +6,8 @@ image:https://img.shields.io/badge/Revved%20up%20by-Gradle%20Enterprise-06A0CE?l
= Spring Security
-Spring Security provides security services for the https://docs.spring.io[Spring IO Platform]. Spring Security 5.0 requires Spring 5.0 as
-a minimum and also requires Java 8.
+Spring Security provides security services for the https://docs.spring.io[Spring IO Platform]. Spring Security 6.0 requires Spring 6.0 as
+a minimum and also requires Java 17.
For a detailed list of features and access to the latest release, please visit https://spring.io/projects[Spring projects].
@@ -30,9 +30,9 @@ In the instructions below, https://vimeo.com/34436402[`./gradlew`] is invoked fr
a cross-platform, self-contained bootstrap mechanism for the build.
=== Prerequisites
-https://help.github.com/set-up-git-redirect[Git] and the https://www.oracle.com/technetwork/java/javase/downloads[JDK11 build].
+https://help.github.com/set-up-git-redirect[Git] and the https://www.oracle.com/technetwork/java/javase/downloads[JDK17 build].
-Be sure that your `JAVA_HOME` environment variable points to the `jdk-11` folder extracted from the JDK download.
+Be sure that your `JAVA_HOME` environment variable points to the `jdk-17` folder extracted from the JDK download.
=== Check out sources
[indent=0]
diff --git a/acl/spring-security-acl.gradle b/acl/spring-security-acl.gradle
index 8de65558b88..976d8d42dbc 100644
--- a/acl/spring-security-acl.gradle
+++ b/acl/spring-security-acl.gradle
@@ -9,8 +9,6 @@ dependencies {
api 'org.springframework:spring-jdbc'
api 'org.springframework:spring-tx'
- optional 'net.sf.ehcache:ehcache'
-
testImplementation "org.assertj:assertj-core"
testImplementation "org.junit.jupiter:junit-jupiter-api"
testImplementation "org.junit.jupiter:junit-jupiter-params"
diff --git a/acl/src/main/java/org/springframework/security/acls/domain/EhCacheBasedAclCache.java b/acl/src/main/java/org/springframework/security/acls/domain/EhCacheBasedAclCache.java
deleted file mode 100644
index 9ad106d7afe..00000000000
--- a/acl/src/main/java/org/springframework/security/acls/domain/EhCacheBasedAclCache.java
+++ /dev/null
@@ -1,141 +0,0 @@
-/*
- * Copyright 2004, 2005, 2006 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.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.security.acls.domain;
-
-import java.io.Serializable;
-
-import net.sf.ehcache.CacheException;
-import net.sf.ehcache.Ehcache;
-import net.sf.ehcache.Element;
-
-import org.springframework.security.acls.model.AclCache;
-import org.springframework.security.acls.model.MutableAcl;
-import org.springframework.security.acls.model.ObjectIdentity;
-import org.springframework.security.acls.model.PermissionGrantingStrategy;
-import org.springframework.security.util.FieldUtils;
-import org.springframework.util.Assert;
-
-/**
- * Simple implementation of {@link AclCache} that delegates to EH-CACHE.
- *
- * Designed to handle the transient fields in {@link AclImpl}. Note that this
- * implementation assumes all {@link AclImpl} instances share the same
- * {@link PermissionGrantingStrategy} and {@link AclAuthorizationStrategy} instances.
- *
- * @author Ben Alex
- * @deprecated since 5.6. In favor of JCache based implementations
- */
-@Deprecated
-public class EhCacheBasedAclCache implements AclCache {
-
- private final Ehcache cache;
-
- private PermissionGrantingStrategy permissionGrantingStrategy;
-
- private AclAuthorizationStrategy aclAuthorizationStrategy;
-
- public EhCacheBasedAclCache(Ehcache cache, PermissionGrantingStrategy permissionGrantingStrategy,
- AclAuthorizationStrategy aclAuthorizationStrategy) {
- Assert.notNull(cache, "Cache required");
- Assert.notNull(permissionGrantingStrategy, "PermissionGrantingStrategy required");
- Assert.notNull(aclAuthorizationStrategy, "AclAuthorizationStrategy required");
- this.cache = cache;
- this.permissionGrantingStrategy = permissionGrantingStrategy;
- this.aclAuthorizationStrategy = aclAuthorizationStrategy;
- }
-
- @Override
- public void evictFromCache(Serializable pk) {
- Assert.notNull(pk, "Primary key (identifier) required");
- MutableAcl acl = getFromCache(pk);
- if (acl != null) {
- this.cache.remove(acl.getId());
- this.cache.remove(acl.getObjectIdentity());
- }
- }
-
- @Override
- public void evictFromCache(ObjectIdentity objectIdentity) {
- Assert.notNull(objectIdentity, "ObjectIdentity required");
- MutableAcl acl = getFromCache(objectIdentity);
- if (acl != null) {
- this.cache.remove(acl.getId());
- this.cache.remove(acl.getObjectIdentity());
- }
- }
-
- @Override
- public MutableAcl getFromCache(ObjectIdentity objectIdentity) {
- Assert.notNull(objectIdentity, "ObjectIdentity required");
- try {
- Element element = this.cache.get(objectIdentity);
- return (element != null) ? initializeTransientFields((MutableAcl) element.getValue()) : null;
- }
- catch (CacheException ex) {
- return null;
- }
- }
-
- @Override
- public MutableAcl getFromCache(Serializable pk) {
- Assert.notNull(pk, "Primary key (identifier) required");
- try {
- Element element = this.cache.get(pk);
- return (element != null) ? initializeTransientFields((MutableAcl) element.getValue()) : null;
- }
- catch (CacheException ex) {
- return null;
- }
- }
-
- @Override
- public void putInCache(MutableAcl acl) {
- Assert.notNull(acl, "Acl required");
- Assert.notNull(acl.getObjectIdentity(), "ObjectIdentity required");
- Assert.notNull(acl.getId(), "ID required");
- if (this.aclAuthorizationStrategy == null) {
- if (acl instanceof AclImpl) {
- this.aclAuthorizationStrategy = (AclAuthorizationStrategy) FieldUtils
- .getProtectedFieldValue("aclAuthorizationStrategy", acl);
- this.permissionGrantingStrategy = (PermissionGrantingStrategy) FieldUtils
- .getProtectedFieldValue("permissionGrantingStrategy", acl);
- }
- }
- if ((acl.getParentAcl() != null) && (acl.getParentAcl() instanceof MutableAcl)) {
- putInCache((MutableAcl) acl.getParentAcl());
- }
- this.cache.put(new Element(acl.getObjectIdentity(), acl));
- this.cache.put(new Element(acl.getId(), acl));
- }
-
- private MutableAcl initializeTransientFields(MutableAcl value) {
- if (value instanceof AclImpl) {
- FieldUtils.setProtectedFieldValue("aclAuthorizationStrategy", value, this.aclAuthorizationStrategy);
- FieldUtils.setProtectedFieldValue("permissionGrantingStrategy", value, this.permissionGrantingStrategy);
- }
- if (value.getParentAcl() != null) {
- initializeTransientFields((MutableAcl) value.getParentAcl());
- }
- return value;
- }
-
- @Override
- public void clearCache() {
- this.cache.removeAll();
- }
-
-}
diff --git a/acl/src/test/java/org/springframework/security/acls/jdbc/AbstractBasicLookupStrategyTests.java b/acl/src/test/java/org/springframework/security/acls/jdbc/AbstractBasicLookupStrategyTests.java
index 4a6b1d695f6..9f3f8418ca6 100644
--- a/acl/src/test/java/org/springframework/security/acls/jdbc/AbstractBasicLookupStrategyTests.java
+++ b/acl/src/test/java/org/springframework/security/acls/jdbc/AbstractBasicLookupStrategyTests.java
@@ -16,6 +16,7 @@
package org.springframework.security.acls.jdbc;
+import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
@@ -23,15 +24,15 @@
import javax.sql.DataSource;
-import net.sf.ehcache.Cache;
-import net.sf.ehcache.CacheManager;
-import net.sf.ehcache.Ehcache;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
+import org.springframework.cache.Cache;
+import org.springframework.cache.CacheManager;
+import org.springframework.cache.concurrent.ConcurrentMapCache;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.security.acls.TargetObject;
import org.springframework.security.acls.TargetObjectWithUUID;
@@ -41,10 +42,10 @@
import org.springframework.security.acls.domain.ConsoleAuditLogger;
import org.springframework.security.acls.domain.DefaultPermissionFactory;
import org.springframework.security.acls.domain.DefaultPermissionGrantingStrategy;
-import org.springframework.security.acls.domain.EhCacheBasedAclCache;
import org.springframework.security.acls.domain.GrantedAuthoritySid;
import org.springframework.security.acls.domain.ObjectIdentityImpl;
import org.springframework.security.acls.domain.PrincipalSid;
+import org.springframework.security.acls.domain.SpringCacheBasedAclCache;
import org.springframework.security.acls.model.Acl;
import org.springframework.security.acls.model.AuditableAccessControlEntry;
import org.springframework.security.acls.model.MutableAcl;
@@ -55,6 +56,8 @@
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException;
+import static org.mockito.BDDMockito.given;
+import static org.mockito.Mockito.mock;
/**
* Tests {@link BasicLookupStrategy}
@@ -75,7 +78,7 @@ public abstract class AbstractBasicLookupStrategyTests {
private BasicLookupStrategy strategy;
- private static CacheManager cacheManager;
+ private static CacheManagerMock cacheManager;
public abstract JdbcTemplate getJdbcTemplate();
@@ -83,14 +86,13 @@ public abstract class AbstractBasicLookupStrategyTests {
@BeforeAll
public static void initCacheManaer() {
- cacheManager = CacheManager.create();
- cacheManager.addCache(new Cache("basiclookuptestcache", 500, false, false, 30, 30));
+ cacheManager = new CacheManagerMock();
+ cacheManager.addCache("basiclookuptestcache");
}
@AfterAll
public static void shutdownCacheManager() {
- cacheManager.removalAll();
- cacheManager.shutdown();
+ cacheManager.clear();
}
@BeforeEach
@@ -118,11 +120,17 @@ protected AclAuthorizationStrategy aclAuthStrategy() {
return new AclAuthorizationStrategyImpl(new SimpleGrantedAuthority("ROLE_ADMINISTRATOR"));
}
- protected EhCacheBasedAclCache aclCache() {
- return new EhCacheBasedAclCache(getCache(), new DefaultPermissionGrantingStrategy(new ConsoleAuditLogger()),
+ protected SpringCacheBasedAclCache aclCache() {
+ return new SpringCacheBasedAclCache(getCache(), new DefaultPermissionGrantingStrategy(new ConsoleAuditLogger()),
new AclAuthorizationStrategyImpl(new SimpleGrantedAuthority("ROLE_USER")));
}
+ protected Cache getCache() {
+ Cache cache = cacheManager.getCacheManager().getCache("basiclookuptestcache");
+ cache.clear();
+ return cache;
+ }
+
@AfterEach
public void emptyDatabase() {
String query = "DELETE FROM acl_entry;" + "DELETE FROM acl_object_identity WHERE ID = 9;"
@@ -134,12 +142,6 @@ public void emptyDatabase() {
getJdbcTemplate().execute(query);
}
- protected Ehcache getCache() {
- Ehcache cache = cacheManager.getCache("basiclookuptestcache");
- cache.removeAll();
- return cache;
- }
-
@Test
public void testAclsRetrievalWithDefaultBatchSize() throws Exception {
ObjectIdentity topParentOid = new ObjectIdentityImpl(TARGET_CLASS, 100L);
@@ -318,4 +320,32 @@ public void testCreateGrantedAuthority() {
assertThat(((GrantedAuthoritySid) result).getGrantedAuthority()).isEqualTo("sid");
}
+ private static final class CacheManagerMock {
+
+ private final List cacheNames;
+
+ private final CacheManager cacheManager;
+
+ private CacheManagerMock() {
+ this.cacheNames = new ArrayList<>();
+ this.cacheManager = mock(CacheManager.class);
+ given(this.cacheManager.getCacheNames()).willReturn(this.cacheNames);
+ }
+
+ private CacheManager getCacheManager() {
+ return this.cacheManager;
+ }
+
+ private void addCache(String name) {
+ this.cacheNames.add(name);
+ Cache cache = new ConcurrentMapCache(name);
+ given(this.cacheManager.getCache(name)).willReturn(cache);
+ }
+
+ private void clear() {
+ this.cacheNames.clear();
+ }
+
+ }
+
}
diff --git a/acl/src/test/java/org/springframework/security/acls/jdbc/EhCacheBasedAclCacheTests.java b/acl/src/test/java/org/springframework/security/acls/jdbc/EhCacheBasedAclCacheTests.java
deleted file mode 100644
index 35545abae26..00000000000
--- a/acl/src/test/java/org/springframework/security/acls/jdbc/EhCacheBasedAclCacheTests.java
+++ /dev/null
@@ -1,223 +0,0 @@
-/*
- * Copyright 2002-2016 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.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.security.acls.jdbc;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.io.Serializable;
-import java.util.List;
-
-import net.sf.ehcache.Ehcache;
-import net.sf.ehcache.Element;
-import org.junit.jupiter.api.AfterEach;
-import org.junit.jupiter.api.BeforeEach;
-import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.ExtendWith;
-import org.mockito.ArgumentCaptor;
-import org.mockito.Captor;
-import org.mockito.Mock;
-import org.mockito.junit.jupiter.MockitoExtension;
-
-import org.springframework.security.acls.domain.AclAuthorizationStrategy;
-import org.springframework.security.acls.domain.AclAuthorizationStrategyImpl;
-import org.springframework.security.acls.domain.AclImpl;
-import org.springframework.security.acls.domain.ConsoleAuditLogger;
-import org.springframework.security.acls.domain.DefaultPermissionGrantingStrategy;
-import org.springframework.security.acls.domain.EhCacheBasedAclCache;
-import org.springframework.security.acls.domain.ObjectIdentityImpl;
-import org.springframework.security.acls.model.MutableAcl;
-import org.springframework.security.acls.model.ObjectIdentity;
-import org.springframework.security.authentication.TestingAuthenticationToken;
-import org.springframework.security.core.Authentication;
-import org.springframework.security.core.authority.SimpleGrantedAuthority;
-import org.springframework.security.core.context.SecurityContextHolder;
-import org.springframework.security.util.FieldUtils;
-import org.springframework.test.util.ReflectionTestUtils;
-
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException;
-import static org.mockito.BDDMockito.given;
-import static org.mockito.Mockito.times;
-import static org.mockito.Mockito.verify;
-
-/**
- * Tests {@link EhCacheBasedAclCache}
- *
- * @author Andrei Stefan
- */
-@ExtendWith(MockitoExtension.class)
-public class EhCacheBasedAclCacheTests {
-
- private static final String TARGET_CLASS = "org.springframework.security.acls.TargetObject";
-
- @Mock
- private Ehcache cache;
-
- @Captor
- private ArgumentCaptor element;
-
- private EhCacheBasedAclCache myCache;
-
- private MutableAcl acl;
-
- @BeforeEach
- public void setup() {
- this.myCache = new EhCacheBasedAclCache(this.cache,
- new DefaultPermissionGrantingStrategy(new ConsoleAuditLogger()),
- new AclAuthorizationStrategyImpl(new SimpleGrantedAuthority("ROLE_USER")));
- ObjectIdentity identity = new ObjectIdentityImpl(TARGET_CLASS, 100L);
- AclAuthorizationStrategy aclAuthorizationStrategy = new AclAuthorizationStrategyImpl(
- new SimpleGrantedAuthority("ROLE_OWNERSHIP"), new SimpleGrantedAuthority("ROLE_AUDITING"),
- new SimpleGrantedAuthority("ROLE_GENERAL"));
- this.acl = new AclImpl(identity, 1L, aclAuthorizationStrategy, new ConsoleAuditLogger());
- }
-
- @AfterEach
- public void cleanup() {
- SecurityContextHolder.clearContext();
- }
-
- @Test
- public void constructorRejectsNullParameters() {
- assertThatIllegalArgumentException().isThrownBy(
- () -> new EhCacheBasedAclCache(null, new DefaultPermissionGrantingStrategy(new ConsoleAuditLogger()),
- new AclAuthorizationStrategyImpl(new SimpleGrantedAuthority("ROLE_USER"))));
- }
-
- @Test
- public void methodsRejectNullParameters() {
- assertThatIllegalArgumentException().isThrownBy(() -> this.myCache.evictFromCache((Serializable) null));
- assertThatIllegalArgumentException().isThrownBy(() -> this.myCache.evictFromCache((ObjectIdentity) null));
- assertThatIllegalArgumentException().isThrownBy(() -> this.myCache.getFromCache((Serializable) null));
- assertThatIllegalArgumentException().isThrownBy(() -> this.myCache.getFromCache((ObjectIdentity) null));
- assertThatIllegalArgumentException().isThrownBy(() -> this.myCache.putInCache(null));
- }
-
- // SEC-527
- @Test
- public void testDiskSerializationOfMutableAclObjectInstance() throws Exception {
- // Serialization test
- File file = File.createTempFile("SEC_TEST", ".object");
- FileOutputStream fos = new FileOutputStream(file);
- ObjectOutputStream oos = new ObjectOutputStream(fos);
- oos.writeObject(this.acl);
- oos.close();
- FileInputStream fis = new FileInputStream(file);
- ObjectInputStream ois = new ObjectInputStream(fis);
- MutableAcl retrieved = (MutableAcl) ois.readObject();
- ois.close();
- assertThat(retrieved).isEqualTo(this.acl);
- Object retrieved1 = FieldUtils.getProtectedFieldValue("aclAuthorizationStrategy", retrieved);
- assertThat(retrieved1).isNull();
- Object retrieved2 = FieldUtils.getProtectedFieldValue("permissionGrantingStrategy", retrieved);
- assertThat(retrieved2).isNull();
- }
-
- @Test
- public void clearCache() {
- this.myCache.clearCache();
- verify(this.cache).removeAll();
- }
-
- @Test
- public void putInCache() {
- this.myCache.putInCache(this.acl);
- verify(this.cache, times(2)).put(this.element.capture());
- assertThat(this.element.getValue().getKey()).isEqualTo(this.acl.getId());
- assertThat(this.element.getValue().getObjectValue()).isEqualTo(this.acl);
- assertThat(this.element.getAllValues().get(0).getKey()).isEqualTo(this.acl.getObjectIdentity());
- assertThat(this.element.getAllValues().get(0).getObjectValue()).isEqualTo(this.acl);
- }
-
- @Test
- public void putInCacheAclWithParent() {
- Authentication auth = new TestingAuthenticationToken("user", "password", "ROLE_GENERAL");
- auth.setAuthenticated(true);
- SecurityContextHolder.getContext().setAuthentication(auth);
- ObjectIdentity identityParent = new ObjectIdentityImpl(TARGET_CLASS, 2L);
- AclAuthorizationStrategy aclAuthorizationStrategy = new AclAuthorizationStrategyImpl(
- new SimpleGrantedAuthority("ROLE_OWNERSHIP"), new SimpleGrantedAuthority("ROLE_AUDITING"),
- new SimpleGrantedAuthority("ROLE_GENERAL"));
- MutableAcl parentAcl = new AclImpl(identityParent, 2L, aclAuthorizationStrategy, new ConsoleAuditLogger());
- this.acl.setParent(parentAcl);
- this.myCache.putInCache(this.acl);
- verify(this.cache, times(4)).put(this.element.capture());
- List allValues = this.element.getAllValues();
- assertThat(allValues.get(0).getKey()).isEqualTo(parentAcl.getObjectIdentity());
- assertThat(allValues.get(0).getObjectValue()).isEqualTo(parentAcl);
- assertThat(allValues.get(1).getKey()).isEqualTo(parentAcl.getId());
- assertThat(allValues.get(1).getObjectValue()).isEqualTo(parentAcl);
- assertThat(allValues.get(2).getKey()).isEqualTo(this.acl.getObjectIdentity());
- assertThat(allValues.get(2).getObjectValue()).isEqualTo(this.acl);
- assertThat(allValues.get(3).getKey()).isEqualTo(this.acl.getId());
- assertThat(allValues.get(3).getObjectValue()).isEqualTo(this.acl);
- }
-
- @Test
- public void getFromCacheSerializable() {
- given(this.cache.get(this.acl.getId())).willReturn(new Element(this.acl.getId(), this.acl));
- assertThat(this.myCache.getFromCache(this.acl.getId())).isEqualTo(this.acl);
- }
-
- @Test
- public void getFromCacheSerializablePopulatesTransient() {
- given(this.cache.get(this.acl.getId())).willReturn(new Element(this.acl.getId(), this.acl));
- this.myCache.putInCache(this.acl);
- ReflectionTestUtils.setField(this.acl, "permissionGrantingStrategy", null);
- ReflectionTestUtils.setField(this.acl, "aclAuthorizationStrategy", null);
- MutableAcl fromCache = this.myCache.getFromCache(this.acl.getId());
- assertThat(ReflectionTestUtils.getField(fromCache, "aclAuthorizationStrategy")).isNotNull();
- assertThat(ReflectionTestUtils.getField(fromCache, "permissionGrantingStrategy")).isNotNull();
- }
-
- @Test
- public void getFromCacheObjectIdentity() {
- given(this.cache.get(this.acl.getId())).willReturn(new Element(this.acl.getId(), this.acl));
- assertThat(this.myCache.getFromCache(this.acl.getId())).isEqualTo(this.acl);
- }
-
- @Test
- public void getFromCacheObjectIdentityPopulatesTransient() {
- given(this.cache.get(this.acl.getObjectIdentity())).willReturn(new Element(this.acl.getId(), this.acl));
- this.myCache.putInCache(this.acl);
- ReflectionTestUtils.setField(this.acl, "permissionGrantingStrategy", null);
- ReflectionTestUtils.setField(this.acl, "aclAuthorizationStrategy", null);
- MutableAcl fromCache = this.myCache.getFromCache(this.acl.getObjectIdentity());
- assertThat(ReflectionTestUtils.getField(fromCache, "aclAuthorizationStrategy")).isNotNull();
- assertThat(ReflectionTestUtils.getField(fromCache, "permissionGrantingStrategy")).isNotNull();
- }
-
- @Test
- public void evictCacheSerializable() {
- given(this.cache.get(this.acl.getObjectIdentity())).willReturn(new Element(this.acl.getId(), this.acl));
- this.myCache.evictFromCache(this.acl.getObjectIdentity());
- verify(this.cache).remove(this.acl.getId());
- verify(this.cache).remove(this.acl.getObjectIdentity());
- }
-
- @Test
- public void evictCacheObjectIdentity() {
- given(this.cache.get(this.acl.getId())).willReturn(new Element(this.acl.getId(), this.acl));
- this.myCache.evictFromCache(this.acl.getId());
- verify(this.cache).remove(this.acl.getId());
- verify(this.cache).remove(this.acl.getObjectIdentity());
- }
-
-}
diff --git a/acl/src/test/resources/jdbcMutableAclServiceTests-context.xml b/acl/src/test/resources/jdbcMutableAclServiceTests-context.xml
index 457c183d569..d23a727141c 100644
--- a/acl/src/test/resources/jdbcMutableAclServiceTests-context.xml
+++ b/acl/src/test/resources/jdbcMutableAclServiceTests-context.xml
@@ -13,16 +13,10 @@
-
+
-
-
-
-
-
-
-
-
+
+
diff --git a/aspects/spring-security-aspects.gradle b/aspects/spring-security-aspects.gradle
index 3a58595619f..c22feb711b1 100644
--- a/aspects/spring-security-aspects.gradle
+++ b/aspects/spring-security-aspects.gradle
@@ -1,6 +1,15 @@
apply plugin: 'io.spring.convention.spring-module'
apply plugin: 'io.freefair.aspectj'
+compileAspectj {
+ sourceCompatibility "17"
+ targetCompatibility "17"
+}
+compileTestAspectj {
+ sourceCompatibility "17"
+ targetCompatibility "17"
+}
+
dependencies {
management platform(project(":spring-security-dependencies"))
api "org.aspectj:aspectjrt"
diff --git a/build.gradle b/build.gradle
index 85a179290fe..7ac6e5f27dd 100644
--- a/build.gradle
+++ b/build.gradle
@@ -2,7 +2,7 @@ buildscript {
dependencies {
classpath "io.spring.javaformat:spring-javaformat-gradle-plugin:$springJavaformatVersion"
classpath 'io.spring.nohttp:nohttp-gradle:0.0.10'
- classpath "io.freefair.gradle:aspectj-plugin:5.3.3.3"
+ classpath "io.freefair.gradle:aspectj-plugin:6.2.0"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
classpath "com.netflix.nebula:nebula-project-plugin:8.2.0"
}
@@ -100,7 +100,7 @@ updateDependenciesSettings {
subprojects {
plugins.withType(JavaPlugin) {
- project.sourceCompatibility='1.8'
+ project.sourceCompatibility=JavaVersion.VERSION_17
}
tasks.withType(JavaCompile) {
options.encoding = "UTF-8"
diff --git a/buildSrc/build.gradle b/buildSrc/build.gradle
index 18001d9e6a3..576ff6cce4e 100644
--- a/buildSrc/build.gradle
+++ b/buildSrc/build.gradle
@@ -5,8 +5,7 @@ plugins {
id 'com.apollographql.apollo' version '2.4.5'
}
-
-sourceCompatibility = 1.8
+sourceCompatibility = JavaVersion.VERSION_11
repositories {
jcenter()
diff --git a/buildSrc/src/main/groovy/io/spring/gradle/convention/JacocoPlugin.groovy b/buildSrc/src/main/groovy/io/spring/gradle/convention/JacocoPlugin.groovy
index 900cf9f1442..8f558eabbe3 100644
--- a/buildSrc/src/main/groovy/io/spring/gradle/convention/JacocoPlugin.groovy
+++ b/buildSrc/src/main/groovy/io/spring/gradle/convention/JacocoPlugin.groovy
@@ -34,7 +34,7 @@ class JacocoPlugin implements Plugin {
project.tasks.check.dependsOn project.tasks.jacocoTestReport
project.jacoco {
- toolVersion = '0.8.2'
+ toolVersion = '0.8.7'
}
}
}
diff --git a/buildSrc/src/main/java/s101/S101Configurer.java b/buildSrc/src/main/java/s101/S101Configurer.java
index c508c6153b9..7696e0f8b43 100644
--- a/buildSrc/src/main/java/s101/S101Configurer.java
+++ b/buildSrc/src/main/java/s101/S101Configurer.java
@@ -125,7 +125,7 @@ private boolean deleteDirectory(File directoryToBeDeleted) {
}
private String installBuildTool(File installationDirectory, File configurationDirectory) {
- String source = "https://structure101.com/binaries/v6";
+ String source = "https://structure101.com/binaries/19159";
try (final WebClient webClient = new WebClient()) {
HtmlPage page = webClient.getPage(source);
for (HtmlAnchor anchor : page.getAnchors()) {
diff --git a/buildSrc/src/test/java/io/spring/gradle/convention/JavadocApiPluginITest.java b/buildSrc/src/test/java/io/spring/gradle/convention/JavadocApiPluginITest.java
index 681d5c49831..e77f341786a 100644
--- a/buildSrc/src/test/java/io/spring/gradle/convention/JavadocApiPluginITest.java
+++ b/buildSrc/src/test/java/io/spring/gradle/convention/JavadocApiPluginITest.java
@@ -5,6 +5,7 @@
import org.gradle.testkit.runner.BuildResult;
import org.gradle.testkit.runner.TaskOutcome;
import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.io.TempDir;
@@ -28,7 +29,7 @@ public void multiModuleApi() throws Exception {
.build();
assertThat(result.task(":api").getOutcome()).isEqualTo(TaskOutcome.SUCCESS);
File allClasses = new File(testKit.getRootDir(), "build/api/allclasses-noframe.html");
- File index = new File(testKit.getRootDir(), "build/api/allclasses.html");
+ File index = new File(testKit.getRootDir(), "build/api/allclasses-index.html");
File listing = allClasses.exists() ? allClasses : index;
String listingText = FileUtils.readFileToString(listing);
assertThat(listingText).contains("sample/Api.html");
diff --git a/buildSrc/src/test/resources/samples/integrationtest/withpropdeps/build.gradle b/buildSrc/src/test/resources/samples/integrationtest/withpropdeps/build.gradle
index 732278d03b5..48a9859419e 100644
--- a/buildSrc/src/test/resources/samples/integrationtest/withpropdeps/build.gradle
+++ b/buildSrc/src/test/resources/samples/integrationtest/withpropdeps/build.gradle
@@ -9,6 +9,6 @@ repositories {
}
dependencies {
- optional 'javax.servlet:javax.servlet-api:3.1.0'
+ optional 'jakarta.servlet:jakarta.servlet-api:5.0.0'
testCompile 'junit:junit:4.12'
}
\ No newline at end of file
diff --git a/buildSrc/src/test/resources/samples/integrationtest/withpropdeps/src/integration-test/java/sample/TheTest.java b/buildSrc/src/test/resources/samples/integrationtest/withpropdeps/src/integration-test/java/sample/TheTest.java
index de492ca0e67..8bd9ea43927 100644
--- a/buildSrc/src/test/resources/samples/integrationtest/withpropdeps/src/integration-test/java/sample/TheTest.java
+++ b/buildSrc/src/test/resources/samples/integrationtest/withpropdeps/src/integration-test/java/sample/TheTest.java
@@ -1,7 +1,7 @@
package sample;
import org.junit.Test;
-import javax.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletRequest;
public class TheTest {
@Test
diff --git a/cas/spring-security-cas.gradle b/cas/spring-security-cas.gradle
index 8b3d4630f75..f340ec7dda0 100644
--- a/cas/spring-security-cas.gradle
+++ b/cas/spring-security-cas.gradle
@@ -11,9 +11,8 @@ dependencies {
api 'org.springframework:spring-web'
optional 'com.fasterxml.jackson.core:jackson-databind'
- optional 'net.sf.ehcache:ehcache'
- provided 'javax.servlet:javax.servlet-api'
+ provided 'jakarta.servlet:jakarta.servlet-api'
testImplementation "org.assertj:assertj-core"
testImplementation "org.junit.jupiter:junit-jupiter-api"
diff --git a/cas/src/main/java/org/springframework/security/cas/authentication/EhCacheBasedTicketCache.java b/cas/src/main/java/org/springframework/security/cas/authentication/EhCacheBasedTicketCache.java
deleted file mode 100644
index 595c0d23f2e..00000000000
--- a/cas/src/main/java/org/springframework/security/cas/authentication/EhCacheBasedTicketCache.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * Copyright 2004, 2005, 2006 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.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.security.cas.authentication;
-
-import net.sf.ehcache.Ehcache;
-import net.sf.ehcache.Element;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import org.springframework.beans.factory.InitializingBean;
-import org.springframework.core.log.LogMessage;
-import org.springframework.util.Assert;
-
-/**
- * Caches tickets using a Spring IoC defined
- * EHCACHE.
- *
- * @author Ben Alex
- * @deprecated since 5.6. In favor of JCache based implementations
- */
-@Deprecated
-public class EhCacheBasedTicketCache implements StatelessTicketCache, InitializingBean {
-
- private static final Log logger = LogFactory.getLog(EhCacheBasedTicketCache.class);
-
- private Ehcache cache;
-
- @Override
- public void afterPropertiesSet() {
- Assert.notNull(this.cache, "cache mandatory");
- }
-
- @Override
- public CasAuthenticationToken getByTicketId(final String serviceTicket) {
- final Element element = this.cache.get(serviceTicket);
- logger.debug(LogMessage.of(() -> "Cache hit: " + (element != null) + "; service ticket: " + serviceTicket));
- return (element != null) ? (CasAuthenticationToken) element.getValue() : null;
- }
-
- public Ehcache getCache() {
- return this.cache;
- }
-
- @Override
- public void putTicketInCache(final CasAuthenticationToken token) {
- final Element element = new Element(token.getCredentials().toString(), token);
- logger.debug(LogMessage.of(() -> "Cache put: " + element.getKey()));
- this.cache.put(element);
- }
-
- @Override
- public void removeTicketFromCache(final CasAuthenticationToken token) {
- logger.debug(LogMessage.of(() -> "Cache remove: " + token.getCredentials().toString()));
- this.removeTicketFromCache(token.getCredentials().toString());
- }
-
- @Override
- public void removeTicketFromCache(final String serviceTicket) {
- this.cache.remove(serviceTicket);
- }
-
- public void setCache(final Ehcache cache) {
- this.cache = cache;
- }
-
-}
diff --git a/cas/src/main/java/org/springframework/security/cas/web/CasAuthenticationEntryPoint.java b/cas/src/main/java/org/springframework/security/cas/web/CasAuthenticationEntryPoint.java
index 25221addf8c..9bed4a0788f 100644
--- a/cas/src/main/java/org/springframework/security/cas/web/CasAuthenticationEntryPoint.java
+++ b/cas/src/main/java/org/springframework/security/cas/web/CasAuthenticationEntryPoint.java
@@ -18,10 +18,8 @@
import java.io.IOException;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.jasig.cas.client.util.CommonUtils;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.security.cas.ServiceProperties;
@@ -96,7 +94,7 @@ protected String createServiceUrl(HttpServletRequest request, HttpServletRespons
*/
protected String createRedirectUrl(String serviceUrl) {
return CommonUtils.constructRedirectUrl(this.loginUrl, this.serviceProperties.getServiceParameter(), serviceUrl,
- this.serviceProperties.isSendRenew(), false);
+ this.serviceProperties.isSendRenew(), false, null);
}
/**
diff --git a/cas/src/main/java/org/springframework/security/cas/web/CasAuthenticationFilter.java b/cas/src/main/java/org/springframework/security/cas/web/CasAuthenticationFilter.java
index 2352887b1f7..1943834686c 100644
--- a/cas/src/main/java/org/springframework/security/cas/web/CasAuthenticationFilter.java
+++ b/cas/src/main/java/org/springframework/security/cas/web/CasAuthenticationFilter.java
@@ -18,13 +18,12 @@
import java.io.IOException;
-import javax.servlet.FilterChain;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
+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.springframework.core.log.LogMessage;
diff --git a/cas/src/main/java/org/springframework/security/cas/web/CommonUtils.java b/cas/src/main/java/org/springframework/security/cas/web/CommonUtils.java
new file mode 100644
index 00000000000..8376b3f6174
--- /dev/null
+++ b/cas/src/main/java/org/springframework/security/cas/web/CommonUtils.java
@@ -0,0 +1,177 @@
+/*
+ * Licensed to Apereo under one or more contributor license
+ * agreements. See the NOTICE file distributed with this work
+ * for additional information regarding copyright ownership.
+ * Apereo licenses this file to you under the Apache License,
+ * Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a
+ * copy of the License at the following location:
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.springframework.security.cas.web;
+
+import java.io.IOException;
+import java.net.URLEncoder;
+import java.nio.charset.StandardCharsets;
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
+
+import org.jasig.cas.client.Protocol;
+import org.jasig.cas.client.proxy.ProxyGrantingTicketStorage;
+import org.jasig.cas.client.util.URIBuilder;
+
+import org.springframework.util.StringUtils;
+
+final class CommonUtils {
+
+ private static final String PARAM_PROXY_GRANTING_TICKET_IOU = "pgtIou";
+
+ /**
+ * Constant representing the ProxyGrantingTicket Request Parameter.
+ */
+ private static final String PARAM_PROXY_GRANTING_TICKET = "pgtId";
+
+ private static final String SERVICE_PARAMETER_NAMES;
+
+ private CommonUtils() {
+
+ }
+
+ static {
+ final Set serviceParameterSet = new HashSet(4);
+ for (final Protocol protocol : Protocol.values()) {
+ serviceParameterSet.add(protocol.getServiceParameterName());
+ }
+ SERVICE_PARAMETER_NAMES = serviceParameterSet.toString().replaceAll("\\[|\\]", "").replaceAll("\\s", "");
+ }
+
+ static String constructServiceUrl(final HttpServletRequest request, final HttpServletResponse response,
+ final String service, final String serverNames, final String artifactParameterName, final boolean encode) {
+ if (StringUtils.hasText(service)) {
+ return encode ? response.encodeURL(service) : service;
+ }
+
+ final String serverName = findMatchingServerName(request, serverNames);
+ final URIBuilder originalRequestUrl = new URIBuilder(request.getRequestURL().toString(), encode);
+ originalRequestUrl.setParameters(request.getQueryString());
+
+ final URIBuilder builder;
+ if (!serverName.startsWith("https://") && !serverName.startsWith("http://")) {
+ final String scheme = request.isSecure() ? "https://" : "http://";
+ builder = new URIBuilder(scheme + serverName, encode);
+ }
+ else {
+ builder = new URIBuilder(serverName, encode);
+ }
+
+ if (builder.getPort() == -1 && !requestIsOnStandardPort(request)) {
+ builder.setPort(request.getServerPort());
+ }
+
+ builder.setEncodedPath(builder.getEncodedPath() + request.getRequestURI());
+
+ final List serviceParameterNames = Arrays.asList(SERVICE_PARAMETER_NAMES.split(","));
+ if (!serviceParameterNames.isEmpty() && !originalRequestUrl.getQueryParams().isEmpty()) {
+ for (final URIBuilder.BasicNameValuePair pair : originalRequestUrl.getQueryParams()) {
+ final String name = pair.getName();
+ if (!name.equals(artifactParameterName) && !serviceParameterNames.contains(name)) {
+ if (name.contains("&") || name.contains("=")) {
+ final URIBuilder encodedParamBuilder = new URIBuilder();
+ encodedParamBuilder.setParameters(name);
+ for (final URIBuilder.BasicNameValuePair pair2 : encodedParamBuilder.getQueryParams()) {
+ final String name2 = pair2.getName();
+ if (!name2.equals(artifactParameterName) && !serviceParameterNames.contains(name2)) {
+ builder.addParameter(name2, pair2.getValue());
+ }
+ }
+ }
+ else {
+ builder.addParameter(name, pair.getValue());
+ }
+ }
+ }
+ }
+
+ final String result = builder.toString();
+ final String returnValue = encode ? response.encodeURL(result) : result;
+ return returnValue;
+ }
+
+ static String constructRedirectUrl(final String casServerLoginUrl, final String serviceParameterName,
+ final String serviceUrl, final boolean renew, final boolean gateway, final String method) {
+ return casServerLoginUrl + (casServerLoginUrl.contains("?") ? "&" : "?") + serviceParameterName + "="
+ + urlEncode(serviceUrl) + (renew ? "&renew=true" : "") + (gateway ? "&gateway=true" : "")
+ + ((method != null) ? "&method=" + method : "");
+ }
+
+ static String urlEncode(final String value) {
+ return URLEncoder.encode(value, StandardCharsets.UTF_8);
+ }
+
+ static void readAndRespondToProxyReceptorRequest(final HttpServletRequest request,
+ final HttpServletResponse response, final ProxyGrantingTicketStorage proxyGrantingTicketStorage)
+ throws IOException {
+ final String proxyGrantingTicketIou = request.getParameter(PARAM_PROXY_GRANTING_TICKET_IOU);
+
+ final String proxyGrantingTicket = request.getParameter(PARAM_PROXY_GRANTING_TICKET);
+
+ if (org.jasig.cas.client.util.CommonUtils.isBlank(proxyGrantingTicket)
+ || org.jasig.cas.client.util.CommonUtils.isBlank(proxyGrantingTicketIou)) {
+ response.getWriter().write("");
+ return;
+ }
+
+ proxyGrantingTicketStorage.save(proxyGrantingTicketIou, proxyGrantingTicket);
+
+ response.getWriter().write("");
+ response.getWriter().write("");
+ }
+
+ private static String findMatchingServerName(final HttpServletRequest request, final String serverName) {
+ final String[] serverNames = serverName.split(" ");
+
+ if (serverNames.length == 0 || serverNames.length == 1) {
+ return serverName;
+ }
+
+ final String host = request.getHeader("Host");
+ final String xHost = request.getHeader("X-Forwarded-Host");
+
+ final String comparisonHost;
+ comparisonHost = (xHost != null) ? xHost : host;
+
+ if (comparisonHost == null) {
+ return serverName;
+ }
+
+ for (final String server : serverNames) {
+ final String lowerCaseServer = server.toLowerCase();
+
+ if (lowerCaseServer.contains(comparisonHost)) {
+ return server;
+ }
+ }
+
+ return serverNames[0];
+ }
+
+ private static boolean requestIsOnStandardPort(final HttpServletRequest request) {
+ final int serverPort = request.getServerPort();
+ return serverPort == 80 || serverPort == 443;
+ }
+
+}
diff --git a/cas/src/main/java/org/springframework/security/cas/web/authentication/DefaultServiceAuthenticationDetails.java b/cas/src/main/java/org/springframework/security/cas/web/authentication/DefaultServiceAuthenticationDetails.java
index 2171df6cfcb..c550e984ea0 100644
--- a/cas/src/main/java/org/springframework/security/cas/web/authentication/DefaultServiceAuthenticationDetails.java
+++ b/cas/src/main/java/org/springframework/security/cas/web/authentication/DefaultServiceAuthenticationDetails.java
@@ -20,7 +20,7 @@
import java.net.URL;
import java.util.regex.Pattern;
-import javax.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletRequest;
import org.springframework.security.web.authentication.WebAuthenticationDetails;
import org.springframework.security.web.util.UrlUtils;
diff --git a/cas/src/main/java/org/springframework/security/cas/web/authentication/ServiceAuthenticationDetailsSource.java b/cas/src/main/java/org/springframework/security/cas/web/authentication/ServiceAuthenticationDetailsSource.java
index 375952373f5..b8515892dc9 100644
--- a/cas/src/main/java/org/springframework/security/cas/web/authentication/ServiceAuthenticationDetailsSource.java
+++ b/cas/src/main/java/org/springframework/security/cas/web/authentication/ServiceAuthenticationDetailsSource.java
@@ -19,7 +19,7 @@
import java.net.MalformedURLException;
import java.util.regex.Pattern;
-import javax.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletRequest;
import org.springframework.security.authentication.AuthenticationDetailsSource;
import org.springframework.security.cas.ServiceProperties;
diff --git a/cas/src/test/java/org/springframework/security/cas/authentication/EhCacheBasedTicketCacheTests.java b/cas/src/test/java/org/springframework/security/cas/authentication/EhCacheBasedTicketCacheTests.java
deleted file mode 100644
index c824eef4bc6..00000000000
--- a/cas/src/test/java/org/springframework/security/cas/authentication/EhCacheBasedTicketCacheTests.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Copyright 2004, 2005, 2006 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.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.security.cas.authentication;
-
-import net.sf.ehcache.Cache;
-import net.sf.ehcache.CacheManager;
-import net.sf.ehcache.Ehcache;
-import org.junit.jupiter.api.AfterAll;
-import org.junit.jupiter.api.BeforeAll;
-import org.junit.jupiter.api.Test;
-
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException;
-
-/**
- * Tests {@link EhCacheBasedTicketCache}.
- *
- * @author Ben Alex
- */
-public class EhCacheBasedTicketCacheTests extends AbstractStatelessTicketCacheTests {
-
- private static CacheManager cacheManager;
-
- @BeforeAll
- public static void initCacheManaer() {
- cacheManager = CacheManager.create();
- cacheManager.addCache(new Cache("castickets", 500, false, false, 30, 30));
- }
-
- @AfterAll
- public static void shutdownCacheManager() {
- cacheManager.removalAll();
- cacheManager.shutdown();
- }
-
- @Test
- public void testCacheOperation() throws Exception {
- EhCacheBasedTicketCache cache = new EhCacheBasedTicketCache();
- cache.setCache(cacheManager.getCache("castickets"));
- cache.afterPropertiesSet();
- final CasAuthenticationToken token = getToken();
- // Check it gets stored in the cache
- cache.putTicketInCache(token);
- assertThat(cache.getByTicketId("ST-0-ER94xMJmn6pha35CQRoZ")).isEqualTo(token);
- // Check it gets removed from the cache
- cache.removeTicketFromCache(getToken());
- assertThat(cache.getByTicketId("ST-0-ER94xMJmn6pha35CQRoZ")).isNull();
- // Check it doesn't return values for null or unknown service tickets
- assertThat(cache.getByTicketId(null)).isNull();
- assertThat(cache.getByTicketId("UNKNOWN_SERVICE_TICKET")).isNull();
- }
-
- @Test
- public void testStartupDetectsMissingCache() throws Exception {
- EhCacheBasedTicketCache cache = new EhCacheBasedTicketCache();
- assertThatIllegalArgumentException().isThrownBy(cache::afterPropertiesSet);
- Ehcache myCache = cacheManager.getCache("castickets");
- cache.setCache(myCache);
- assertThat(cache.getCache()).isEqualTo(myCache);
- }
-
-}
diff --git a/cas/src/test/java/org/springframework/security/cas/web/CasAuthenticationFilterTests.java b/cas/src/test/java/org/springframework/security/cas/web/CasAuthenticationFilterTests.java
index fab4d2ed1d9..f19222baf2e 100644
--- a/cas/src/test/java/org/springframework/security/cas/web/CasAuthenticationFilterTests.java
+++ b/cas/src/test/java/org/springframework/security/cas/web/CasAuthenticationFilterTests.java
@@ -16,7 +16,7 @@
package org.springframework.security.cas.web;
-import javax.servlet.FilterChain;
+import jakarta.servlet.FilterChain;
import org.jasig.cas.client.proxy.ProxyGrantingTicketStorage;
import org.junit.jupiter.api.AfterEach;
diff --git a/config/spring-security-config.gradle b/config/spring-security-config.gradle
index a54edbd15c8..afd02853c1e 100644
--- a/config/spring-security-config.gradle
+++ b/config/spring-security-config.gradle
@@ -37,9 +37,9 @@ dependencies {
optional'org.springframework:spring-websocket'
optional 'org.jetbrains.kotlin:kotlin-reflect'
optional 'org.jetbrains.kotlin:kotlin-stdlib-jdk8'
- optional 'javax.annotation:jsr250-api'
+ optional 'jakarta.annotation:jakarta.annotation-api'
- provided 'javax.servlet:javax.servlet-api'
+ provided 'jakarta.servlet:jakarta.servlet-api'
testImplementation project(':spring-security-aspects')
testImplementation project(':spring-security-cas')
@@ -62,8 +62,8 @@ dependencies {
testImplementation 'ch.qos.logback:logback-classic'
testImplementation 'io.projectreactor.netty:reactor-netty'
testImplementation 'io.rsocket:rsocket-transport-netty'
- testImplementation 'javax.annotation:jsr250-api:1.0'
- testImplementation 'javax.xml.bind:jaxb-api'
+ testImplementation 'jakarta.annotation:jakarta.annotation-api'
+ testImplementation 'jakarta.xml.bind:jakarta.xml.bind-api'
testImplementation 'ldapsdk:ldapsdk:4.1'
testImplementation('net.sourceforge.htmlunit:htmlunit') {
exclude group: 'commons-logging', module: 'commons-logging'
@@ -74,8 +74,8 @@ dependencies {
testImplementation "org.apache.directory.server:apacheds-protocol-ldap"
testImplementation "org.apache.directory.server:apacheds-server-jndi"
testImplementation 'org.apache.directory.shared:shared-ldap'
- testImplementation 'org.eclipse.persistence:javax.persistence'
- testImplementation 'org.hibernate:hibernate-entitymanager'
+ testImplementation 'jakarta.persistence:jakarta.persistence-api'
+ testImplementation 'org.hibernate:hibernate-core-jakarta'
testImplementation 'org.hsqldb:hsqldb'
testImplementation 'org.mockito:mockito-core'
testImplementation "org.mockito:mockito-inline"
@@ -117,7 +117,7 @@ tasks.withType(KotlinCompile).configureEach {
languageVersion = "1.3"
apiVersion = "1.3"
freeCompilerArgs = ["-Xjsr305=strict", "-Xsuppress-version-warnings"]
- jvmTarget = "1.8"
+ jvmTarget = "11"
}
}
diff --git a/config/src/main/java/org/springframework/security/config/SecurityNamespaceHandler.java b/config/src/main/java/org/springframework/security/config/SecurityNamespaceHandler.java
index d3dd04a7d9c..9e56d238fe5 100644
--- a/config/src/main/java/org/springframework/security/config/SecurityNamespaceHandler.java
+++ b/config/src/main/java/org/springframework/security/config/SecurityNamespaceHandler.java
@@ -94,7 +94,7 @@ public BeanDefinition parse(Element element, ParserContext pc) {
if (!namespaceMatchesVersion(element)) {
pc.getReaderContext().fatal("You cannot use a spring-security-2.0.xsd or spring-security-3.0.xsd or "
+ "spring-security-3.1.xsd schema or spring-security-3.2.xsd schema or spring-security-4.0.xsd schema "
- + "with Spring Security 5.6. Please update your schema declarations to the 5.6 schema.", element);
+ + "with Spring Security 6.0. Please update your schema declarations to the 6.0 schema.", element);
}
String name = pc.getDelegate().getLocalName(element);
BeanDefinitionParser parser = this.parsers.get(name);
@@ -215,7 +215,7 @@ private boolean namespaceMatchesVersion(Element element) {
private boolean matchesVersionInternal(Element element) {
String schemaLocation = element.getAttributeNS("http://www.w3.org/2001/XMLSchema-instance", "schemaLocation");
- return schemaLocation.matches("(?m).*spring-security-5\\.6.*.xsd.*")
+ return schemaLocation.matches("(?m).*spring-security-6\\.0.*.xsd.*")
|| schemaLocation.matches("(?m).*spring-security.xsd.*")
|| !schemaLocation.matches("(?m).*spring-security.*");
}
diff --git a/config/src/main/java/org/springframework/security/config/annotation/web/AbstractRequestMatcherRegistry.java b/config/src/main/java/org/springframework/security/config/annotation/web/AbstractRequestMatcherRegistry.java
index 4f2135a3468..67c7b4f9b4c 100644
--- a/config/src/main/java/org/springframework/security/config/annotation/web/AbstractRequestMatcherRegistry.java
+++ b/config/src/main/java/org/springframework/security/config/annotation/web/AbstractRequestMatcherRegistry.java
@@ -20,7 +20,7 @@
import java.util.Arrays;
import java.util.List;
-import javax.servlet.DispatcherType;
+import jakarta.servlet.DispatcherType;
import org.springframework.beans.factory.NoSuchBeanDefinitionException;
import org.springframework.context.ApplicationContext;
diff --git a/config/src/main/java/org/springframework/security/config/annotation/web/HttpSecurityBuilder.java b/config/src/main/java/org/springframework/security/config/annotation/web/HttpSecurityBuilder.java
index 475f2de2f50..c3da8890e37 100644
--- a/config/src/main/java/org/springframework/security/config/annotation/web/HttpSecurityBuilder.java
+++ b/config/src/main/java/org/springframework/security/config/annotation/web/HttpSecurityBuilder.java
@@ -16,7 +16,7 @@
package org.springframework.security.config.annotation.web;
-import javax.servlet.Filter;
+import jakarta.servlet.Filter;
import org.springframework.security.authentication.AuthenticationProvider;
import org.springframework.security.config.annotation.SecurityBuilder;
diff --git a/config/src/main/java/org/springframework/security/config/annotation/web/WebSecurityConfigurer.java b/config/src/main/java/org/springframework/security/config/annotation/web/WebSecurityConfigurer.java
index c7bc0578d5f..981fdd3742f 100644
--- a/config/src/main/java/org/springframework/security/config/annotation/web/WebSecurityConfigurer.java
+++ b/config/src/main/java/org/springframework/security/config/annotation/web/WebSecurityConfigurer.java
@@ -16,7 +16,7 @@
package org.springframework.security.config.annotation.web;
-import javax.servlet.Filter;
+import jakarta.servlet.Filter;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.SecurityBuilder;
diff --git a/config/src/main/java/org/springframework/security/config/annotation/web/builders/FilterOrderRegistration.java b/config/src/main/java/org/springframework/security/config/annotation/web/builders/FilterOrderRegistration.java
index 13248b7e679..2026e7d8557 100644
--- a/config/src/main/java/org/springframework/security/config/annotation/web/builders/FilterOrderRegistration.java
+++ b/config/src/main/java/org/springframework/security/config/annotation/web/builders/FilterOrderRegistration.java
@@ -20,7 +20,7 @@
import java.util.HashMap;
import java.util.Map;
-import javax.servlet.Filter;
+import jakarta.servlet.Filter;
import org.springframework.security.web.access.ExceptionTranslationFilter;
import org.springframework.security.web.access.channel.ChannelProcessingFilter;
diff --git a/config/src/main/java/org/springframework/security/config/annotation/web/builders/HttpSecurity.java b/config/src/main/java/org/springframework/security/config/annotation/web/builders/HttpSecurity.java
index b4d35729fbd..8b2aca39e0f 100644
--- a/config/src/main/java/org/springframework/security/config/annotation/web/builders/HttpSecurity.java
+++ b/config/src/main/java/org/springframework/security/config/annotation/web/builders/HttpSecurity.java
@@ -21,12 +21,12 @@
import java.util.List;
import java.util.Map;
-import javax.servlet.Filter;
-import javax.servlet.FilterChain;
-import javax.servlet.ServletException;
-import javax.servlet.ServletRequest;
-import javax.servlet.ServletResponse;
-import javax.servlet.http.HttpServletRequest;
+import jakarta.servlet.Filter;
+import jakarta.servlet.FilterChain;
+import jakarta.servlet.ServletException;
+import jakarta.servlet.ServletRequest;
+import jakarta.servlet.ServletResponse;
+import jakarta.servlet.http.HttpServletRequest;
import org.springframework.context.ApplicationContext;
import org.springframework.core.OrderComparator;
@@ -1048,7 +1048,7 @@ public HttpSecurity x509(Customizer> x509Customizer
* The following configuration demonstrates how to allow token based remember me
* authentication. Upon authenticating if the HTTP parameter named "remember-me"
* exists, then the user will be remembered even after their
- * {@link javax.servlet.http.HttpSession} expires.
+ * {@link jakarta.servlet.http.HttpSession} expires.
*
*
* @Configuration
@@ -1084,7 +1084,7 @@ public RememberMeConfigurer rememberMe() throws Exception {
* The following configuration demonstrates how to allow token based remember me
* authentication. Upon authenticating if the HTTP parameter named "remember-me"
* exists, then the user will be remembered even after their
- * {@link javax.servlet.http.HttpSession} expires.
+ * {@link jakarta.servlet.http.HttpSession} expires.
*
*
* @Configuration
diff --git a/config/src/main/java/org/springframework/security/config/annotation/web/builders/WebSecurity.java b/config/src/main/java/org/springframework/security/config/annotation/web/builders/WebSecurity.java
index f0395b840ea..953d8f57758 100644
--- a/config/src/main/java/org/springframework/security/config/annotation/web/builders/WebSecurity.java
+++ b/config/src/main/java/org/springframework/security/config/annotation/web/builders/WebSecurity.java
@@ -19,8 +19,8 @@
import java.util.ArrayList;
import java.util.List;
-import javax.servlet.Filter;
-import javax.servlet.http.HttpServletRequest;
+import jakarta.servlet.Filter;
+import jakarta.servlet.http.HttpServletRequest;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
diff --git a/config/src/main/java/org/springframework/security/config/annotation/web/configuration/AutowiredWebSecurityConfigurersIgnoreParents.java b/config/src/main/java/org/springframework/security/config/annotation/web/configuration/AutowiredWebSecurityConfigurersIgnoreParents.java
index dec674d3054..5ac1033e911 100644
--- a/config/src/main/java/org/springframework/security/config/annotation/web/configuration/AutowiredWebSecurityConfigurersIgnoreParents.java
+++ b/config/src/main/java/org/springframework/security/config/annotation/web/configuration/AutowiredWebSecurityConfigurersIgnoreParents.java
@@ -21,7 +21,7 @@
import java.util.Map;
import java.util.Map.Entry;
-import javax.servlet.Filter;
+import jakarta.servlet.Filter;
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
import org.springframework.context.ApplicationContext;
diff --git a/config/src/main/java/org/springframework/security/config/annotation/web/configuration/SecurityReactorContextConfiguration.java b/config/src/main/java/org/springframework/security/config/annotation/web/configuration/SecurityReactorContextConfiguration.java
index 2783cb358bc..a9ee42415c7 100644
--- a/config/src/main/java/org/springframework/security/config/annotation/web/configuration/SecurityReactorContextConfiguration.java
+++ b/config/src/main/java/org/springframework/security/config/annotation/web/configuration/SecurityReactorContextConfiguration.java
@@ -21,8 +21,8 @@
import java.util.Map;
import java.util.function.Function;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
import org.reactivestreams.Publisher;
import org.reactivestreams.Subscription;
diff --git a/config/src/main/java/org/springframework/security/config/annotation/web/configuration/WebSecurityConfiguration.java b/config/src/main/java/org/springframework/security/config/annotation/web/configuration/WebSecurityConfiguration.java
index 45bf5e5f1e7..2a9c6af9ccf 100644
--- a/config/src/main/java/org/springframework/security/config/annotation/web/configuration/WebSecurityConfiguration.java
+++ b/config/src/main/java/org/springframework/security/config/annotation/web/configuration/WebSecurityConfiguration.java
@@ -20,7 +20,7 @@
import java.util.List;
import java.util.Map;
-import javax.servlet.Filter;
+import jakarta.servlet.Filter;
import org.springframework.beans.factory.BeanClassLoaderAware;
import org.springframework.beans.factory.annotation.Autowired;
diff --git a/config/src/main/java/org/springframework/security/config/annotation/web/configurers/AbstractAuthenticationFilterConfigurer.java b/config/src/main/java/org/springframework/security/config/annotation/web/configurers/AbstractAuthenticationFilterConfigurer.java
index 0837de2a7f8..f38ca4c76c5 100644
--- a/config/src/main/java/org/springframework/security/config/annotation/web/configurers/AbstractAuthenticationFilterConfigurer.java
+++ b/config/src/main/java/org/springframework/security/config/annotation/web/configurers/AbstractAuthenticationFilterConfigurer.java
@@ -19,7 +19,7 @@
import java.util.Arrays;
import java.util.Collections;
-import javax.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletRequest;
import org.springframework.http.MediaType;
import org.springframework.security.authentication.AuthenticationDetailsSource;
diff --git a/config/src/main/java/org/springframework/security/config/annotation/web/configurers/AuthorizeHttpRequestsConfigurer.java b/config/src/main/java/org/springframework/security/config/annotation/web/configurers/AuthorizeHttpRequestsConfigurer.java
index 44d2416cd58..d8357f38fd8 100644
--- a/config/src/main/java/org/springframework/security/config/annotation/web/configurers/AuthorizeHttpRequestsConfigurer.java
+++ b/config/src/main/java/org/springframework/security/config/annotation/web/configurers/AuthorizeHttpRequestsConfigurer.java
@@ -18,7 +18,7 @@
import java.util.List;
-import javax.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletRequest;
import org.springframework.context.ApplicationContext;
import org.springframework.http.HttpMethod;
diff --git a/config/src/main/java/org/springframework/security/config/annotation/web/configurers/CsrfConfigurer.java b/config/src/main/java/org/springframework/security/config/annotation/web/configurers/CsrfConfigurer.java
index c0a3cd62ee6..65fb4012e89 100644
--- a/config/src/main/java/org/springframework/security/config/annotation/web/configurers/CsrfConfigurer.java
+++ b/config/src/main/java/org/springframework/security/config/annotation/web/configurers/CsrfConfigurer.java
@@ -20,7 +20,7 @@
import java.util.LinkedHashMap;
import java.util.List;
-import javax.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletRequest;
import org.springframework.context.ApplicationContext;
import org.springframework.http.HttpMethod;
diff --git a/config/src/main/java/org/springframework/security/config/annotation/web/configurers/DefaultLoginPageConfigurer.java b/config/src/main/java/org/springframework/security/config/annotation/web/configurers/DefaultLoginPageConfigurer.java
index 95bea02fcf5..557fd1ee398 100644
--- a/config/src/main/java/org/springframework/security/config/annotation/web/configurers/DefaultLoginPageConfigurer.java
+++ b/config/src/main/java/org/springframework/security/config/annotation/web/configurers/DefaultLoginPageConfigurer.java
@@ -19,7 +19,7 @@
import java.util.Collections;
import java.util.Map;
-import javax.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletRequest;
import org.springframework.security.config.annotation.web.HttpSecurityBuilder;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
diff --git a/config/src/main/java/org/springframework/security/config/annotation/web/configurers/HeadersConfigurer.java b/config/src/main/java/org/springframework/security/config/annotation/web/configurers/HeadersConfigurer.java
index 3eec2bf59e6..bf75481c564 100644
--- a/config/src/main/java/org/springframework/security/config/annotation/web/configurers/HeadersConfigurer.java
+++ b/config/src/main/java/org/springframework/security/config/annotation/web/configurers/HeadersConfigurer.java
@@ -21,7 +21,7 @@
import java.util.List;
import java.util.Map;
-import javax.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletRequest;
import org.springframework.security.config.Customizer;
import org.springframework.security.config.annotation.web.HttpSecurityBuilder;
diff --git a/config/src/main/java/org/springframework/security/config/annotation/web/configurers/HttpBasicConfigurer.java b/config/src/main/java/org/springframework/security/config/annotation/web/configurers/HttpBasicConfigurer.java
index e45bb31a060..6fbf4cafec8 100644
--- a/config/src/main/java/org/springframework/security/config/annotation/web/configurers/HttpBasicConfigurer.java
+++ b/config/src/main/java/org/springframework/security/config/annotation/web/configurers/HttpBasicConfigurer.java
@@ -20,7 +20,7 @@
import java.util.Collections;
import java.util.LinkedHashMap;
-import javax.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletRequest;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
diff --git a/config/src/main/java/org/springframework/security/config/annotation/web/configurers/JeeConfigurer.java b/config/src/main/java/org/springframework/security/config/annotation/web/configurers/JeeConfigurer.java
index bbd91f045c2..6a16498975e 100644
--- a/config/src/main/java/org/springframework/security/config/annotation/web/configurers/JeeConfigurer.java
+++ b/config/src/main/java/org/springframework/security/config/annotation/web/configurers/JeeConfigurer.java
@@ -19,7 +19,7 @@
import java.util.HashSet;
import java.util.Set;
-import javax.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletRequest;
import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.config.annotation.web.HttpSecurityBuilder;
diff --git a/config/src/main/java/org/springframework/security/config/annotation/web/configurers/LogoutConfigurer.java b/config/src/main/java/org/springframework/security/config/annotation/web/configurers/LogoutConfigurer.java
index be651793021..1c1be56203e 100644
--- a/config/src/main/java/org/springframework/security/config/annotation/web/configurers/LogoutConfigurer.java
+++ b/config/src/main/java/org/springframework/security/config/annotation/web/configurers/LogoutConfigurer.java
@@ -20,7 +20,7 @@
import java.util.LinkedHashMap;
import java.util.List;
-import javax.servlet.http.HttpSession;
+import jakarta.servlet.http.HttpSession;
import org.springframework.security.config.annotation.SecurityConfigurer;
import org.springframework.security.config.annotation.web.HttpSecurityBuilder;
diff --git a/config/src/main/java/org/springframework/security/config/annotation/web/configurers/PermitAllSupport.java b/config/src/main/java/org/springframework/security/config/annotation/web/configurers/PermitAllSupport.java
index 3af0eba1720..bb6bd63f60c 100644
--- a/config/src/main/java/org/springframework/security/config/annotation/web/configurers/PermitAllSupport.java
+++ b/config/src/main/java/org/springframework/security/config/annotation/web/configurers/PermitAllSupport.java
@@ -16,7 +16,7 @@
package org.springframework.security.config.annotation.web.configurers;
-import javax.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletRequest;
import org.springframework.security.access.SecurityConfig;
import org.springframework.security.config.annotation.web.HttpSecurityBuilder;
diff --git a/config/src/main/java/org/springframework/security/config/annotation/web/configurers/ServletApiConfigurer.java b/config/src/main/java/org/springframework/security/config/annotation/web/configurers/ServletApiConfigurer.java
index 5959d9d08e8..e41d3230423 100644
--- a/config/src/main/java/org/springframework/security/config/annotation/web/configurers/ServletApiConfigurer.java
+++ b/config/src/main/java/org/springframework/security/config/annotation/web/configurers/ServletApiConfigurer.java
@@ -18,7 +18,7 @@
import java.util.List;
-import javax.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletRequest;
import org.springframework.context.ApplicationContext;
import org.springframework.security.authentication.AuthenticationManager;
diff --git a/config/src/main/java/org/springframework/security/config/annotation/web/configurers/SessionManagementConfigurer.java b/config/src/main/java/org/springframework/security/config/annotation/web/configurers/SessionManagementConfigurer.java
index 86b9cc0275a..7ad3262563a 100644
--- a/config/src/main/java/org/springframework/security/config/annotation/web/configurers/SessionManagementConfigurer.java
+++ b/config/src/main/java/org/springframework/security/config/annotation/web/configurers/SessionManagementConfigurer.java
@@ -20,8 +20,8 @@
import java.util.Arrays;
import java.util.List;
-import javax.servlet.http.HttpServletResponse;
-import javax.servlet.http.HttpSession;
+import jakarta.servlet.http.HttpServletResponse;
+import jakarta.servlet.http.HttpSession;
import org.springframework.beans.factory.NoSuchBeanDefinitionException;
import org.springframework.context.ApplicationContext;
diff --git a/config/src/main/java/org/springframework/security/config/annotation/web/configurers/X509Configurer.java b/config/src/main/java/org/springframework/security/config/annotation/web/configurers/X509Configurer.java
index 93e1b092506..8691b614200 100644
--- a/config/src/main/java/org/springframework/security/config/annotation/web/configurers/X509Configurer.java
+++ b/config/src/main/java/org/springframework/security/config/annotation/web/configurers/X509Configurer.java
@@ -16,7 +16,7 @@
package org.springframework.security.config.annotation.web.configurers;
-import javax.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletRequest;
import org.springframework.security.authentication.AuthenticationDetailsSource;
import org.springframework.security.authentication.AuthenticationManager;
diff --git a/config/src/main/java/org/springframework/security/config/annotation/web/configurers/oauth2/server/resource/OAuth2ResourceServerConfigurer.java b/config/src/main/java/org/springframework/security/config/annotation/web/configurers/oauth2/server/resource/OAuth2ResourceServerConfigurer.java
index 02a99fdb2a4..60bd289bbfa 100644
--- a/config/src/main/java/org/springframework/security/config/annotation/web/configurers/oauth2/server/resource/OAuth2ResourceServerConfigurer.java
+++ b/config/src/main/java/org/springframework/security/config/annotation/web/configurers/oauth2/server/resource/OAuth2ResourceServerConfigurer.java
@@ -20,7 +20,7 @@
import java.util.Collections;
import java.util.function.Supplier;
-import javax.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletRequest;
import org.springframework.context.ApplicationContext;
import org.springframework.core.convert.converter.Converter;
diff --git a/config/src/main/java/org/springframework/security/config/annotation/web/configurers/openid/OpenIDLoginConfigurer.java b/config/src/main/java/org/springframework/security/config/annotation/web/configurers/openid/OpenIDLoginConfigurer.java
index 0d618ce01e8..db042047798 100644
--- a/config/src/main/java/org/springframework/security/config/annotation/web/configurers/openid/OpenIDLoginConfigurer.java
+++ b/config/src/main/java/org/springframework/security/config/annotation/web/configurers/openid/OpenIDLoginConfigurer.java
@@ -21,7 +21,7 @@
import java.util.List;
import java.util.Map;
-import javax.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletRequest;
import org.openid4java.consumer.ConsumerException;
import org.openid4java.consumer.ConsumerManager;
diff --git a/config/src/main/java/org/springframework/security/config/annotation/web/configurers/saml2/Saml2LoginConfigurer.java b/config/src/main/java/org/springframework/security/config/annotation/web/configurers/saml2/Saml2LoginConfigurer.java
index aa1ddb29af6..d6cf80068dc 100644
--- a/config/src/main/java/org/springframework/security/config/annotation/web/configurers/saml2/Saml2LoginConfigurer.java
+++ b/config/src/main/java/org/springframework/security/config/annotation/web/configurers/saml2/Saml2LoginConfigurer.java
@@ -19,7 +19,7 @@
import java.util.LinkedHashMap;
import java.util.Map;
-import javax.servlet.Filter;
+import jakarta.servlet.Filter;
import org.opensaml.core.Version;
diff --git a/config/src/main/java/org/springframework/security/config/annotation/web/configurers/saml2/Saml2LogoutConfigurer.java b/config/src/main/java/org/springframework/security/config/annotation/web/configurers/saml2/Saml2LogoutConfigurer.java
index 45bd549c01c..cd9aca8d168 100644
--- a/config/src/main/java/org/springframework/security/config/annotation/web/configurers/saml2/Saml2LogoutConfigurer.java
+++ b/config/src/main/java/org/springframework/security/config/annotation/web/configurers/saml2/Saml2LogoutConfigurer.java
@@ -21,8 +21,8 @@
import java.util.Objects;
import java.util.function.Predicate;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
import org.opensaml.core.Version;
diff --git a/config/src/main/java/org/springframework/security/config/http/AuthenticationConfigBuilder.java b/config/src/main/java/org/springframework/security/config/http/AuthenticationConfigBuilder.java
index d3c0ce32f4b..7b1d57076fa 100644
--- a/config/src/main/java/org/springframework/security/config/http/AuthenticationConfigBuilder.java
+++ b/config/src/main/java/org/springframework/security/config/http/AuthenticationConfigBuilder.java
@@ -23,7 +23,7 @@
import java.util.Map;
import java.util.function.Function;
-import javax.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletRequest;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
diff --git a/config/src/main/java/org/springframework/security/config/http/CsrfBeanDefinitionParser.java b/config/src/main/java/org/springframework/security/config/http/CsrfBeanDefinitionParser.java
index 58dcd468a80..0e21437183d 100644
--- a/config/src/main/java/org/springframework/security/config/http/CsrfBeanDefinitionParser.java
+++ b/config/src/main/java/org/springframework/security/config/http/CsrfBeanDefinitionParser.java
@@ -20,7 +20,7 @@
import java.util.HashSet;
import java.util.List;
-import javax.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletRequest;
import org.w3c.dom.Element;
diff --git a/config/src/main/java/org/springframework/security/config/http/DefaultFilterChainValidator.java b/config/src/main/java/org/springframework/security/config/http/DefaultFilterChainValidator.java
index 423ae18de64..932d647fd6b 100644
--- a/config/src/main/java/org/springframework/security/config/http/DefaultFilterChainValidator.java
+++ b/config/src/main/java/org/springframework/security/config/http/DefaultFilterChainValidator.java
@@ -21,7 +21,7 @@
import java.util.Iterator;
import java.util.List;
-import javax.servlet.Filter;
+import jakarta.servlet.Filter;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
diff --git a/config/src/main/java/org/springframework/security/config/http/HttpConfigurationBuilder.java b/config/src/main/java/org/springframework/security/config/http/HttpConfigurationBuilder.java
index e3339b3b136..88e8d3001d1 100644
--- a/config/src/main/java/org/springframework/security/config/http/HttpConfigurationBuilder.java
+++ b/config/src/main/java/org/springframework/security/config/http/HttpConfigurationBuilder.java
@@ -19,7 +19,7 @@
import java.util.ArrayList;
import java.util.List;
-import javax.servlet.ServletRequest;
+import jakarta.servlet.ServletRequest;
import org.w3c.dom.Element;
diff --git a/config/src/main/java/org/springframework/security/config/http/OAuth2ResourceServerBeanDefinitionParser.java b/config/src/main/java/org/springframework/security/config/http/OAuth2ResourceServerBeanDefinitionParser.java
index 2be6d13796c..ec959feb2ad 100644
--- a/config/src/main/java/org/springframework/security/config/http/OAuth2ResourceServerBeanDefinitionParser.java
+++ b/config/src/main/java/org/springframework/security/config/http/OAuth2ResourceServerBeanDefinitionParser.java
@@ -19,7 +19,7 @@
import java.util.List;
import java.util.Map;
-import javax.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletRequest;
import org.w3c.dom.Element;
diff --git a/config/src/main/java/org/springframework/security/config/http/SessionCreationPolicy.java b/config/src/main/java/org/springframework/security/config/http/SessionCreationPolicy.java
index 74beef711d6..d4ee52926cc 100644
--- a/config/src/main/java/org/springframework/security/config/http/SessionCreationPolicy.java
+++ b/config/src/main/java/org/springframework/security/config/http/SessionCreationPolicy.java
@@ -16,7 +16,7 @@
package org.springframework.security.config.http;
-import javax.servlet.http.HttpSession;
+import jakarta.servlet.http.HttpSession;
import org.springframework.security.core.context.SecurityContext;
diff --git a/config/src/main/kotlin/org/springframework/security/config/web/servlet/AbstractRequestMatcherDsl.kt b/config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/AbstractRequestMatcherDsl.kt
similarity index 96%
rename from config/src/main/kotlin/org/springframework/security/config/web/servlet/AbstractRequestMatcherDsl.kt
rename to config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/AbstractRequestMatcherDsl.kt
index 9e35287b5f5..7e700e0fb8f 100644
--- a/config/src/main/kotlin/org/springframework/security/config/web/servlet/AbstractRequestMatcherDsl.kt
+++ b/config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/AbstractRequestMatcherDsl.kt
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.springframework.security.config.web.servlet
+package org.springframework.security.config.annotation.web.configurers
import org.springframework.http.HttpMethod
import org.springframework.security.web.util.matcher.AnyRequestMatcher
diff --git a/config/src/main/kotlin/org/springframework/security/config/web/servlet/AnonymousDsl.kt b/config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/AnonymousDsl.kt
similarity index 94%
rename from config/src/main/kotlin/org/springframework/security/config/web/servlet/AnonymousDsl.kt
rename to config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/AnonymousDsl.kt
index 89055ed025a..7da7f28ad53 100644
--- a/config/src/main/kotlin/org/springframework/security/config/web/servlet/AnonymousDsl.kt
+++ b/config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/AnonymousDsl.kt
@@ -14,11 +14,10 @@
* limitations under the License.
*/
-package org.springframework.security.config.web.servlet
+package org.springframework.security.config.annotation.web.configurers
import org.springframework.security.authentication.AuthenticationProvider
import org.springframework.security.config.annotation.web.builders.HttpSecurity
-import org.springframework.security.config.annotation.web.configurers.AnonymousConfigurer
import org.springframework.security.core.Authentication
import org.springframework.security.core.GrantedAuthority
import org.springframework.security.web.authentication.AnonymousAuthenticationFilter
diff --git a/config/src/main/kotlin/org/springframework/security/config/web/servlet/AuthorizeRequestsDsl.kt b/config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/AuthorizeRequestsDsl.kt
similarity index 98%
rename from config/src/main/kotlin/org/springframework/security/config/web/servlet/AuthorizeRequestsDsl.kt
rename to config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/AuthorizeRequestsDsl.kt
index 663287a1184..bb67f7d9ecf 100644
--- a/config/src/main/kotlin/org/springframework/security/config/web/servlet/AuthorizeRequestsDsl.kt
+++ b/config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/AuthorizeRequestsDsl.kt
@@ -14,11 +14,10 @@
* limitations under the License.
*/
-package org.springframework.security.config.web.servlet
+package org.springframework.security.config.annotation.web.configurers
import org.springframework.http.HttpMethod
import org.springframework.security.config.annotation.web.builders.HttpSecurity
-import org.springframework.security.config.annotation.web.configurers.ExpressionUrlAuthorizationConfigurer
import org.springframework.security.web.util.matcher.AnyRequestMatcher
import org.springframework.security.web.util.matcher.RequestMatcher
import org.springframework.util.ClassUtils
diff --git a/config/src/main/kotlin/org/springframework/security/config/web/servlet/CorsDsl.kt b/config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/CorsDsl.kt
similarity index 91%
rename from config/src/main/kotlin/org/springframework/security/config/web/servlet/CorsDsl.kt
rename to config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/CorsDsl.kt
index a4b0d0ba68a..1c7844a4754 100644
--- a/config/src/main/kotlin/org/springframework/security/config/web/servlet/CorsDsl.kt
+++ b/config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/CorsDsl.kt
@@ -14,10 +14,9 @@
* limitations under the License.
*/
-package org.springframework.security.config.web.servlet
+package org.springframework.security.config.annotation.web.configurers
import org.springframework.security.config.annotation.web.builders.HttpSecurity
-import org.springframework.security.config.annotation.web.configurers.CorsConfigurer
import org.springframework.web.cors.CorsConfigurationSource
/**
diff --git a/config/src/main/kotlin/org/springframework/security/config/web/servlet/CsrfDsl.kt b/config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/CsrfDsl.kt
similarity index 94%
rename from config/src/main/kotlin/org/springframework/security/config/web/servlet/CsrfDsl.kt
rename to config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/CsrfDsl.kt
index f0120e369dc..85bd1b76a32 100644
--- a/config/src/main/kotlin/org/springframework/security/config/web/servlet/CsrfDsl.kt
+++ b/config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/CsrfDsl.kt
@@ -14,14 +14,13 @@
* limitations under the License.
*/
-package org.springframework.security.config.web.servlet
+package org.springframework.security.config.annotation.web.configurers
import org.springframework.security.config.annotation.web.builders.HttpSecurity
-import org.springframework.security.config.annotation.web.configurers.CsrfConfigurer
import org.springframework.security.web.authentication.session.SessionAuthenticationStrategy
import org.springframework.security.web.csrf.CsrfTokenRepository
import org.springframework.security.web.util.matcher.RequestMatcher
-import javax.servlet.http.HttpServletRequest
+import jakarta.servlet.http.HttpServletRequest
/**
* A Kotlin DSL to configure [HttpSecurity] CSRF protection
diff --git a/config/src/main/kotlin/org/springframework/security/config/web/servlet/ExceptionHandlingDsl.kt b/config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/ExceptionHandlingDsl.kt
similarity index 95%
rename from config/src/main/kotlin/org/springframework/security/config/web/servlet/ExceptionHandlingDsl.kt
rename to config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/ExceptionHandlingDsl.kt
index cba38265c76..fa28a1fb1aa 100644
--- a/config/src/main/kotlin/org/springframework/security/config/web/servlet/ExceptionHandlingDsl.kt
+++ b/config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/ExceptionHandlingDsl.kt
@@ -14,14 +14,12 @@
* limitations under the License.
*/
-package org.springframework.security.config.web.servlet
+package org.springframework.security.config.annotation.web.configurers
import org.springframework.security.config.annotation.web.builders.HttpSecurity
-import org.springframework.security.config.annotation.web.configurers.ExceptionHandlingConfigurer
import org.springframework.security.web.AuthenticationEntryPoint
import org.springframework.security.web.access.AccessDeniedHandler
import org.springframework.security.web.util.matcher.RequestMatcher
-import java.util.*
/**
* A Kotlin DSL to configure [HttpSecurity] exception handling using idiomatic Kotlin
diff --git a/config/src/main/kotlin/org/springframework/security/config/web/servlet/FormLoginDsl.kt b/config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/FormLoginDsl.kt
similarity index 95%
rename from config/src/main/kotlin/org/springframework/security/config/web/servlet/FormLoginDsl.kt
rename to config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/FormLoginDsl.kt
index afa40f2281b..35b991cccb3 100644
--- a/config/src/main/kotlin/org/springframework/security/config/web/servlet/FormLoginDsl.kt
+++ b/config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/FormLoginDsl.kt
@@ -14,15 +14,14 @@
* limitations under the License.
*/
-package org.springframework.security.config.web.servlet
+package org.springframework.security.config.annotation.web.configurers
import org.springframework.security.authentication.AuthenticationDetailsSource
import org.springframework.security.config.annotation.web.HttpSecurityBuilder
import org.springframework.security.config.annotation.web.builders.HttpSecurity
-import org.springframework.security.config.annotation.web.configurers.FormLoginConfigurer
import org.springframework.security.web.authentication.AuthenticationFailureHandler
import org.springframework.security.web.authentication.AuthenticationSuccessHandler
-import javax.servlet.http.HttpServletRequest
+import jakarta.servlet.http.HttpServletRequest
/**
* A Kotlin DSL to configure [HttpSecurity] form login using idiomatic Kotlin code.
diff --git a/config/src/main/kotlin/org/springframework/security/config/web/servlet/HeadersDsl.kt b/config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/HeadersDsl.kt
similarity index 98%
rename from config/src/main/kotlin/org/springframework/security/config/web/servlet/HeadersDsl.kt
rename to config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/HeadersDsl.kt
index 3079dd11ff3..10a98afd29f 100644
--- a/config/src/main/kotlin/org/springframework/security/config/web/servlet/HeadersDsl.kt
+++ b/config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/HeadersDsl.kt
@@ -14,11 +14,10 @@
* limitations under the License.
*/
-package org.springframework.security.config.web.servlet
+package org.springframework.security.config.annotation.web.configurers
import org.springframework.security.config.annotation.web.builders.HttpSecurity
-import org.springframework.security.config.annotation.web.configurers.HeadersConfigurer
-import org.springframework.security.config.web.servlet.headers.*
+import org.springframework.security.config.annotation.web.configurers.headers.*
import org.springframework.security.web.header.HeaderWriter
import org.springframework.security.web.header.writers.*
import org.springframework.security.web.header.writers.frameoptions.XFrameOptionsHeaderWriter
diff --git a/config/src/main/kotlin/org/springframework/security/config/web/servlet/HttpBasicDsl.kt b/config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/HttpBasicDsl.kt
similarity index 92%
rename from config/src/main/kotlin/org/springframework/security/config/web/servlet/HttpBasicDsl.kt
rename to config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/HttpBasicDsl.kt
index 7a1a1155dd6..79b458c4e23 100644
--- a/config/src/main/kotlin/org/springframework/security/config/web/servlet/HttpBasicDsl.kt
+++ b/config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/HttpBasicDsl.kt
@@ -14,14 +14,13 @@
* limitations under the License.
*/
-package org.springframework.security.config.web.servlet
+package org.springframework.security.config.annotation.web.configurers
import org.springframework.security.authentication.AuthenticationDetailsSource
import org.springframework.security.config.annotation.web.builders.HttpSecurity
-import org.springframework.security.config.annotation.web.configurers.HttpBasicConfigurer
import org.springframework.security.web.AuthenticationEntryPoint
import org.springframework.security.web.authentication.www.BasicAuthenticationFilter
-import javax.servlet.http.HttpServletRequest
+import jakarta.servlet.http.HttpServletRequest
/**
* A Kotlin DSL to configure [HttpSecurity] basic authentication using idiomatic Kotlin code.
diff --git a/config/src/main/kotlin/org/springframework/security/config/web/servlet/HttpSecurityDsl.kt b/config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/HttpSecurityDsl.kt
similarity index 99%
rename from config/src/main/kotlin/org/springframework/security/config/web/servlet/HttpSecurityDsl.kt
rename to config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/HttpSecurityDsl.kt
index d7a17f72af6..92b8d70b996 100644
--- a/config/src/main/kotlin/org/springframework/security/config/web/servlet/HttpSecurityDsl.kt
+++ b/config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/HttpSecurityDsl.kt
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.springframework.security.config.web.servlet
+package org.springframework.security.config.annotation.web.configurers
import org.springframework.context.ApplicationContext
import org.springframework.security.authentication.AuthenticationManager
@@ -23,8 +23,8 @@ import org.springframework.security.oauth2.client.registration.ClientRegistratio
import org.springframework.security.saml2.provider.service.registration.RelyingPartyRegistrationRepository
import org.springframework.security.web.util.matcher.RequestMatcher
import org.springframework.util.ClassUtils
-import javax.servlet.Filter
-import javax.servlet.http.HttpServletRequest
+import jakarta.servlet.Filter
+import jakarta.servlet.http.HttpServletRequest
/**
* Configures [HttpSecurity] using a [HttpSecurity Kotlin DSL][HttpSecurityDsl].
@@ -831,7 +831,7 @@ class HttpSecurityDsl(private val http: HttpSecurity, private val init: HttpSecu
* @param beforeFilter the location of another [Filter] that is already registered
* (i.e. known) with Spring Security.
*/
- @Deprecated("Use 'addFilterBefore(filter)' instead.")
+ @Suppress("DEPRECATION")
fun addFilterBefore(filter: Filter, beforeFilter: Class) {
this.http.addFilterBefore(filter, beforeFilter)
}
diff --git a/config/src/main/kotlin/org/springframework/security/config/web/servlet/LogoutDsl.kt b/config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/LogoutDsl.kt
similarity index 96%
rename from config/src/main/kotlin/org/springframework/security/config/web/servlet/LogoutDsl.kt
rename to config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/LogoutDsl.kt
index 133e45955ac..4124f945480 100644
--- a/config/src/main/kotlin/org/springframework/security/config/web/servlet/LogoutDsl.kt
+++ b/config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/LogoutDsl.kt
@@ -14,10 +14,9 @@
* limitations under the License.
*/
-package org.springframework.security.config.web.servlet
+package org.springframework.security.config.annotation.web.configurers
import org.springframework.security.config.annotation.web.builders.HttpSecurity
-import org.springframework.security.config.annotation.web.configurers.LogoutConfigurer
import org.springframework.security.core.Authentication
import org.springframework.security.web.access.AccessDeniedHandler
import org.springframework.security.web.authentication.logout.LogoutHandler
@@ -25,7 +24,7 @@ import org.springframework.security.web.authentication.logout.LogoutSuccessHandl
import org.springframework.security.web.authentication.logout.SecurityContextLogoutHandler
import org.springframework.security.web.util.matcher.RequestMatcher
import java.util.*
-import javax.servlet.http.HttpSession
+import jakarta.servlet.http.HttpSession
/**
* A Kotlin DSL to configure [HttpSecurity] logout support
diff --git a/config/src/main/kotlin/org/springframework/security/config/web/servlet/OAuth2ClientDsl.kt b/config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/OAuth2ClientDsl.kt
similarity index 93%
rename from config/src/main/kotlin/org/springframework/security/config/web/servlet/OAuth2ClientDsl.kt
rename to config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/OAuth2ClientDsl.kt
index 2681ed4e192..b4f9661bee4 100644
--- a/config/src/main/kotlin/org/springframework/security/config/web/servlet/OAuth2ClientDsl.kt
+++ b/config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/OAuth2ClientDsl.kt
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.springframework.security.config.web.servlet
+package org.springframework.security.config.annotation.web.configurers
/*
* Copyright 2002-2020 the original author or authors.
@@ -33,9 +33,9 @@ package org.springframework.security.config.web.servlet
*/
import org.springframework.security.config.annotation.web.builders.HttpSecurity
-import org.springframework.security.config.web.servlet.oauth2.client.AuthorizationCodeGrantDsl
-import org.springframework.security.config.web.servlet.oauth2.login.AuthorizationEndpointDsl
import org.springframework.security.config.annotation.web.configurers.oauth2.client.OAuth2ClientConfigurer
+import org.springframework.security.config.annotation.web.configurers.oauth2.client.AuthorizationCodeGrantDsl
+import org.springframework.security.config.annotation.web.configurers.oauth2.login.AuthorizationEndpointDsl
import org.springframework.security.oauth2.client.OAuth2AuthorizedClientService
import org.springframework.security.oauth2.client.registration.ClientRegistrationRepository
import org.springframework.security.oauth2.client.web.OAuth2AuthorizedClientRepository
diff --git a/config/src/main/kotlin/org/springframework/security/config/web/servlet/OAuth2LoginDsl.kt b/config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/OAuth2LoginDsl.kt
similarity index 94%
rename from config/src/main/kotlin/org/springframework/security/config/web/servlet/OAuth2LoginDsl.kt
rename to config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/OAuth2LoginDsl.kt
index 09668dcaa20..02e6d187fee 100644
--- a/config/src/main/kotlin/org/springframework/security/config/web/servlet/OAuth2LoginDsl.kt
+++ b/config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/OAuth2LoginDsl.kt
@@ -14,22 +14,22 @@
* limitations under the License.
*/
-package org.springframework.security.config.web.servlet
+package org.springframework.security.config.annotation.web.configurers
import org.springframework.security.authentication.AuthenticationDetailsSource
import org.springframework.security.config.annotation.web.HttpSecurityBuilder
import org.springframework.security.config.annotation.web.builders.HttpSecurity
-import org.springframework.security.config.web.servlet.oauth2.login.AuthorizationEndpointDsl
-import org.springframework.security.config.web.servlet.oauth2.login.RedirectionEndpointDsl
-import org.springframework.security.config.web.servlet.oauth2.login.TokenEndpointDsl
-import org.springframework.security.config.web.servlet.oauth2.login.UserInfoEndpointDsl
import org.springframework.security.config.annotation.web.configurers.oauth2.client.OAuth2LoginConfigurer
+import org.springframework.security.config.annotation.web.configurers.oauth2.login.TokenEndpointDsl
+import org.springframework.security.config.annotation.web.configurers.oauth2.login.AuthorizationEndpointDsl
+import org.springframework.security.config.annotation.web.configurers.oauth2.login.RedirectionEndpointDsl
+import org.springframework.security.config.annotation.web.configurers.oauth2.login.UserInfoEndpointDsl
import org.springframework.security.oauth2.client.OAuth2AuthorizedClientService
import org.springframework.security.oauth2.client.registration.ClientRegistrationRepository
import org.springframework.security.oauth2.client.web.OAuth2AuthorizedClientRepository
import org.springframework.security.web.authentication.AuthenticationFailureHandler
import org.springframework.security.web.authentication.AuthenticationSuccessHandler
-import javax.servlet.http.HttpServletRequest
+import jakarta.servlet.http.HttpServletRequest
/**
* A Kotlin DSL to configure [HttpSecurity] OAuth 2.0 login using idiomatic Kotlin code.
diff --git a/config/src/main/kotlin/org/springframework/security/config/web/servlet/OAuth2ResourceServerDsl.kt b/config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/OAuth2ResourceServerDsl.kt
similarity index 93%
rename from config/src/main/kotlin/org/springframework/security/config/web/servlet/OAuth2ResourceServerDsl.kt
rename to config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/OAuth2ResourceServerDsl.kt
index d881c27f14b..d12ca77c5ed 100644
--- a/config/src/main/kotlin/org/springframework/security/config/web/servlet/OAuth2ResourceServerDsl.kt
+++ b/config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/OAuth2ResourceServerDsl.kt
@@ -14,17 +14,17 @@
* limitations under the License.
*/
-package org.springframework.security.config.web.servlet
+package org.springframework.security.config.annotation.web.configurers
import org.springframework.security.authentication.AuthenticationManagerResolver
import org.springframework.security.config.annotation.web.builders.HttpSecurity
-import org.springframework.security.config.web.servlet.oauth2.resourceserver.JwtDsl
-import org.springframework.security.config.web.servlet.oauth2.resourceserver.OpaqueTokenDsl
import org.springframework.security.config.annotation.web.configurers.oauth2.server.resource.OAuth2ResourceServerConfigurer
+import org.springframework.security.config.annotation.web.configurers.oauth2.resourceserver.JwtDsl
+import org.springframework.security.config.annotation.web.configurers.oauth2.resourceserver.OpaqueTokenDsl
import org.springframework.security.oauth2.server.resource.web.BearerTokenResolver
import org.springframework.security.web.AuthenticationEntryPoint
import org.springframework.security.web.access.AccessDeniedHandler
-import javax.servlet.http.HttpServletRequest
+import jakarta.servlet.http.HttpServletRequest
/**
* A Kotlin DSL to configure [HttpSecurity] OAuth 2.0 resource server support using
diff --git a/config/src/main/kotlin/org/springframework/security/config/web/servlet/PasswordManagementDsl.kt b/config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/PasswordManagementDsl.kt
similarity index 88%
rename from config/src/main/kotlin/org/springframework/security/config/web/servlet/PasswordManagementDsl.kt
rename to config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/PasswordManagementDsl.kt
index 474dca8704d..b17a5e9a8ac 100644
--- a/config/src/main/kotlin/org/springframework/security/config/web/servlet/PasswordManagementDsl.kt
+++ b/config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/PasswordManagementDsl.kt
@@ -14,10 +14,9 @@
* limitations under the License.
*/
-package org.springframework.security.config.web.servlet
+package org.springframework.security.config.annotation.web.configurers
import org.springframework.security.config.annotation.web.builders.HttpSecurity
-import org.springframework.security.config.annotation.web.configurers.PasswordManagementConfigurer
/**
* A Kotlin DSL to configure [HttpSecurity] password management
diff --git a/config/src/main/kotlin/org/springframework/security/config/web/servlet/PortMapperDsl.kt b/config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/PortMapperDsl.kt
similarity index 92%
rename from config/src/main/kotlin/org/springframework/security/config/web/servlet/PortMapperDsl.kt
rename to config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/PortMapperDsl.kt
index d23f584fe06..839e4b18b8d 100644
--- a/config/src/main/kotlin/org/springframework/security/config/web/servlet/PortMapperDsl.kt
+++ b/config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/PortMapperDsl.kt
@@ -14,10 +14,9 @@
* limitations under the License.
*/
-package org.springframework.security.config.web.servlet
+package org.springframework.security.config.annotation.web.configurers
import org.springframework.security.config.annotation.web.builders.HttpSecurity
-import org.springframework.security.config.annotation.web.configurers.PortMapperConfigurer
import org.springframework.security.web.PortMapper
/**
diff --git a/config/src/main/kotlin/org/springframework/security/config/web/servlet/RememberMeDsl.kt b/config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/RememberMeDsl.kt
similarity index 96%
rename from config/src/main/kotlin/org/springframework/security/config/web/servlet/RememberMeDsl.kt
rename to config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/RememberMeDsl.kt
index db69d5d4f69..34f6a4878a8 100644
--- a/config/src/main/kotlin/org/springframework/security/config/web/servlet/RememberMeDsl.kt
+++ b/config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/RememberMeDsl.kt
@@ -14,10 +14,9 @@
* limitations under the License.
*/
-package org.springframework.security.config.web.servlet
+package org.springframework.security.config.annotation.web.configurers
import org.springframework.security.config.annotation.web.builders.HttpSecurity
-import org.springframework.security.config.annotation.web.configurers.RememberMeConfigurer
import org.springframework.security.core.userdetails.UserDetailsService
import org.springframework.security.web.authentication.AuthenticationSuccessHandler
import org.springframework.security.web.authentication.RememberMeServices
diff --git a/config/src/main/kotlin/org/springframework/security/config/web/servlet/RequestCacheDsl.kt b/config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/RequestCacheDsl.kt
similarity index 89%
rename from config/src/main/kotlin/org/springframework/security/config/web/servlet/RequestCacheDsl.kt
rename to config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/RequestCacheDsl.kt
index b57f017538f..f0c144cf9df 100644
--- a/config/src/main/kotlin/org/springframework/security/config/web/servlet/RequestCacheDsl.kt
+++ b/config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/RequestCacheDsl.kt
@@ -14,10 +14,9 @@
* limitations under the License.
*/
-package org.springframework.security.config.web.servlet
+package org.springframework.security.config.annotation.web.configurers
import org.springframework.security.config.annotation.web.builders.HttpSecurity
-import org.springframework.security.config.annotation.web.configurers.RequestCacheConfigurer
import org.springframework.security.web.savedrequest.RequestCache
/**
diff --git a/config/src/main/kotlin/org/springframework/security/config/web/servlet/RequiresChannelDsl.kt b/config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/RequiresChannelDsl.kt
similarity index 97%
rename from config/src/main/kotlin/org/springframework/security/config/web/servlet/RequiresChannelDsl.kt
rename to config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/RequiresChannelDsl.kt
index a7149014c2e..3441b831d8f 100644
--- a/config/src/main/kotlin/org/springframework/security/config/web/servlet/RequiresChannelDsl.kt
+++ b/config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/RequiresChannelDsl.kt
@@ -14,10 +14,9 @@
* limitations under the License.
*/
-package org.springframework.security.config.web.servlet
+package org.springframework.security.config.annotation.web.configurers
import org.springframework.security.config.annotation.web.builders.HttpSecurity
-import org.springframework.security.config.annotation.web.configurers.ChannelSecurityConfigurer
import org.springframework.security.web.access.channel.ChannelDecisionManagerImpl
import org.springframework.security.web.access.channel.ChannelProcessor
import org.springframework.security.web.util.matcher.AnyRequestMatcher
diff --git a/config/src/main/kotlin/org/springframework/security/config/web/servlet/Saml2Dsl.kt b/config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/Saml2Dsl.kt
similarity index 98%
rename from config/src/main/kotlin/org/springframework/security/config/web/servlet/Saml2Dsl.kt
rename to config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/Saml2Dsl.kt
index 3c658e2397a..860d17fd60c 100644
--- a/config/src/main/kotlin/org/springframework/security/config/web/servlet/Saml2Dsl.kt
+++ b/config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/Saml2Dsl.kt
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.springframework.security.config.web.servlet
+package org.springframework.security.config.annotation.web.configurers
import org.springframework.security.authentication.AuthenticationManager
import org.springframework.security.config.annotation.web.HttpSecurityBuilder
diff --git a/config/src/main/kotlin/org/springframework/security/config/web/servlet/SecurityMarker.kt b/config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/SecurityMarker.kt
similarity index 91%
rename from config/src/main/kotlin/org/springframework/security/config/web/servlet/SecurityMarker.kt
rename to config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/SecurityMarker.kt
index d86554668e0..c1ce5e71076 100644
--- a/config/src/main/kotlin/org/springframework/security/config/web/servlet/SecurityMarker.kt
+++ b/config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/SecurityMarker.kt
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.springframework.security.config.web.servlet
+package org.springframework.security.config.annotation.web.configurers
/**
* Marker annotation indicating that the annotated class is part of the security DSL.
diff --git a/config/src/main/kotlin/org/springframework/security/config/web/servlet/SessionManagementDsl.kt b/config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/SessionManagementDsl.kt
similarity index 94%
rename from config/src/main/kotlin/org/springframework/security/config/web/servlet/SessionManagementDsl.kt
rename to config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/SessionManagementDsl.kt
index c0405ff4f86..2a2e50fcd4a 100644
--- a/config/src/main/kotlin/org/springframework/security/config/web/servlet/SessionManagementDsl.kt
+++ b/config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/SessionManagementDsl.kt
@@ -14,13 +14,12 @@
* limitations under the License.
*/
-package org.springframework.security.config.web.servlet
+package org.springframework.security.config.annotation.web.configurers
import org.springframework.security.config.annotation.web.builders.HttpSecurity
-import org.springframework.security.config.web.servlet.session.SessionConcurrencyDsl
-import org.springframework.security.config.web.servlet.session.SessionFixationDsl
-import org.springframework.security.config.annotation.web.configurers.SessionManagementConfigurer
import org.springframework.security.config.http.SessionCreationPolicy
+import org.springframework.security.config.annotation.web.configurers.session.SessionConcurrencyDsl
+import org.springframework.security.config.annotation.web.configurers.session.SessionFixationDsl
import org.springframework.security.web.authentication.AuthenticationFailureHandler
import org.springframework.security.web.authentication.session.SessionAuthenticationStrategy
import org.springframework.security.web.session.InvalidSessionStrategy
diff --git a/config/src/main/kotlin/org/springframework/security/config/web/servlet/X509Dsl.kt b/config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/X509Dsl.kt
similarity index 94%
rename from config/src/main/kotlin/org/springframework/security/config/web/servlet/X509Dsl.kt
rename to config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/X509Dsl.kt
index 5abcb3a5185..aa36bbd015c 100644
--- a/config/src/main/kotlin/org/springframework/security/config/web/servlet/X509Dsl.kt
+++ b/config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/X509Dsl.kt
@@ -14,11 +14,10 @@
* limitations under the License.
*/
-package org.springframework.security.config.web.servlet
+package org.springframework.security.config.annotation.web.configurers
import org.springframework.security.authentication.AuthenticationDetailsSource
import org.springframework.security.config.annotation.web.builders.HttpSecurity
-import org.springframework.security.config.annotation.web.configurers.X509Configurer
import org.springframework.security.core.userdetails.AuthenticationUserDetailsService
import org.springframework.security.core.userdetails.UserDetailsByNameServiceWrapper
import org.springframework.security.core.userdetails.UserDetailsService
@@ -26,7 +25,7 @@ import org.springframework.security.web.authentication.preauth.PreAuthenticatedA
import org.springframework.security.web.authentication.preauth.PreAuthenticatedGrantedAuthoritiesWebAuthenticationDetails
import org.springframework.security.web.authentication.preauth.x509.X509AuthenticationFilter
import org.springframework.security.web.authentication.preauth.x509.X509PrincipalExtractor
-import javax.servlet.http.HttpServletRequest
+import jakarta.servlet.http.HttpServletRequest
/**
* A Kotlin DSL to configure [HttpSecurity] X509 based pre authentication
diff --git a/config/src/main/kotlin/org/springframework/security/config/web/servlet/headers/CacheControlDsl.kt b/config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/headers/CacheControlDsl.kt
similarity index 94%
rename from config/src/main/kotlin/org/springframework/security/config/web/servlet/headers/CacheControlDsl.kt
rename to config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/headers/CacheControlDsl.kt
index 316015b0160..b493a9058af 100644
--- a/config/src/main/kotlin/org/springframework/security/config/web/servlet/headers/CacheControlDsl.kt
+++ b/config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/headers/CacheControlDsl.kt
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.springframework.security.config.web.servlet.headers
+package org.springframework.security.config.annotation.web.configurers.headers
import org.springframework.security.config.annotation.web.builders.HttpSecurity
import org.springframework.security.config.annotation.web.configurers.HeadersConfigurer
diff --git a/config/src/main/kotlin/org/springframework/security/config/web/servlet/headers/ContentSecurityPolicyDsl.kt b/config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/headers/ContentSecurityPolicyDsl.kt
similarity index 95%
rename from config/src/main/kotlin/org/springframework/security/config/web/servlet/headers/ContentSecurityPolicyDsl.kt
rename to config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/headers/ContentSecurityPolicyDsl.kt
index 270b1d14b4d..32eede7e3d8 100644
--- a/config/src/main/kotlin/org/springframework/security/config/web/servlet/headers/ContentSecurityPolicyDsl.kt
+++ b/config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/headers/ContentSecurityPolicyDsl.kt
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.springframework.security.config.web.servlet.headers
+package org.springframework.security.config.annotation.web.configurers.headers
import org.springframework.security.config.annotation.web.builders.HttpSecurity
import org.springframework.security.config.annotation.web.configurers.HeadersConfigurer
diff --git a/config/src/main/kotlin/org/springframework/security/config/web/servlet/headers/ContentTypeOptionsDsl.kt b/config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/headers/ContentTypeOptionsDsl.kt
similarity index 94%
rename from config/src/main/kotlin/org/springframework/security/config/web/servlet/headers/ContentTypeOptionsDsl.kt
rename to config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/headers/ContentTypeOptionsDsl.kt
index 92014ae4063..589daeb2422 100644
--- a/config/src/main/kotlin/org/springframework/security/config/web/servlet/headers/ContentTypeOptionsDsl.kt
+++ b/config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/headers/ContentTypeOptionsDsl.kt
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.springframework.security.config.web.servlet.headers
+package org.springframework.security.config.annotation.web.configurers.headers
import org.springframework.security.config.annotation.web.builders.HttpSecurity
import org.springframework.security.config.annotation.web.configurers.HeadersConfigurer
diff --git a/config/src/main/kotlin/org/springframework/security/config/web/servlet/headers/FrameOptionsDsl.kt b/config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/headers/FrameOptionsDsl.kt
similarity index 95%
rename from config/src/main/kotlin/org/springframework/security/config/web/servlet/headers/FrameOptionsDsl.kt
rename to config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/headers/FrameOptionsDsl.kt
index 3bf766ca98a..63426031980 100644
--- a/config/src/main/kotlin/org/springframework/security/config/web/servlet/headers/FrameOptionsDsl.kt
+++ b/config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/headers/FrameOptionsDsl.kt
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.springframework.security.config.web.servlet.headers
+package org.springframework.security.config.annotation.web.configurers.headers
import org.springframework.security.config.annotation.web.builders.HttpSecurity
import org.springframework.security.config.annotation.web.configurers.HeadersConfigurer
diff --git a/config/src/main/kotlin/org/springframework/security/config/web/servlet/headers/HeadersSecurityMarker.kt b/config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/headers/HeadersSecurityMarker.kt
similarity index 91%
rename from config/src/main/kotlin/org/springframework/security/config/web/servlet/headers/HeadersSecurityMarker.kt
rename to config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/headers/HeadersSecurityMarker.kt
index 67a97f56c05..b9faf29aebb 100644
--- a/config/src/main/kotlin/org/springframework/security/config/web/servlet/headers/HeadersSecurityMarker.kt
+++ b/config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/headers/HeadersSecurityMarker.kt
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.springframework.security.config.web.servlet.headers
+package org.springframework.security.config.annotation.web.configurers.headers
/**
* Marker annotation indicating that the annotated class is part of the headers security DSL.
diff --git a/config/src/main/kotlin/org/springframework/security/config/web/servlet/headers/HttpPublicKeyPinningDsl.kt b/config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/headers/HttpPublicKeyPinningDsl.kt
similarity index 96%
rename from config/src/main/kotlin/org/springframework/security/config/web/servlet/headers/HttpPublicKeyPinningDsl.kt
rename to config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/headers/HttpPublicKeyPinningDsl.kt
index 74fbb6272a7..b0718bb1a4b 100644
--- a/config/src/main/kotlin/org/springframework/security/config/web/servlet/headers/HttpPublicKeyPinningDsl.kt
+++ b/config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/headers/HttpPublicKeyPinningDsl.kt
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.springframework.security.config.web.servlet.headers
+package org.springframework.security.config.annotation.web.configurers.headers
import org.springframework.security.config.annotation.web.builders.HttpSecurity
import org.springframework.security.config.annotation.web.configurers.HeadersConfigurer
diff --git a/config/src/main/kotlin/org/springframework/security/config/web/servlet/headers/HttpStrictTransportSecurityDsl.kt b/config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/headers/HttpStrictTransportSecurityDsl.kt
similarity index 96%
rename from config/src/main/kotlin/org/springframework/security/config/web/servlet/headers/HttpStrictTransportSecurityDsl.kt
rename to config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/headers/HttpStrictTransportSecurityDsl.kt
index e23e6d36b85..77f05fbc686 100644
--- a/config/src/main/kotlin/org/springframework/security/config/web/servlet/headers/HttpStrictTransportSecurityDsl.kt
+++ b/config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/headers/HttpStrictTransportSecurityDsl.kt
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.springframework.security.config.web.servlet.headers
+package org.springframework.security.config.annotation.web.configurers.headers
import org.springframework.security.config.annotation.web.builders.HttpSecurity
import org.springframework.security.config.annotation.web.configurers.HeadersConfigurer
diff --git a/config/src/main/kotlin/org/springframework/security/config/web/servlet/headers/PermissionsPolicyDsl.kt b/config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/headers/PermissionsPolicyDsl.kt
similarity index 94%
rename from config/src/main/kotlin/org/springframework/security/config/web/servlet/headers/PermissionsPolicyDsl.kt
rename to config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/headers/PermissionsPolicyDsl.kt
index e668931bcd6..8c82faebcb3 100644
--- a/config/src/main/kotlin/org/springframework/security/config/web/servlet/headers/PermissionsPolicyDsl.kt
+++ b/config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/headers/PermissionsPolicyDsl.kt
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.springframework.security.config.web.servlet.headers
+package org.springframework.security.config.annotation.web.configurers.headers
import org.springframework.security.config.annotation.web.builders.HttpSecurity
import org.springframework.security.config.annotation.web.configurers.HeadersConfigurer
diff --git a/config/src/main/kotlin/org/springframework/security/config/web/servlet/headers/ReferrerPolicyDsl.kt b/config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/headers/ReferrerPolicyDsl.kt
similarity index 94%
rename from config/src/main/kotlin/org/springframework/security/config/web/servlet/headers/ReferrerPolicyDsl.kt
rename to config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/headers/ReferrerPolicyDsl.kt
index 1ac54d94c02..ffbc14b3417 100644
--- a/config/src/main/kotlin/org/springframework/security/config/web/servlet/headers/ReferrerPolicyDsl.kt
+++ b/config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/headers/ReferrerPolicyDsl.kt
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.springframework.security.config.web.servlet.headers
+package org.springframework.security.config.annotation.web.configurers.headers
import org.springframework.security.config.annotation.web.builders.HttpSecurity
import org.springframework.security.config.annotation.web.configurers.HeadersConfigurer
diff --git a/config/src/main/kotlin/org/springframework/security/config/web/servlet/headers/XssProtectionConfigDsl.kt b/config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/headers/XssProtectionConfigDsl.kt
similarity index 95%
rename from config/src/main/kotlin/org/springframework/security/config/web/servlet/headers/XssProtectionConfigDsl.kt
rename to config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/headers/XssProtectionConfigDsl.kt
index a48a30af10a..accf8351cc4 100644
--- a/config/src/main/kotlin/org/springframework/security/config/web/servlet/headers/XssProtectionConfigDsl.kt
+++ b/config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/headers/XssProtectionConfigDsl.kt
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.springframework.security.config.web.servlet.headers
+package org.springframework.security.config.annotation.web.configurers.headers
import org.springframework.security.config.annotation.web.builders.HttpSecurity
import org.springframework.security.config.annotation.web.configurers.HeadersConfigurer
diff --git a/config/src/main/kotlin/org/springframework/security/config/web/servlet/oauth2/client/AuthorizationCodeGrantDsl.kt b/config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/oauth2/client/AuthorizationCodeGrantDsl.kt
similarity index 96%
rename from config/src/main/kotlin/org/springframework/security/config/web/servlet/oauth2/client/AuthorizationCodeGrantDsl.kt
rename to config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/oauth2/client/AuthorizationCodeGrantDsl.kt
index b1ab6eca61f..14158d3eac1 100644
--- a/config/src/main/kotlin/org/springframework/security/config/web/servlet/oauth2/client/AuthorizationCodeGrantDsl.kt
+++ b/config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/oauth2/client/AuthorizationCodeGrantDsl.kt
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.springframework.security.config.web.servlet.oauth2.client
+package org.springframework.security.config.annotation.web.configurers.oauth2.client
import org.springframework.security.config.annotation.web.builders.HttpSecurity
import org.springframework.security.config.annotation.web.configurers.oauth2.client.OAuth2ClientConfigurer
diff --git a/config/src/main/kotlin/org/springframework/security/config/web/servlet/oauth2/client/OAuth2ClientSecurityMarker.kt b/config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/oauth2/client/OAuth2ClientSecurityMarker.kt
similarity index 90%
rename from config/src/main/kotlin/org/springframework/security/config/web/servlet/oauth2/client/OAuth2ClientSecurityMarker.kt
rename to config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/oauth2/client/OAuth2ClientSecurityMarker.kt
index 3b6722a2590..b2063974b58 100644
--- a/config/src/main/kotlin/org/springframework/security/config/web/servlet/oauth2/client/OAuth2ClientSecurityMarker.kt
+++ b/config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/oauth2/client/OAuth2ClientSecurityMarker.kt
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.springframework.security.config.web.servlet.oauth2.client
+package org.springframework.security.config.annotation.web.configurers.oauth2.client
/**
* Marker annotation indicating that the annotated class is part of the OAuth 2.0 client security DSL.
diff --git a/config/src/main/kotlin/org/springframework/security/config/web/servlet/oauth2/login/AuthorizationEndpointDsl.kt b/config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/oauth2/login/AuthorizationEndpointDsl.kt
similarity index 96%
rename from config/src/main/kotlin/org/springframework/security/config/web/servlet/oauth2/login/AuthorizationEndpointDsl.kt
rename to config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/oauth2/login/AuthorizationEndpointDsl.kt
index 27c7982c6db..491e38ad2a1 100644
--- a/config/src/main/kotlin/org/springframework/security/config/web/servlet/oauth2/login/AuthorizationEndpointDsl.kt
+++ b/config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/oauth2/login/AuthorizationEndpointDsl.kt
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.springframework.security.config.web.servlet.oauth2.login
+package org.springframework.security.config.annotation.web.configurers.oauth2.login
import org.springframework.security.config.annotation.web.builders.HttpSecurity
import org.springframework.security.config.annotation.web.configurers.oauth2.client.OAuth2LoginConfigurer
diff --git a/config/src/main/kotlin/org/springframework/security/config/web/servlet/oauth2/login/OAuth2LoginSecurityMarker.kt b/config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/oauth2/login/OAuth2LoginSecurityMarker.kt
similarity index 90%
rename from config/src/main/kotlin/org/springframework/security/config/web/servlet/oauth2/login/OAuth2LoginSecurityMarker.kt
rename to config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/oauth2/login/OAuth2LoginSecurityMarker.kt
index 24ab0807d9d..9e04dae4740 100644
--- a/config/src/main/kotlin/org/springframework/security/config/web/servlet/oauth2/login/OAuth2LoginSecurityMarker.kt
+++ b/config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/oauth2/login/OAuth2LoginSecurityMarker.kt
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.springframework.security.config.web.servlet.oauth2.login
+package org.springframework.security.config.annotation.web.configurers.oauth2.login
/**
* Marker annotation indicating that the annotated class is part of the OAuth 2.0 login security DSL.
diff --git a/config/src/main/kotlin/org/springframework/security/config/web/servlet/oauth2/login/RedirectionEndpointDsl.kt b/config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/oauth2/login/RedirectionEndpointDsl.kt
similarity index 94%
rename from config/src/main/kotlin/org/springframework/security/config/web/servlet/oauth2/login/RedirectionEndpointDsl.kt
rename to config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/oauth2/login/RedirectionEndpointDsl.kt
index ac63d88c9c1..dbdbe89e33f 100644
--- a/config/src/main/kotlin/org/springframework/security/config/web/servlet/oauth2/login/RedirectionEndpointDsl.kt
+++ b/config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/oauth2/login/RedirectionEndpointDsl.kt
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.springframework.security.config.web.servlet.oauth2.login
+package org.springframework.security.config.annotation.web.configurers.oauth2.login
import org.springframework.security.config.annotation.web.builders.HttpSecurity
import org.springframework.security.config.annotation.web.configurers.oauth2.client.OAuth2LoginConfigurer
diff --git a/config/src/main/kotlin/org/springframework/security/config/web/servlet/oauth2/login/TokenEndpointDsl.kt b/config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/oauth2/login/TokenEndpointDsl.kt
similarity index 89%
rename from config/src/main/kotlin/org/springframework/security/config/web/servlet/oauth2/login/TokenEndpointDsl.kt
rename to config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/oauth2/login/TokenEndpointDsl.kt
index ddba776d551..942cdef7c94 100644
--- a/config/src/main/kotlin/org/springframework/security/config/web/servlet/oauth2/login/TokenEndpointDsl.kt
+++ b/config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/oauth2/login/TokenEndpointDsl.kt
@@ -14,10 +14,11 @@
* limitations under the License.
*/
-package org.springframework.security.config.web.servlet.oauth2.login
+package org.springframework.security.config.annotation.web.configurers.oauth2.login
import org.springframework.security.config.annotation.web.builders.HttpSecurity
import org.springframework.security.config.annotation.web.configurers.oauth2.client.OAuth2LoginConfigurer
+import org.springframework.security.config.annotation.web.configurers.oauth2.login.OAuth2LoginSecurityMarker
import org.springframework.security.oauth2.client.endpoint.OAuth2AccessTokenResponseClient
import org.springframework.security.oauth2.client.endpoint.OAuth2AuthorizationCodeGrantRequest
diff --git a/config/src/main/kotlin/org/springframework/security/config/web/servlet/oauth2/login/UserInfoEndpointDsl.kt b/config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/oauth2/login/UserInfoEndpointDsl.kt
similarity index 97%
rename from config/src/main/kotlin/org/springframework/security/config/web/servlet/oauth2/login/UserInfoEndpointDsl.kt
rename to config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/oauth2/login/UserInfoEndpointDsl.kt
index 0a5073fc9a9..76170f82266 100644
--- a/config/src/main/kotlin/org/springframework/security/config/web/servlet/oauth2/login/UserInfoEndpointDsl.kt
+++ b/config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/oauth2/login/UserInfoEndpointDsl.kt
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.springframework.security.config.web.servlet.oauth2.login
+package org.springframework.security.config.annotation.web.configurers.oauth2.login
import org.springframework.security.config.annotation.web.builders.HttpSecurity
import org.springframework.security.config.annotation.web.configurers.oauth2.client.OAuth2LoginConfigurer
diff --git a/config/src/main/kotlin/org/springframework/security/config/web/servlet/oauth2/resourceserver/JwtDsl.kt b/config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/oauth2/resourceserver/JwtDsl.kt
similarity index 96%
rename from config/src/main/kotlin/org/springframework/security/config/web/servlet/oauth2/resourceserver/JwtDsl.kt
rename to config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/oauth2/resourceserver/JwtDsl.kt
index a3b5cbc71a2..a578d50a684 100644
--- a/config/src/main/kotlin/org/springframework/security/config/web/servlet/oauth2/resourceserver/JwtDsl.kt
+++ b/config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/oauth2/resourceserver/JwtDsl.kt
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.springframework.security.config.web.servlet.oauth2.resourceserver
+package org.springframework.security.config.annotation.web.configurers.oauth2.resourceserver
import org.springframework.core.convert.converter.Converter
import org.springframework.security.authentication.AbstractAuthenticationToken
diff --git a/config/src/main/kotlin/org/springframework/security/config/web/servlet/oauth2/resourceserver/OAuth2ResourceServerSecurityMarker.kt b/config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/oauth2/resourceserver/OAuth2ResourceServerSecurityMarker.kt
similarity index 90%
rename from config/src/main/kotlin/org/springframework/security/config/web/servlet/oauth2/resourceserver/OAuth2ResourceServerSecurityMarker.kt
rename to config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/oauth2/resourceserver/OAuth2ResourceServerSecurityMarker.kt
index c561531ae97..f3bccb0091d 100644
--- a/config/src/main/kotlin/org/springframework/security/config/web/servlet/oauth2/resourceserver/OAuth2ResourceServerSecurityMarker.kt
+++ b/config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/oauth2/resourceserver/OAuth2ResourceServerSecurityMarker.kt
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.springframework.security.config.web.servlet.oauth2.resourceserver
+package org.springframework.security.config.annotation.web.configurers.oauth2.resourceserver
/**
* Marker annotation indicating that the annotated class is part of the OAuth 2.0 resource server security DSL.
diff --git a/config/src/main/kotlin/org/springframework/security/config/web/servlet/oauth2/resourceserver/OpaqueTokenDsl.kt b/config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/oauth2/resourceserver/OpaqueTokenDsl.kt
similarity index 97%
rename from config/src/main/kotlin/org/springframework/security/config/web/servlet/oauth2/resourceserver/OpaqueTokenDsl.kt
rename to config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/oauth2/resourceserver/OpaqueTokenDsl.kt
index 5c8ab0c3f53..1884aa4734c 100644
--- a/config/src/main/kotlin/org/springframework/security/config/web/servlet/oauth2/resourceserver/OpaqueTokenDsl.kt
+++ b/config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/oauth2/resourceserver/OpaqueTokenDsl.kt
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.springframework.security.config.web.servlet.oauth2.resourceserver
+package org.springframework.security.config.annotation.web.configurers.oauth2.resourceserver
import org.springframework.security.authentication.AuthenticationManager
import org.springframework.security.config.annotation.web.builders.HttpSecurity
diff --git a/config/src/main/kotlin/org/springframework/security/config/web/servlet/session/SessionConcurrencyDsl.kt b/config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/session/SessionConcurrencyDsl.kt
similarity index 97%
rename from config/src/main/kotlin/org/springframework/security/config/web/servlet/session/SessionConcurrencyDsl.kt
rename to config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/session/SessionConcurrencyDsl.kt
index e0af442a9c0..17710cddb3b 100644
--- a/config/src/main/kotlin/org/springframework/security/config/web/servlet/session/SessionConcurrencyDsl.kt
+++ b/config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/session/SessionConcurrencyDsl.kt
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.springframework.security.config.web.servlet.session
+package org.springframework.security.config.annotation.web.configurers.session
import org.springframework.security.config.annotation.web.builders.HttpSecurity
import org.springframework.security.config.annotation.web.configurers.SessionManagementConfigurer
diff --git a/config/src/main/kotlin/org/springframework/security/config/web/servlet/session/SessionFixationDsl.kt b/config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/session/SessionFixationDsl.kt
similarity index 94%
rename from config/src/main/kotlin/org/springframework/security/config/web/servlet/session/SessionFixationDsl.kt
rename to config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/session/SessionFixationDsl.kt
index b02a7d52746..e7c13129140 100644
--- a/config/src/main/kotlin/org/springframework/security/config/web/servlet/session/SessionFixationDsl.kt
+++ b/config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/session/SessionFixationDsl.kt
@@ -14,12 +14,12 @@
* limitations under the License.
*/
-package org.springframework.security.config.web.servlet.session
+package org.springframework.security.config.annotation.web.configurers.session
import org.springframework.security.config.annotation.web.builders.HttpSecurity
import org.springframework.security.config.annotation.web.configurers.SessionManagementConfigurer
-import javax.servlet.http.HttpServletRequest
-import javax.servlet.http.HttpSession
+import jakarta.servlet.http.HttpServletRequest
+import jakarta.servlet.http.HttpSession
/**
* A Kotlin DSL to configure session fixation protection using idiomatic
diff --git a/config/src/main/kotlin/org/springframework/security/config/web/servlet/session/SessionSecurityMarker.kt b/config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/session/SessionSecurityMarker.kt
similarity index 91%
rename from config/src/main/kotlin/org/springframework/security/config/web/servlet/session/SessionSecurityMarker.kt
rename to config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/session/SessionSecurityMarker.kt
index 6e5ef671b7a..00852079e78 100644
--- a/config/src/main/kotlin/org/springframework/security/config/web/servlet/session/SessionSecurityMarker.kt
+++ b/config/src/main/kotlin/org/springframework/security/config/annotation/web/configurers/session/SessionSecurityMarker.kt
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.springframework.security.config.web.servlet.session
+package org.springframework.security.config.annotation.web.configurers.session
/**
* Marker annotation indicating that the annotated class is part of the session security DSL.
diff --git a/config/src/main/resources/META-INF/spring.schemas b/config/src/main/resources/META-INF/spring.schemas
index a67252965d7..4098d6b8c16 100644
--- a/config/src/main/resources/META-INF/spring.schemas
+++ b/config/src/main/resources/META-INF/spring.schemas
@@ -1,4 +1,5 @@
-http\://www.springframework.org/schema/security/spring-security.xsd=org/springframework/security/config/spring-security-5.6.xsd
+http\://www.springframework.org/schema/security/spring-security.xsd=org/springframework/security/config/spring-security-6.0.xsd
+http\://www.springframework.org/schema/security/spring-security-6.0.xsd=org/springframework/security/config/spring-security-6.0.xsd
http\://www.springframework.org/schema/security/spring-security-5.6.xsd=org/springframework/security/config/spring-security-5.6.xsd
http\://www.springframework.org/schema/security/spring-security-5.5.xsd=org/springframework/security/config/spring-security-5.5.xsd
http\://www.springframework.org/schema/security/spring-security-5.4.xsd=org/springframework/security/config/spring-security-5.4.xsd
@@ -17,7 +18,8 @@ http\://www.springframework.org/schema/security/spring-security-2.0.xsd=org/spri
http\://www.springframework.org/schema/security/spring-security-2.0.1.xsd=org/springframework/security/config/spring-security-2.0.1.xsd
http\://www.springframework.org/schema/security/spring-security-2.0.2.xsd=org/springframework/security/config/spring-security-2.0.2.xsd
http\://www.springframework.org/schema/security/spring-security-2.0.4.xsd=org/springframework/security/config/spring-security-2.0.4.xsd
-https\://www.springframework.org/schema/security/spring-security.xsd=org/springframework/security/config/spring-security-5.6.xsd
+https\://www.springframework.org/schema/security/spring-security.xsd=org/springframework/security/config/spring-security-6.0.xsd
+https\://www.springframework.org/schema/security/spring-security-6.0.xsd=org/springframework/security/config/spring-security-6.0.xsd
https\://www.springframework.org/schema/security/spring-security-5.6.xsd=org/springframework/security/config/spring-security-5.6.xsd
https\://www.springframework.org/schema/security/spring-security-5.5.xsd=org/springframework/security/config/spring-security-5.5.xsd
https\://www.springframework.org/schema/security/spring-security-5.4.xsd=org/springframework/security/config/spring-security-5.4.xsd
diff --git a/config/src/main/resources/org/springframework/security/config/spring-security-6.0.rnc b/config/src/main/resources/org/springframework/security/config/spring-security-6.0.rnc
new file mode 100644
index 00000000000..f8c3f8ab133
--- /dev/null
+++ b/config/src/main/resources/org/springframework/security/config/spring-security-6.0.rnc
@@ -0,0 +1,1130 @@
+namespace a = "https://relaxng.org/ns/compatibility/annotations/1.0"
+datatypes xsd = "http://www.w3.org/2001/XMLSchema-datatypes"
+
+default namespace = "http://www.springframework.org/schema/security"
+
+start = http | ldap-server | authentication-provider | ldap-authentication-provider | any-user-service | ldap-server | ldap-authentication-provider
+
+hash =
+ ## Defines the hashing algorithm used on user passwords. Bcrypt is recommended.
+ attribute hash {"bcrypt"}
+base64 =
+ ## Whether a string should be base64 encoded
+ attribute base64 {xsd:boolean}
+request-matcher =
+ ## Defines the strategy use for matching incoming requests. Currently the options are 'mvc' (for Spring MVC matcher), 'ant' (for ant path patterns), 'regex' for regular expressions and 'ciRegex' for case-insensitive regular expressions.
+ attribute request-matcher {"mvc" | "ant" | "regex" | "ciRegex"}
+port =
+ ## Specifies an IP port number. Used to configure an embedded LDAP server, for example.
+ attribute port { xsd:nonNegativeInteger }
+url =
+ ## Specifies a URL.
+ attribute url { xsd:token }
+id =
+ ## A bean identifier, used for referring to the bean elsewhere in the context.
+ attribute id {xsd:token}
+name =
+ ## A bean identifier, used for referring to the bean elsewhere in the context.
+ attribute name {xsd:token}
+ref =
+ ## Defines a reference to a Spring bean Id.
+ attribute ref {xsd:token}
+
+cache-ref =
+ ## Defines a reference to a cache for use with a UserDetailsService.
+ attribute cache-ref {xsd:token}
+
+user-service-ref =
+ ## A reference to a user-service (or UserDetailsService bean) Id
+ attribute user-service-ref {xsd:token}
+
+authentication-manager-ref =
+ ## A reference to an AuthenticationManager bean
+ attribute authentication-manager-ref {xsd:token}
+
+data-source-ref =
+ ## A reference to a DataSource bean
+ attribute data-source-ref {xsd:token}
+
+
+
+debug =
+ ## Enables Spring Security debugging infrastructure. This will provide human-readable (multi-line) debugging information to monitor requests coming into the security filters. This may include sensitive information, such as request parameters or headers, and should only be used in a development environment.
+ element debug {empty}
+
+password-encoder =
+ ## element which defines a password encoding strategy. Used by an authentication provider to convert submitted passwords to hashed versions, for example.
+ element password-encoder {password-encoder.attlist}
+password-encoder.attlist &=
+ ref | (hash)
+
+role-prefix =
+ ## A non-empty string prefix that will be added to role strings loaded from persistent storage (e.g. "ROLE_"). Use the value "none" for no prefix in cases where the default is non-empty.
+ attribute role-prefix {xsd:token}
+
+use-expressions =
+ ## Enables the use of expressions in the 'access' attributes in elements rather than the traditional list of configuration attributes. Defaults to 'true'. If enabled, each attribute should contain a single boolean expression. If the expression evaluates to 'true', access will be granted.
+ attribute use-expressions {xsd:boolean}
+
+ldap-server =
+ ## Defines an LDAP server location or starts an embedded server. The url indicates the location of a remote server. If no url is given, an embedded server will be started, listening on the supplied port number. The port is optional and defaults to 33389. A Spring LDAP ContextSource bean will be registered for the server with the id supplied.
+ element ldap-server {ldap-server.attlist}
+ldap-server.attlist &= id?
+ldap-server.attlist &= (url | port)?
+ldap-server.attlist &=
+ ## Username (DN) of the "manager" user identity which will be used to authenticate to a (non-embedded) LDAP server. If omitted, anonymous access will be used.
+ attribute manager-dn {xsd:string}?
+ldap-server.attlist &=
+ ## The password for the manager DN. This is required if the manager-dn is specified.
+ attribute manager-password {xsd:string}?
+ldap-server.attlist &=
+ ## Explicitly specifies an ldif file resource to load into an embedded LDAP server. The default is classpath*:*.ldiff
+ attribute ldif { xsd:string }?
+ldap-server.attlist &=
+ ## Optional root suffix for the embedded LDAP server. Default is "dc=springframework,dc=org"
+ attribute root { xsd:string }?
+ldap-server.attlist &=
+ ## Explicitly specifies which embedded ldap server should use. Values are 'apacheds' and 'unboundid'. By default, it will depends if the library is available in the classpath.
+ attribute mode { "apacheds" | "unboundid" }?
+
+ldap-server-ref-attribute =
+ ## The optional server to use. If omitted, and a default LDAP server is registered (using with no Id), that server will be used.
+ attribute server-ref {xsd:token}
+
+
+group-search-filter-attribute =
+ ## Group search filter. Defaults to (uniqueMember={0}). The substituted parameter is the DN of the user.
+ attribute group-search-filter {xsd:token}
+group-search-base-attribute =
+ ## Search base for group membership searches. Defaults to "" (searching from the root).
+ attribute group-search-base {xsd:token}
+user-search-filter-attribute =
+ ## The LDAP filter used to search for users (optional). For example "(uid={0})". The substituted parameter is the user's login name.
+ attribute user-search-filter {xsd:token}
+user-search-base-attribute =
+ ## Search base for user searches. Defaults to "". Only used with a 'user-search-filter'.
+ attribute user-search-base {xsd:token}
+group-role-attribute-attribute =
+ ## The LDAP attribute name which contains the role name which will be used within Spring Security. Defaults to "cn".
+ attribute group-role-attribute {xsd:token}
+user-details-class-attribute =
+ ## Allows the objectClass of the user entry to be specified. If set, the framework will attempt to load standard attributes for the defined class into the returned UserDetails object
+ attribute user-details-class {"person" | "inetOrgPerson"}
+user-context-mapper-attribute =
+ ## Allows explicit customization of the loaded user object by specifying a UserDetailsContextMapper bean which will be called with the context information from the user's directory entry
+ attribute user-context-mapper-ref {xsd:token}
+
+
+ldap-user-service =
+ ## This element configures a LdapUserDetailsService which is a combination of a FilterBasedLdapUserSearch and a DefaultLdapAuthoritiesPopulator.
+ element ldap-user-service {ldap-us.attlist}
+ldap-us.attlist &= id?
+ldap-us.attlist &=
+ ldap-server-ref-attribute?
+ldap-us.attlist &=
+ user-search-filter-attribute?
+ldap-us.attlist &=
+ user-search-base-attribute?
+ldap-us.attlist &=
+ group-search-filter-attribute?
+ldap-us.attlist &=
+ group-search-base-attribute?
+ldap-us.attlist &=
+ group-role-attribute-attribute?
+ldap-us.attlist &=
+ cache-ref?
+ldap-us.attlist &=
+ role-prefix?
+ldap-us.attlist &=
+ (user-details-class-attribute | user-context-mapper-attribute)?
+
+ldap-authentication-provider =
+ ## Sets up an ldap authentication provider
+ element ldap-authentication-provider {ldap-ap.attlist, password-compare-element?}
+ldap-ap.attlist &=
+ ldap-server-ref-attribute?
+ldap-ap.attlist &=
+ user-search-base-attribute?
+ldap-ap.attlist &=
+ user-search-filter-attribute?
+ldap-ap.attlist &=
+ group-search-base-attribute?
+ldap-ap.attlist &=
+ group-search-filter-attribute?
+ldap-ap.attlist &=
+ group-role-attribute-attribute?
+ldap-ap.attlist &=
+ ## A specific pattern used to build the user's DN, for example "uid={0},ou=people". The key "{0}" must be present and will be substituted with the username.
+ attribute user-dn-pattern {xsd:token}?
+ldap-ap.attlist &=
+ role-prefix?
+ldap-ap.attlist &=
+ (user-details-class-attribute | user-context-mapper-attribute)?
+
+password-compare-element =
+ ## Specifies that an LDAP provider should use an LDAP compare operation of the user's password to authenticate the user
+ element password-compare {password-compare.attlist, password-encoder?}
+
+password-compare.attlist &=
+ ## The attribute in the directory which contains the user password. Defaults to "userPassword".
+ attribute password-attribute {xsd:token}?
+password-compare.attlist &=
+ hash?
+
+intercept-methods =
+ ## Can be used inside a bean definition to add a security interceptor to the bean and set up access configuration attributes for the bean's methods
+ element intercept-methods {intercept-methods.attlist, protect+}
+intercept-methods.attlist &=
+ ## Optional AccessDecisionManager bean ID to be used by the created method security interceptor.
+ attribute access-decision-manager-ref {xsd:token}?
+
+
+protect =
+ ## Defines a protected method and the access control configuration attributes that apply to it. We strongly advise you NOT to mix "protect" declarations with any services provided "global-method-security".
+ element protect {protect.attlist, empty}
+protect.attlist &=
+ ## A method name
+ attribute method {xsd:token}
+protect.attlist &=
+ ## Access configuration attributes list that applies to the method, e.g. "ROLE_A,ROLE_B".
+ attribute access {xsd:token}
+
+method-security-metadata-source =
+ ## Creates a MethodSecurityMetadataSource instance
+ element method-security-metadata-source {msmds.attlist, protect+}
+msmds.attlist &= id?
+
+msmds.attlist &= use-expressions?
+
+method-security =
+ ## Provides method security for all beans registered in the Spring application context. Specifically, beans will be scanned for matches with Spring Security annotations. Where there is a match, the beans will automatically be proxied and security authorization applied to the methods accordingly. Interceptors are invoked in the order specified in AuthorizationInterceptorsOrder. Use can create your own interceptors using Spring AOP.
+ element method-security {method-security.attlist, expression-handler?}
+method-security.attlist &=
+ ## Specifies whether the use of Spring Security's pre and post invocation annotations (@PreFilter, @PreAuthorize, @PostFilter, @PostAuthorize) should be enabled for this application context. Defaults to "true".
+ attribute pre-post-enabled {xsd:boolean}?
+method-security.attlist &=
+ ## Specifies whether the use of Spring Security's @Secured annotations should be enabled for this application context. Defaults to "false".
+ attribute secured-enabled {xsd:boolean}?
+method-security.attlist &=
+ ## Specifies whether JSR-250 style attributes are to be used (for example "RolesAllowed"). This will require the javax.annotation.security classes on the classpath. Defaults to "false".
+ attribute jsr250-enabled {xsd:boolean}?
+method-security.attlist &=
+ ## If true, class-based proxying will be used instead of interface-based proxying.
+ attribute proxy-target-class {xsd:boolean}?
+
+global-method-security =
+ ## Provides method security for all beans registered in the Spring application context. Specifically, beans will be scanned for matches with the ordered list of "protect-pointcut" sub-elements, Spring Security annotations and/or. Where there is a match, the beans will automatically be proxied and security authorization applied to the methods accordingly. If you use and enable all four sources of method security metadata (ie "protect-pointcut" declarations, expression annotations, @Secured and also JSR250 security annotations), the metadata sources will be queried in that order. In practical terms, this enables you to use XML to override method security metadata expressed in annotations. If using annotations, the order of precedence is EL-based (@PreAuthorize etc.), @Secured and finally JSR-250.
+ element global-method-security {global-method-security.attlist, (pre-post-annotation-handling | expression-handler)?, protect-pointcut*, after-invocation-provider*}
+global-method-security.attlist &=
+ ## Specifies whether the use of Spring Security's pre and post invocation annotations (@PreFilter, @PreAuthorize, @PostFilter, @PostAuthorize) should be enabled for this application context. Defaults to "disabled".
+ attribute pre-post-annotations {"disabled" | "enabled" }?
+global-method-security.attlist &=
+ ## Specifies whether the use of Spring Security's @Secured annotations should be enabled for this application context. Defaults to "disabled".
+ attribute secured-annotations {"disabled" | "enabled" }?
+global-method-security.attlist &=
+ ## Specifies whether JSR-250 style attributes are to be used (for example "RolesAllowed"). This will require the javax.annotation.security classes on the classpath. Defaults to "disabled".
+ attribute jsr250-annotations {"disabled" | "enabled" }?
+global-method-security.attlist &=
+ ## Optional AccessDecisionManager bean ID to override the default used for method security.
+ attribute access-decision-manager-ref {xsd:token}?
+global-method-security.attlist &=
+ ## Optional RunAsmanager implementation which will be used by the configured MethodSecurityInterceptor
+ attribute run-as-manager-ref {xsd:token}?
+global-method-security.attlist &=
+ ## Allows the advice "order" to be set for the method security interceptor.
+ attribute order {xsd:token}?
+global-method-security.attlist &=
+ ## If true, class based proxying will be used instead of interface based proxying.
+ attribute proxy-target-class {xsd:boolean}?
+global-method-security.attlist &=
+ ## Can be used to specify that AspectJ should be used instead of the default Spring AOP. If set, secured classes must be woven with the AnnotationSecurityAspect from the spring-security-aspects module.
+ attribute mode {"aspectj"}?
+global-method-security.attlist &=
+ ## An external MethodSecurityMetadataSource instance can be supplied which will take priority over other sources (such as the default annotations).
+ attribute metadata-source-ref {xsd:token}?
+global-method-security.attlist &=
+ authentication-manager-ref?
+
+
+after-invocation-provider =
+ ## Allows addition of extra AfterInvocationProvider beans which should be called by the MethodSecurityInterceptor created by global-method-security.
+ element after-invocation-provider {ref}
+
+pre-post-annotation-handling =
+ ## Allows the default expression-based mechanism for handling Spring Security's pre and post invocation annotations (@PreFilter, @PreAuthorize, @PostFilter, @PostAuthorize) to be replace entirely. Only applies if these annotations are enabled.
+ element pre-post-annotation-handling {invocation-attribute-factory, pre-invocation-advice, post-invocation-advice}
+
+invocation-attribute-factory =
+ ## Defines the PrePostInvocationAttributeFactory instance which is used to generate pre and post invocation metadata from the annotated methods.
+ element invocation-attribute-factory {ref}
+
+pre-invocation-advice =
+ ## Customizes the PreInvocationAuthorizationAdviceVoter with the ref as the PreInvocationAuthorizationAdviceVoter for the element.
+ element pre-invocation-advice {ref}
+
+post-invocation-advice =
+ ## Customizes the PostInvocationAdviceProvider with the ref as the PostInvocationAuthorizationAdvice for the element.
+ element post-invocation-advice {ref}
+
+
+expression-handler =
+ ## Defines the SecurityExpressionHandler instance which will be used if expression-based access-control is enabled. A default implementation (with no ACL support) will be used if not supplied.
+ element expression-handler {ref}
+
+protect-pointcut =
+ ## Defines a protected pointcut and the access control configuration attributes that apply to it. Every bean registered in the Spring application context that provides a method that matches the pointcut will receive security authorization.
+ element protect-pointcut {protect-pointcut.attlist, empty}
+protect-pointcut.attlist &=
+ ## An AspectJ expression, including the 'execution' keyword. For example, 'execution(int com.foo.TargetObject.countLength(String))' (without the quotes).
+ attribute expression {xsd:string}
+protect-pointcut.attlist &=
+ ## Access configuration attributes list that applies to all methods matching the pointcut, e.g. "ROLE_A,ROLE_B"
+ attribute access {xsd:token}
+
+websocket-message-broker =
+ ## Allows securing a Message Broker. There are two modes. If no id is specified: ensures that any SimpAnnotationMethodMessageHandler has the AuthenticationPrincipalArgumentResolver registered as a custom argument resolver; ensures that the SecurityContextChannelInterceptor is automatically registered for the clientInboundChannel; and that a ChannelSecurityInterceptor is registered with the clientInboundChannel. If the id is specified, creates a ChannelSecurityInterceptor that can be manually registered with the clientInboundChannel.
+ element websocket-message-broker { websocket-message-broker.attrlist, (intercept-message* & expression-handler?) }
+
+websocket-message-broker.attrlist &=
+ ## A bean identifier, used for referring to the bean elsewhere in the context. If specified, explicit configuration within clientInboundChannel is required. If not specified, ensures that any SimpAnnotationMethodMessageHandler has the AuthenticationPrincipalArgumentResolver registered as a custom argument resolver; ensures that the SecurityContextChannelInterceptor is automatically registered for the clientInboundChannel; and that a ChannelSecurityInterceptor is registered with the clientInboundChannel.
+ attribute id {xsd:token}?
+websocket-message-broker.attrlist &=
+ ## Disables the requirement for CSRF token to be present in the Stomp headers (default false). Changing the default is useful if it is necessary to allow other origins to make SockJS connections.
+ attribute same-origin-disabled {xsd:boolean}?
+
+intercept-message =
+ ## Creates an authorization rule for a websocket message.
+ element intercept-message {intercept-message.attrlist}
+
+intercept-message.attrlist &=
+ ## The destination ant pattern which will be mapped to the access attribute. For example, /** matches any message with a destination, /admin/** matches any message that has a destination that starts with admin.
+ attribute pattern {xsd:token}?
+intercept-message.attrlist &=
+ ## The access configuration attributes that apply for the configured message. For example, permitAll grants access to anyone, hasRole('ROLE_ADMIN') requires the user have the role 'ROLE_ADMIN'.
+ attribute access {xsd:token}?
+intercept-message.attrlist &=
+ ## The type of message to match on. Valid values are defined in SimpMessageType (i.e. CONNECT, CONNECT_ACK, HEARTBEAT, MESSAGE, SUBSCRIBE, UNSUBSCRIBE, DISCONNECT, DISCONNECT_ACK, OTHER).
+ attribute type {"CONNECT" | "CONNECT_ACK" | "HEARTBEAT" | "MESSAGE" | "SUBSCRIBE"| "UNSUBSCRIBE" | "DISCONNECT" | "DISCONNECT_ACK" | "OTHER"}?
+
+http-firewall =
+ ## Allows a custom instance of HttpFirewall to be injected into the FilterChainProxy created by the namespace.
+ element http-firewall {ref}
+
+http =
+ ## Container element for HTTP security configuration. Multiple elements can now be defined, each with a specific pattern to which the enclosed security configuration applies. A pattern can also be configured to bypass Spring Security's filters completely by setting the "security" attribute to "none".
+ element http {http.attlist, (intercept-url* & access-denied-handler? & form-login? & oauth2-login? & oauth2-client? & oauth2-resource-server? & openid-login? & x509? & jee? & http-basic? & logout? & password-management? & session-management & remember-me? & anonymous? & port-mappings & custom-filter* & request-cache? & expression-handler? & headers? & csrf? & cors?) }
+http.attlist &=
+ ## The request URL pattern which will be mapped to the filter chain created by this element. If omitted, the filter chain will match all requests.
+ attribute pattern {xsd:token}?
+http.attlist &=
+ ## When set to 'none', requests matching the pattern attribute will be ignored by Spring Security. No security filters will be applied and no SecurityContext will be available. If set, the element must be empty, with no children.
+ attribute security {"none"}?
+http.attlist &=
+ ## Allows a RequestMatcher instance to be used, as an alternative to pattern-matching.
+ attribute request-matcher-ref { xsd:token }?
+http.attlist &=
+ ## A legacy attribute which automatically registers a login form, BASIC authentication and a logout URL and logout services. If unspecified, defaults to "false". We'd recommend you avoid using this and instead explicitly configure the services you require.
+ attribute auto-config {xsd:boolean}?
+http.attlist &=
+ use-expressions?
+http.attlist &=
+ ## Controls the eagerness with which an HTTP session is created by Spring Security classes. If not set, defaults to "ifRequired". If "stateless" is used, this implies that the application guarantees that it will not create a session. This differs from the use of "never" which means that Spring Security will not create a session, but will make use of one if the application does.
+ attribute create-session {"ifRequired" | "always" | "never" | "stateless"}?
+http.attlist &=
+ ## A reference to a SecurityContextRepository bean. This can be used to customize how the SecurityContext is stored between requests.
+ attribute security-context-repository-ref {xsd:token}?
+http.attlist &=
+ request-matcher?
+http.attlist &=
+ ## Provides versions of HttpServletRequest security methods such as isUserInRole() and getPrincipal() which are implemented by accessing the Spring SecurityContext. Defaults to "true".
+ attribute servlet-api-provision {xsd:boolean}?
+http.attlist &=
+ ## If available, runs the request as the Subject acquired from the JaasAuthenticationToken. Defaults to "false".
+ attribute jaas-api-provision {xsd:boolean}?
+http.attlist &=
+ ## Optional attribute specifying the ID of the AccessDecisionManager implementation which should be used for authorizing HTTP requests.
+ attribute access-decision-manager-ref {xsd:token}?
+http.attlist &=
+ ## Optional attribute specifying the realm name that will be used for all authentication features that require a realm name (eg BASIC and Digest authentication). If unspecified, defaults to "Spring Security Application".
+ attribute realm {xsd:token}?
+http.attlist &=
+ ## Allows a customized AuthenticationEntryPoint to be set on the ExceptionTranslationFilter.
+ attribute entry-point-ref {xsd:token}?
+http.attlist &=
+ ## Corresponds to the observeOncePerRequest property of FilterSecurityInterceptor. Defaults to "true"
+ attribute once-per-request {xsd:boolean}?
+http.attlist &=
+ ## Prevents the jsessionid parameter from being added to rendered URLs. Defaults to "true" (rewriting is disabled).
+ attribute disable-url-rewriting {xsd:boolean}?
+http.attlist &=
+ ## Exposes the list of filters defined by this configuration under this bean name in the application context.
+ name?
+http.attlist &=
+ authentication-manager-ref?
+
+access-denied-handler =
+ ## Defines the access-denied strategy that should be used. An access denied page can be defined or a reference to an AccessDeniedHandler instance.
+ element access-denied-handler {access-denied-handler.attlist, empty}
+access-denied-handler.attlist &= (ref | access-denied-handler-page)
+
+access-denied-handler-page =
+ ## The access denied page that an authenticated user will be redirected to if they request a page which they don't have the authority to access.
+ attribute error-page {xsd:token}
+
+intercept-url =
+ ## Specifies the access attributes and/or filter list for a particular set of URLs.
+ element intercept-url {intercept-url.attlist, empty}
+intercept-url.attlist &=
+ (pattern | request-matcher-ref)
+intercept-url.attlist &=
+ ## The access configuration attributes that apply for the configured path.
+ attribute access {xsd:token}?
+intercept-url.attlist &=
+ ## The HTTP Method for which the access configuration attributes should apply. If not specified, the attributes will apply to any method.
+ attribute method {"GET" | "DELETE" | "HEAD" | "OPTIONS" | "POST" | "PUT" | "PATCH" | "TRACE"}?
+
+intercept-url.attlist &=
+ ## Used to specify that a URL must be accessed over http or https, or that there is no preference. The value should be "http", "https" or "any", respectively.
+ attribute requires-channel {xsd:token}?
+intercept-url.attlist &=
+ ## The path to the servlet. This attribute is only applicable when 'request-matcher' is 'mvc'. In addition, the value is only required in the following 2 use cases: 1) There are 2 or more HttpServlet's registered in the ServletContext that have mappings starting with '/' and are different; 2) The pattern starts with the same value of a registered HttpServlet path, excluding the default (root) HttpServlet '/'.
+ attribute servlet-path {xsd:token}?
+
+logout =
+ ## Incorporates a logout processing filter. Most web applications require a logout filter, although you may not require one if you write a controller to provider similar logic.
+ element logout {logout.attlist, empty}
+logout.attlist &=
+ ## Specifies the URL that will cause a logout. Spring Security will initialize a filter that responds to this particular URL. Defaults to /logout if unspecified.
+ attribute logout-url {xsd:token}?
+logout.attlist &=
+ ## Specifies the URL to display once the user has logged out. If not specified, defaults to /?logout (i.e. /login?logout).
+ attribute logout-success-url {xsd:token}?
+logout.attlist &=
+ ## Specifies whether a logout also causes HttpSession invalidation, which is generally desirable. If unspecified, defaults to true.
+ attribute invalidate-session {xsd:boolean}?
+logout.attlist &=
+ ## A reference to a LogoutSuccessHandler implementation which will be used to determine the destination to which the user is taken after logging out.
+ attribute success-handler-ref {xsd:token}?
+logout.attlist &=
+ ## A comma-separated list of the names of cookies which should be deleted when the user logs out
+ attribute delete-cookies {xsd:token}?
+
+request-cache =
+ ## Allow the RequestCache used for saving requests during the login process to be set
+ element request-cache {ref}
+
+form-login =
+ ## Sets up a form login configuration for authentication with a username and password
+ element form-login {form-login.attlist, empty}
+form-login.attlist &=
+ ## The URL that the login form is posted to. If unspecified, it defaults to /login.
+ attribute login-processing-url {xsd:token}?
+form-login.attlist &=
+ ## The name of the request parameter which contains the username. Defaults to 'username'.
+ attribute username-parameter {xsd:token}?
+form-login.attlist &=
+ ## The name of the request parameter which contains the password. Defaults to 'password'.
+ attribute password-parameter {xsd:token}?
+form-login.attlist &=
+ ## The URL that will be redirected to after successful authentication, if the user's previous action could not be resumed. This generally happens if the user visits a login page without having first requested a secured operation that triggers authentication. If unspecified, defaults to the root of the application.
+ attribute default-target-url {xsd:token}?
+form-login.attlist &=
+ ## Whether the user should always be redirected to the default-target-url after login.
+ attribute always-use-default-target {xsd:boolean}?
+form-login.attlist &=
+ ## The URL for the login page. If no login URL is specified, Spring Security will automatically create a login URL at GET /login and a corresponding filter to render that login URL when requested.
+ attribute login-page {xsd:token}?
+form-login.attlist &=
+ ## The URL for the login failure page. If no login failure URL is specified, Spring Security will automatically create a failure login URL at /login?error and a corresponding filter to render that login failure URL when requested.
+ attribute authentication-failure-url {xsd:token}?
+form-login.attlist &=
+ ## Reference to an AuthenticationSuccessHandler bean which should be used to handle a successful authentication request. Should not be used in combination with default-target-url (or always-use-default-target-url) as the implementation should always deal with navigation to the subsequent destination
+ attribute authentication-success-handler-ref {xsd:token}?
+form-login.attlist &=
+ ## Reference to an AuthenticationFailureHandler bean which should be used to handle a failed authentication request. Should not be used in combination with authentication-failure-url as the implementation should always deal with navigation to the subsequent destination
+ attribute authentication-failure-handler-ref {xsd:token}?
+form-login.attlist &=
+ ## Reference to an AuthenticationDetailsSource which will be used by the authentication filter
+ attribute authentication-details-source-ref {xsd:token}?
+form-login.attlist &=
+ ## The URL for the ForwardAuthenticationFailureHandler
+ attribute authentication-failure-forward-url {xsd:token}?
+form-login.attlist &=
+ ## The URL for the ForwardAuthenticationSuccessHandler
+ attribute authentication-success-forward-url {xsd:token}?
+
+oauth2-login =
+ ## Configures authentication support using an OAuth 2.0 and/or OpenID Connect 1.0 Provider.
+ element oauth2-login {oauth2-login.attlist}
+oauth2-login.attlist &=
+ ## Reference to the ClientRegistrationRepository
+ attribute client-registration-repository-ref {xsd:token}?
+oauth2-login.attlist &=
+ ## Reference to the OAuth2AuthorizedClientRepository
+ attribute authorized-client-repository-ref {xsd:token}?
+oauth2-login.attlist &=
+ ## Reference to the OAuth2AuthorizedClientService
+ attribute authorized-client-service-ref {xsd:token}?
+oauth2-login.attlist &=
+ ## Reference to the AuthorizationRequestRepository
+ attribute authorization-request-repository-ref {xsd:token}?
+oauth2-login.attlist &=
+ ## Reference to the OAuth2AuthorizationRequestResolver
+ attribute authorization-request-resolver-ref {xsd:token}?
+oauth2-login.attlist &=
+ ## Reference to the OAuth2AccessTokenResponseClient
+ attribute access-token-response-client-ref {xsd:token}?
+oauth2-login.attlist &=
+ ## Reference to the GrantedAuthoritiesMapper
+ attribute user-authorities-mapper-ref {xsd:token}?
+oauth2-login.attlist &=
+ ## Reference to the OAuth2UserService
+ attribute user-service-ref {xsd:token}?
+oauth2-login.attlist &=
+ ## Reference to the OpenID Connect OAuth2UserService
+ attribute oidc-user-service-ref {xsd:token}?
+oauth2-login.attlist &=
+ ## The URI where the filter processes authentication requests
+ attribute login-processing-url {xsd:token}?
+oauth2-login.attlist &=
+ ## The URI to send users to login
+ attribute login-page {xsd:token}?
+oauth2-login.attlist &=
+ ## Reference to the AuthenticationSuccessHandler
+ attribute authentication-success-handler-ref {xsd:token}?
+oauth2-login.attlist &=
+ ## Reference to the AuthenticationFailureHandler
+ attribute authentication-failure-handler-ref {xsd:token}?
+oauth2-login.attlist &=
+ ## Reference to the JwtDecoderFactory used by OidcAuthorizationCodeAuthenticationProvider
+ attribute jwt-decoder-factory-ref {xsd:token}?
+
+oauth2-client =
+ ## Configures OAuth 2.0 Client support.
+ element oauth2-client {oauth2-client.attlist, (authorization-code-grant?) }
+oauth2-client.attlist &=
+ ## Reference to the ClientRegistrationRepository
+ attribute client-registration-repository-ref {xsd:token}?
+oauth2-client.attlist &=
+ ## Reference to the OAuth2AuthorizedClientRepository
+ attribute authorized-client-repository-ref {xsd:token}?
+oauth2-client.attlist &=
+ ## Reference to the OAuth2AuthorizedClientService
+ attribute authorized-client-service-ref {xsd:token}?
+
+authorization-code-grant =
+ ## Configures OAuth 2.0 Authorization Code Grant.
+ element authorization-code-grant {authorization-code-grant.attlist, empty}
+authorization-code-grant.attlist &=
+ ## Reference to the AuthorizationRequestRepository
+ attribute authorization-request-repository-ref {xsd:token}?
+authorization-code-grant.attlist &=
+ ## Reference to the OAuth2AuthorizationRequestResolver
+ attribute authorization-request-resolver-ref {xsd:token}?
+authorization-code-grant.attlist &=
+ ## Reference to the OAuth2AccessTokenResponseClient
+ attribute access-token-response-client-ref {xsd:token}?
+
+client-registrations =
+ ## Container element for client(s) registered with an OAuth 2.0 or OpenID Connect 1.0 Provider.
+ element client-registrations {client-registration+, provider*}
+
+client-registration =
+ ## Represents a client registered with an OAuth 2.0 or OpenID Connect 1.0 Provider.
+ element client-registration {client-registration.attlist}
+client-registration.attlist &=
+ ## The ID that uniquely identifies the client registration.
+ attribute registration-id {xsd:token}
+client-registration.attlist &=
+ ## The client identifier.
+ attribute client-id {xsd:token}
+client-registration.attlist &=
+ ## The client secret.
+ attribute client-secret {xsd:token}?
+client-registration.attlist &=
+ ## The method used to authenticate the client with the provider. The supported values are client_secret_basic, client_secret_post and none (public clients).
+ attribute client-authentication-method {"client_secret_basic" | "basic" | "client_secret_post" | "post" | "none"}?
+client-registration.attlist &=
+ ## The OAuth 2.0 Authorization Framework defines four Authorization Grant types. The supported values are authorization_code, client_credentials, password and implicit.
+ attribute authorization-grant-type {"authorization_code" | "client_credentials" | "password" | "implicit"}?
+client-registration.attlist &=
+ ## The client’s registered redirect URI that the Authorization Server redirects the end-user’s user-agent to after the end-user has authenticated and authorized access to the client.
+ attribute redirect-uri {xsd:token}?
+client-registration.attlist &=
+ ## A comma-separated list of scope(s) requested by the client during the Authorization Request flow, such as openid, email, or profile.
+ attribute scope {xsd:token}?
+client-registration.attlist &=
+ ## A descriptive name used for the client. The name may be used in certain scenarios, such as when displaying the name of the client in the auto-generated login page.
+ attribute client-name {xsd:token}?
+client-registration.attlist &=
+ ## A reference to the associated provider. May reference a 'provider' element or use one of the common providers (google, github, facebook, okta).
+ attribute provider-id {xsd:token}
+
+provider =
+ ## The configuration information for an OAuth 2.0 or OpenID Connect 1.0 Provider.
+ element provider {provider.attlist}
+provider.attlist &=
+ ## The ID that uniquely identifies the provider.
+ attribute provider-id {xsd:token}
+provider.attlist &=
+ ## The Authorization Endpoint URI for the Authorization Server.
+ attribute authorization-uri {xsd:token}?
+provider.attlist &=
+ ## The Token Endpoint URI for the Authorization Server.
+ attribute token-uri {xsd:token}?
+provider.attlist &=
+ ## The UserInfo Endpoint URI used to access the claims/attributes of the authenticated end-user.
+ attribute user-info-uri {xsd:token}?
+provider.attlist &=
+ ## The authentication method used when sending the access token to the UserInfo Endpoint. The supported values are header, form and query.
+ attribute user-info-authentication-method {"header" | "form" | "query"}?
+provider.attlist &=
+ ## The name of the attribute returned in the UserInfo Response that references the Name or Identifier of the end-user.
+ attribute user-info-user-name-attribute {xsd:token}?
+provider.attlist &=
+ ## The URI used to retrieve the JSON Web Key (JWK) Set from the Authorization Server, which contains the cryptographic key(s) used to verify the JSON Web Signature (JWS) of the ID Token and optionally the UserInfo Response.
+ attribute jwk-set-uri {xsd:token}?
+provider.attlist &=
+ ## The URI used to discover the configuration information for an OAuth 2.0 or OpenID Connect 1.0 Provider.
+ attribute issuer-uri {xsd:token}?
+
+oauth2-resource-server =
+ ## Configures authentication support as an OAuth 2.0 Resource Server.
+ element oauth2-resource-server {oauth2-resource-server.attlist, (jwt? & opaque-token?)}
+oauth2-resource-server.attlist &=
+ ## Reference to an AuthenticationManagerResolver
+ attribute authentication-manager-resolver-ref {xsd:token}?
+oauth2-resource-server.attlist &=
+ ## Reference to a BearerTokenResolver
+ attribute bearer-token-resolver-ref {xsd:token}?
+oauth2-resource-server.attlist &=
+ ## Reference to a AuthenticationEntryPoint
+ attribute entry-point-ref {xsd:token}?
+
+jwt =
+ ## Configures JWT authentication
+ element jwt {jwt.attlist}
+jwt.attlist &=
+ ## The URI to use to collect the JWK Set for verifying JWTs
+ attribute jwk-set-uri {xsd:token}?
+jwt.attlist &=
+ ## Reference to a JwtDecoder
+ attribute decoder-ref {xsd:token}?
+jwt.attlist &=
+ ## Reference to a Converter
+ attribute jwt-authentication-converter-ref {xsd:token}?
+
+opaque-token =
+ ## Configuration Opaque Token authentication
+ element opaque-token {opaque-token.attlist}
+opaque-token.attlist &=
+ ## The URI to use to introspect opaque token attributes
+ attribute introspection-uri {xsd:token}?
+opaque-token.attlist &=
+ ## The Client ID to use to authenticate the introspection request
+ attribute client-id {xsd:token}?
+opaque-token.attlist &=
+ ## The Client secret to use to authenticate the introspection request
+ attribute client-secret {xsd:token}?
+opaque-token.attlist &=
+ ## Reference to an OpaqueTokenIntrospector
+ attribute introspector-ref {xsd:token}?
+
+openid-login =
+ ## Sets up form login for authentication with an Open ID identity. NOTE: The OpenID 1.0 and 2.0 protocols have been deprecated and users are encouraged to migrate to OpenID Connect, which is supported by spring-security-oauth2.
+ element openid-login {form-login.attlist, user-service-ref?, attribute-exchange*}
+
+attribute-exchange =
+ ## Sets up an attribute exchange configuration to request specified attributes from the OpenID identity provider. When multiple elements are used, each must have an identifier-attribute attribute. Each configuration will be matched in turn against the supplied login identifier until a match is found.
+ element attribute-exchange {attribute-exchange.attlist, openid-attribute+}
+
+attribute-exchange.attlist &=
+ ## A regular expression which will be compared against the claimed identity, when deciding which attribute-exchange configuration to use during authentication.
+ attribute identifier-match {xsd:token}?
+
+openid-attribute =
+ ## Attributes used when making an OpenID AX Fetch Request. NOTE: The OpenID 1.0 and 2.0 protocols have been deprecated and users are encouraged to migrate to OpenID Connect, which is supported by spring-security-oauth2.
+ element openid-attribute {openid-attribute.attlist}
+
+openid-attribute.attlist &=
+ ## Specifies the name of the attribute that you wish to get back. For example, email.
+ attribute name {xsd:token}
+openid-attribute.attlist &=
+ ## Specifies the attribute type. For example, https://axschema.org/contact/email. See your OP's documentation for valid attribute types.
+ attribute type {xsd:token}
+openid-attribute.attlist &=
+ ## Specifies if this attribute is required to the OP, but does not error out if the OP does not return the attribute. Default is false.
+ attribute required {xsd:boolean}?
+openid-attribute.attlist &=
+ ## Specifies the number of attributes that you wish to get back. For example, return 3 emails. The default value is 1.
+ attribute count {xsd:int}?
+
+
+filter-chain-map =
+ ## Used to explicitly configure a FilterChainProxy instance with a FilterChainMap
+ element filter-chain-map {filter-chain-map.attlist, filter-chain+}
+filter-chain-map.attlist &=
+ request-matcher?
+
+filter-chain =
+ ## Used within to define a specific URL pattern and the list of filters which apply to the URLs matching that pattern. When multiple filter-chain elements are assembled in a list in order to configure a FilterChainProxy, the most specific patterns must be placed at the top of the list, with most general ones at the bottom.
+ element filter-chain {filter-chain.attlist, empty}
+filter-chain.attlist &=
+ (pattern | request-matcher-ref)
+filter-chain.attlist &=
+ ## A comma separated list of bean names that implement Filter that should be processed for this FilterChain. If the value is none, then no Filters will be used for this FilterChain.
+ attribute filters {xsd:token}
+
+pattern =
+ ## The request URL pattern which will be mapped to the FilterChain.
+ attribute pattern {xsd:token}
+request-matcher-ref =
+ ## Allows a RequestMatcher instance to be used, as an alternative to pattern-matching.
+ attribute request-matcher-ref {xsd:token}
+
+filter-security-metadata-source =
+ ## Used to explicitly configure a FilterSecurityMetadataSource bean for use with a FilterSecurityInterceptor. Usually only needed if you are configuring a FilterChainProxy explicitly, rather than using the element. The intercept-url elements used should only contain pattern, method and access attributes. Any others will result in a configuration error.
+ element filter-security-metadata-source {fsmds.attlist, intercept-url+}
+fsmds.attlist &=
+ use-expressions?
+fsmds.attlist &=
+ id?
+fsmds.attlist &=
+ request-matcher?
+
+http-basic =
+ ## Adds support for basic authentication
+ element http-basic {http-basic.attlist, empty}
+
+http-basic.attlist &=
+ ## Sets the AuthenticationEntryPoint which is used by the BasicAuthenticationFilter.
+ attribute entry-point-ref {xsd:token}?
+http-basic.attlist &=
+ ## Reference to an AuthenticationDetailsSource which will be used by the authentication filter
+ attribute authentication-details-source-ref {xsd:token}?
+
+password-management =
+ ## Adds support for the password management.
+ element password-management {password-management.attlist, empty}
+
+password-management.attlist &=
+ ## The change password page. Defaults to "/change-password".
+ attribute change-password-page {xsd:string}?
+
+session-management =
+ ## Session-management related functionality is implemented by the addition of a SessionManagementFilter to the filter stack.
+ element session-management {session-management.attlist, concurrency-control?}
+
+session-management.attlist &=
+ ## Indicates how session fixation protection will be applied when a user authenticates. If set to "none", no protection will be applied. "newSession" will create a new empty session, with only Spring Security-related attributes migrated. "migrateSession" will create a new session and copy all session attributes to the new session. In Servlet 3.1 (Java EE 7) and newer containers, specifying "changeSessionId" will keep the existing session and use the container-supplied session fixation protection (HttpServletRequest#changeSessionId()). Defaults to "changeSessionId" in Servlet 3.1 and newer containers, "migrateSession" in older containers. Throws an exception if "changeSessionId" is used in older containers.
+ attribute session-fixation-protection {"none" | "newSession" | "migrateSession" | "changeSessionId" }?
+session-management.attlist &=
+ ## The URL to which a user will be redirected if they submit an invalid session indentifier. Typically used to detect session timeouts.
+ attribute invalid-session-url {xsd:token}?
+session-management.attlist &=
+ ## Allows injection of the InvalidSessionStrategy instance used by the SessionManagementFilter
+ attribute invalid-session-strategy-ref {xsd:token}?
+session-management.attlist &=
+ ## Allows injection of the SessionAuthenticationStrategy instance used by the SessionManagementFilter
+ attribute session-authentication-strategy-ref {xsd:token}?
+session-management.attlist &=
+ ## Defines the URL of the error page which should be shown when the SessionAuthenticationStrategy raises an exception. If not set, an unauthorized (401) error code will be returned to the client. Note that this attribute doesn't apply if the error occurs during a form-based login, where the URL for authentication failure will take precedence.
+ attribute session-authentication-error-url {xsd:token}?
+
+
+concurrency-control =
+ ## Enables concurrent session control, limiting the number of authenticated sessions a user may have at the same time.
+ element concurrency-control {concurrency-control.attlist, empty}
+
+concurrency-control.attlist &=
+ ## The maximum number of sessions a single authenticated user can have open at the same time. Defaults to "1". A negative value denotes unlimited sessions.
+ attribute max-sessions {xsd:token}?
+concurrency-control.attlist &=
+ ## The URL a user will be redirected to if they attempt to use a session which has been "expired" because they have logged in again.
+ attribute expired-url {xsd:token}?
+concurrency-control.attlist &=
+ ## Allows injection of the SessionInformationExpiredStrategy instance used by the ConcurrentSessionFilter
+ attribute expired-session-strategy-ref {xsd:token}?
+concurrency-control.attlist &=
+ ## Specifies that an unauthorized error should be reported when a user attempts to login when they already have the maximum configured sessions open. The default behaviour is to expire the original session. If the session-authentication-error-url attribute is set on the session-management URL, the user will be redirected to this URL.
+ attribute error-if-maximum-exceeded {xsd:boolean}?
+concurrency-control.attlist &=
+ ## Allows you to define an alias for the SessionRegistry bean in order to access it in your own configuration.
+ attribute session-registry-alias {xsd:token}?
+concurrency-control.attlist &=
+ ## Allows you to define an external SessionRegistry bean to be used by the concurrency control setup.
+ attribute session-registry-ref {xsd:token}?
+
+
+remember-me =
+ ## Sets up remember-me authentication. If used with the "key" attribute (or no attributes) the cookie-only implementation will be used. Specifying "token-repository-ref" or "remember-me-data-source-ref" will use the more secure, persisten token approach.
+ element remember-me {remember-me.attlist}
+remember-me.attlist &=
+ ## The "key" used to identify cookies from a specific token-based remember-me application. You should set this to a unique value for your application. If unset, it will default to a random value generated by SecureRandom.
+ attribute key {xsd:token}?
+
+remember-me.attlist &=
+ (token-repository-ref | remember-me-data-source-ref | remember-me-services-ref)
+
+remember-me.attlist &=
+ user-service-ref?
+
+remember-me.attlist &=
+ ## Exports the internally defined RememberMeServices as a bean alias, allowing it to be used by other beans in the application context.
+ attribute services-alias {xsd:token}?
+
+remember-me.attlist &=
+ ## Determines whether the "secure" flag will be set on the remember-me cookie. If set to true, the cookie will only be submitted over HTTPS (recommended). By default, secure cookies will be used if the request is made on a secure connection.
+ attribute use-secure-cookie {xsd:boolean}?
+
+remember-me.attlist &=
+ ## The period (in seconds) for which the remember-me cookie should be valid.
+ attribute token-validity-seconds {xsd:string}?
+
+remember-me.attlist &=
+ ## Reference to an AuthenticationSuccessHandler bean which should be used to handle a successful remember-me authentication.
+ attribute authentication-success-handler-ref {xsd:token}?
+remember-me.attlist &=
+ ## The name of the request parameter which toggles remember-me authentication. Defaults to 'remember-me'.
+ attribute remember-me-parameter {xsd:token}?
+remember-me.attlist &=
+ ## The name of cookie which store the token for remember-me authentication. Defaults to 'remember-me'.
+ attribute remember-me-cookie {xsd:token}?
+
+token-repository-ref =
+ ## Reference to a PersistentTokenRepository bean for use with the persistent token remember-me implementation.
+ attribute token-repository-ref {xsd:token}
+remember-me-services-ref =
+ ## Allows a custom implementation of RememberMeServices to be used. Note that this implementation should return RememberMeAuthenticationToken instances with the same "key" value as specified in the remember-me element. Alternatively it should register its own AuthenticationProvider. It should also implement the LogoutHandler interface, which will be invoked when a user logs out. Typically the remember-me cookie would be removed on logout.
+ attribute services-ref {xsd:token}?
+remember-me-data-source-ref =
+ ## DataSource bean for the database that contains the token repository schema.
+ data-source-ref
+
+anonymous =
+ ## Adds support for automatically granting all anonymous web requests a particular principal identity and a corresponding granted authority.
+ element anonymous {anonymous.attlist}
+anonymous.attlist &=
+ ## The key shared between the provider and filter. This generally does not need to be set. If unset, it will default to a random value generated by SecureRandom.
+ attribute key {xsd:token}?
+anonymous.attlist &=
+ ## The username that should be assigned to the anonymous request. This allows the principal to be identified, which may be important for logging and auditing. if unset, defaults to "anonymousUser".
+ attribute username {xsd:token}?
+anonymous.attlist &=
+ ## The granted authority that should be assigned to the anonymous request. Commonly this is used to assign the anonymous request particular roles, which can subsequently be used in authorization decisions. If unset, defaults to "ROLE_ANONYMOUS".
+ attribute granted-authority {xsd:token}?
+anonymous.attlist &=
+ ## With the default namespace setup, the anonymous "authentication" facility is automatically enabled. You can disable it using this property.
+ attribute enabled {xsd:boolean}?
+
+
+port-mappings =
+ ## Defines the list of mappings between http and https ports for use in redirects
+ element port-mappings {port-mappings.attlist, port-mapping+}
+
+port-mappings.attlist &= empty
+
+port-mapping =
+ ## Provides a method to map http ports to https ports when forcing a redirect.
+ element port-mapping {http-port, https-port}
+
+http-port =
+ ## The http port to use.
+ attribute http {xsd:token}
+
+https-port =
+ ## The https port to use.
+ attribute https {xsd:token}
+
+
+x509 =
+ ## Adds support for X.509 client authentication.
+ element x509 {x509.attlist}
+x509.attlist &=
+ ## The regular expression used to obtain the username from the certificate's subject. Defaults to matching on the common name using the pattern "CN=(.*?),".
+ attribute subject-principal-regex {xsd:token}?
+x509.attlist &=
+ ## Explicitly specifies which user-service should be used to load user data for X.509 authenticated clients. If ommitted, the default user-service will be used.
+ user-service-ref?
+x509.attlist &=
+ ## Reference to an AuthenticationDetailsSource which will be used by the authentication filter
+ attribute authentication-details-source-ref {xsd:token}?
+
+jee =
+ ## Adds a J2eePreAuthenticatedProcessingFilter to the filter chain to provide integration with container authentication.
+ element jee {jee.attlist}
+jee.attlist &=
+ ## A comma-separate list of roles to look for in the incoming HttpServletRequest.
+ attribute mappable-roles {xsd:token}
+jee.attlist &=
+ ## Explicitly specifies which user-service should be used to load user data for container authenticated clients. If ommitted, the set of mappable-roles will be used to construct the authorities for the user.
+ user-service-ref?
+
+authentication-manager =
+ ## Registers the AuthenticationManager instance and allows its list of AuthenticationProviders to be defined. Also allows you to define an alias to allow you to reference the AuthenticationManager in your own beans.
+ element authentication-manager {authman.attlist & authentication-provider* & ldap-authentication-provider*}
+authman.attlist &=
+ id?
+authman.attlist &=
+ ## An alias you wish to use for the AuthenticationManager bean (not required it you are using a specific id)
+ attribute alias {xsd:token}?
+authman.attlist &=
+ ## If set to true, the AuthenticationManger will attempt to clear any credentials data in the returned Authentication object, once the user has been authenticated.
+ attribute erase-credentials {xsd:boolean}?
+
+authentication-provider =
+ ## Indicates that the contained user-service should be used as an authentication source.
+ element authentication-provider {ap.attlist & any-user-service & password-encoder?}
+ap.attlist &=
+ ## Specifies a reference to a separately configured AuthenticationProvider instance which should be registered within the AuthenticationManager.
+ ref?
+ap.attlist &=
+ ## Specifies a reference to a separately configured UserDetailsService from which to obtain authentication data.
+ user-service-ref?
+
+user-service =
+ ## Creates an in-memory UserDetailsService from a properties file or a list of "user" child elements. Usernames are converted to lower-case internally to allow for case-insensitive lookups, so this should not be used if case-sensitivity is required.
+ element user-service {id? & (properties-file | (user*))}
+properties-file =
+ ## The location of a Properties file where each line is in the format of username=password,grantedAuthority[,grantedAuthority][,enabled|disabled]
+ attribute properties {xsd:token}?
+
+user =
+ ## Represents a user in the application.
+ element user {user.attlist, empty}
+user.attlist &=
+ ## The username assigned to the user.
+ attribute name {xsd:token}
+user.attlist &=
+ ## The password assigned to the user. This may be hashed if the corresponding authentication provider supports hashing (remember to set the "hash" attribute of the "user-service" element). This attribute be omitted in the case where the data will not be used for authentication, but only for accessing authorities. If omitted, the namespace will generate a random value, preventing its accidental use for authentication. Cannot be empty.
+ attribute password {xsd:string}?
+user.attlist &=
+ ## One of more authorities granted to the user. Separate authorities with a comma (but no space). For example, "ROLE_USER,ROLE_ADMINISTRATOR"
+ attribute authorities {xsd:token}
+user.attlist &=
+ ## Can be set to "true" to mark an account as locked and unusable.
+ attribute locked {xsd:boolean}?
+user.attlist &=
+ ## Can be set to "true" to mark an account as disabled and unusable.
+ attribute disabled {xsd:boolean}?
+
+jdbc-user-service =
+ ## Causes creation of a JDBC-based UserDetailsService.
+ element jdbc-user-service {id? & jdbc-user-service.attlist}
+jdbc-user-service.attlist &=
+ ## The bean ID of the DataSource which provides the required tables.
+ attribute data-source-ref {xsd:token}
+jdbc-user-service.attlist &=
+ cache-ref?
+jdbc-user-service.attlist &=
+ ## An SQL statement to query a username, password, and enabled status given a username. Default is "select username,password,enabled from users where username = ?"
+ attribute users-by-username-query {xsd:token}?
+jdbc-user-service.attlist &=
+ ## An SQL statement to query for a user's granted authorities given a username. The default is "select username, authority from authorities where username = ?"
+ attribute authorities-by-username-query {xsd:token}?
+jdbc-user-service.attlist &=
+ ## An SQL statement to query user's group authorities given a username. The default is "select g.id, g.group_name, ga.authority from groups g, group_members gm, group_authorities ga where gm.username = ? and g.id = ga.group_id and g.id = gm.group_id"
+ attribute group-authorities-by-username-query {xsd:token}?
+jdbc-user-service.attlist &=
+ role-prefix?
+
+csrf =
+## Element for configuration of the CsrfFilter for protection against CSRF. It also updates the default RequestCache to only replay "GET" requests.
+ element csrf {csrf-options.attlist}
+csrf-options.attlist &=
+ ## Specifies if csrf protection should be disabled. Default false (i.e. CSRF protection is enabled).
+ attribute disabled {xsd:boolean}?
+csrf-options.attlist &=
+ ## The RequestMatcher instance to be used to determine if CSRF should be applied. Default is any HTTP method except "GET", "TRACE", "HEAD", "OPTIONS"
+ attribute request-matcher-ref { xsd:token }?
+csrf-options.attlist &=
+ ## The CsrfTokenRepository to use. The default is HttpSessionCsrfTokenRepository wrapped by LazyCsrfTokenRepository.
+ attribute token-repository-ref { xsd:token }?
+
+headers =
+## Element for configuration of the HeaderWritersFilter. Enables easy setting for the X-Frame-Options, X-XSS-Protection and X-Content-Type-Options headers.
+element headers { headers-options.attlist, (cache-control? & xss-protection? & hsts? & frame-options? & content-type-options? & hpkp? & content-security-policy? & referrer-policy? & feature-policy? & permissions-policy? & header*)}
+headers-options.attlist &=
+ ## Specifies if the default headers should be disabled. Default false.
+ attribute defaults-disabled {xsd:token}?
+headers-options.attlist &=
+ ## Specifies if headers should be disabled. Default false.
+ attribute disabled {xsd:token}?
+hsts =
+ ## Adds support for HTTP Strict Transport Security (HSTS)
+ element hsts {hsts-options.attlist}
+hsts-options.attlist &=
+ ## Specifies if HTTP Strict Transport Security (HSTS) should be disabled. Default false.
+ attribute disabled {xsd:boolean}?
+hsts-options.attlist &=
+ ## Specifies if subdomains should be included. Default true.
+ attribute include-subdomains {xsd:boolean}?
+hsts-options.attlist &=
+ ## Specifies the maximum amount of time the host should be considered a Known HSTS Host. Default one year.
+ attribute max-age-seconds {xsd:integer}?
+hsts-options.attlist &=
+ ## The RequestMatcher instance to be used to determine if the header should be set. Default is if HttpServletRequest.isSecure() is true.
+ attribute request-matcher-ref { xsd:token }?
+hsts-options.attlist &=
+ ## Specifies if preload should be included. Default false.
+ attribute preload {xsd:boolean}?
+
+cors =
+## Element for configuration of CorsFilter. If no CorsFilter or CorsConfigurationSource is specified a HandlerMappingIntrospector is used as the CorsConfigurationSource
+element cors { cors-options.attlist }
+cors-options.attlist &=
+ ref?
+cors-options.attlist &=
+ ## Specifies a bean id that is a CorsConfigurationSource used to construct the CorsFilter to use
+ attribute configuration-source-ref {xsd:token}?
+
+hpkp =
+ ## Adds support for HTTP Public Key Pinning (HPKP).
+ element hpkp {hpkp.pins,hpkp.attlist}
+hpkp.pins =
+ ## The list with pins
+ element pins {hpkp.pin+}
+hpkp.pin =
+ ## A pin is specified using the base64-encoded SPKI fingerprint as value and the cryptographic hash algorithm as attribute
+ element pin {
+ ## The cryptographic hash algorithm
+ attribute algorithm { xsd:string }?,
+ text
+ }
+hpkp.attlist &=
+ ## Specifies if HTTP Public Key Pinning (HPKP) should be disabled. Default false.
+ attribute disabled {xsd:boolean}?
+hpkp.attlist &=
+ ## Specifies if subdomains should be included. Default false.
+ attribute include-subdomains {xsd:boolean}?
+hpkp.attlist &=
+ ## Sets the value for the max-age directive of the Public-Key-Pins header. Default 60 days.
+ attribute max-age-seconds {xsd:integer}?
+hpkp.attlist &=
+ ## Specifies if the browser should only report pin validation failures. Default true.
+ attribute report-only {xsd:boolean}?
+hpkp.attlist &=
+ ## Specifies the URI to which the browser should report pin validation failures.
+ attribute report-uri {xsd:string}?
+
+content-security-policy =
+ ## Adds support for Content Security Policy (CSP)
+ element content-security-policy {csp-options.attlist}
+csp-options.attlist &=
+ ## The security policy directive(s) for the Content-Security-Policy header or if report-only is set to true, then the Content-Security-Policy-Report-Only header is used.
+ attribute policy-directives {xsd:token}?
+csp-options.attlist &=
+ ## Set to true, to enable the Content-Security-Policy-Report-Only header for reporting policy violations only. Defaults to false.
+ attribute report-only {xsd:boolean}?
+
+referrer-policy =
+ ## Adds support for Referrer Policy
+ element referrer-policy {referrer-options.attlist}
+referrer-options.attlist &=
+ ## The policies for the Referrer-Policy header.
+ attribute policy {"no-referrer","no-referrer-when-downgrade","same-origin","origin","strict-origin","origin-when-cross-origin","strict-origin-when-cross-origin","unsafe-url"}?
+
+feature-policy =
+ ## Adds support for Feature Policy
+ element feature-policy {feature-options.attlist}
+feature-options.attlist &=
+ ## The security policy directive(s) for the Feature-Policy header.
+ attribute policy-directives {xsd:token}?
+
+permissions-policy =
+ ## Adds support for Permissions Policy
+ element permissions-policy {permissions-options.attlist}
+permissions-options.attlist &=
+ ## The policies for the Permissions-Policy header.
+ attribute policy {xsd:token}?
+
+cache-control =
+ ## Adds Cache-Control no-cache, no-store, must-revalidate, Pragma no-cache, and Expires 0 for every request
+ element cache-control {cache-control.attlist}
+cache-control.attlist &=
+ ## Specifies if Cache Control should be disabled. Default false.
+ attribute disabled {xsd:boolean}?
+
+frame-options =
+ ## Enable basic clickjacking support for newer browsers (IE8+), will set the X-Frame-Options header.
+ element frame-options {frame-options.attlist,empty}
+frame-options.attlist &=
+ ## If disabled, the X-Frame-Options header will not be included. Default false.
+ attribute disabled {xsd:boolean}?
+frame-options.attlist &=
+ ## Specify the policy to use for the X-Frame-Options-Header.
+ attribute policy {"DENY","SAMEORIGIN","ALLOW-FROM"}?
+frame-options.attlist &=
+ ## Specify the strategy to use when ALLOW-FROM is chosen.
+ attribute strategy {"static","whitelist","regexp"}?
+frame-options.attlist &=
+ ## Specify a reference to the custom AllowFromStrategy to use when ALLOW-FROM is chosen.
+ ref?
+frame-options.attlist &=
+ ## Specify a value to use for the chosen strategy.
+ attribute value {xsd:string}?
+frame-options.attlist &=
+ ## Specify the request parameter to use for the origin when using a 'whitelist' or 'regexp' based strategy. Default is 'from'.
+ ## Deprecated ALLOW-FROM is an obsolete directive that no longer works in modern browsers. Instead use
+ ## Content-Security-Policy with the
+ ## frame-ancestors
+ ## directive.
+ attribute from-parameter {xsd:string}?
+
+
+xss-protection =
+ ## Enable basic XSS browser protection, supported by newer browsers (IE8+), will set the X-XSS-Protection header.
+ element xss-protection {xss-protection.attlist,empty}
+xss-protection.attlist &=
+ ## disable the X-XSS-Protection header. Default is 'false' meaning it is enabled.
+ attribute disabled {xsd:boolean}?
+xss-protection.attlist &=
+ ## specify that XSS Protection should be explicitly enabled or disabled. Default is 'true' meaning it is enabled.
+ attribute enabled {xsd:boolean}?
+xss-protection.attlist &=
+ ## Add mode=block to the header or not, default is on.
+ attribute block {xsd:boolean}?
+
+content-type-options =
+ ## Add a X-Content-Type-Options header to the resopnse. Value is always 'nosniff'.
+ element content-type-options {content-type-options.attlist, empty}
+content-type-options.attlist &=
+ ## If disabled, the X-Content-Type-Options header will not be included. Default false.
+ attribute disabled {xsd:boolean}?
+
+header=
+ ## Add additional headers to the response.
+ element header {header.attlist}
+header.attlist &=
+ ## The name of the header to add.
+ attribute name {xsd:token}?
+header.attlist &=
+ ## The value for the header.
+ attribute value {xsd:token}?
+header.attlist &=
+ ## Reference to a custom HeaderWriter implementation.
+ ref?
+
+any-user-service = user-service | jdbc-user-service | ldap-user-service
+
+custom-filter =
+ ## Used to indicate that a filter bean declaration should be incorporated into the security filter chain.
+ element custom-filter {custom-filter.attlist}
+
+custom-filter.attlist &=
+ ref
+
+custom-filter.attlist &=
+ (after | before | position)
+
+after =
+ ## The filter immediately after which the custom-filter should be placed in the chain. This feature will only be needed by advanced users who wish to mix their own filters into the security filter chain and have some knowledge of the standard Spring Security filters. The filter names map to specific Spring Security implementation filters.
+ attribute after {named-security-filter}
+before =
+ ## The filter immediately before which the custom-filter should be placed in the chain
+ attribute before {named-security-filter}
+position =
+ ## The explicit position at which the custom-filter should be placed in the chain. Use if you are replacing a standard filter.
+ attribute position {named-security-filter}
+
+named-security-filter = "FIRST" | "CHANNEL_FILTER" | "SECURITY_CONTEXT_FILTER" | "CONCURRENT_SESSION_FILTER" | "WEB_ASYNC_MANAGER_FILTER" | "HEADERS_FILTER" | "CORS_FILTER" | "CSRF_FILTER" | "LOGOUT_FILTER" | "OAUTH2_AUTHORIZATION_REQUEST_FILTER" | "X509_FILTER" | "PRE_AUTH_FILTER" | "CAS_FILTER" | "OAUTH2_LOGIN_FILTER" | "FORM_LOGIN_FILTER" | "OPENID_FILTER" | "LOGIN_PAGE_FILTER" |"LOGOUT_PAGE_FILTER" | "DIGEST_AUTH_FILTER" | "BEARER_TOKEN_AUTH_FILTER" | "BASIC_AUTH_FILTER" | "REQUEST_CACHE_FILTER" | "SERVLET_API_SUPPORT_FILTER" | "JAAS_API_SUPPORT_FILTER" | "REMEMBER_ME_FILTER" | "ANONYMOUS_FILTER" | "OAUTH2_AUTHORIZATION_CODE_GRANT_FILTER" | "WELL_KNOWN_CHANGE_PASSWORD_REDIRECT_FILTER" | "SESSION_MANAGEMENT_FILTER" | "EXCEPTION_TRANSLATION_FILTER" | "FILTER_SECURITY_INTERCEPTOR" | "SWITCH_USER_FILTER" | "LAST"
diff --git a/config/src/main/resources/org/springframework/security/config/spring-security-6.0.xsd b/config/src/main/resources/org/springframework/security/config/spring-security-6.0.xsd
new file mode 100644
index 00000000000..0297b1bafed
--- /dev/null
+++ b/config/src/main/resources/org/springframework/security/config/spring-security-6.0.xsd
@@ -0,0 +1,3284 @@
+
+
+
+
+
+ Defines the hashing algorithm used on user passwords. Bcrypt is recommended.
+
+
+
+
+
+
+
+
+
+
+
+
+ Whether a string should be base64 encoded
+
+
+
+
+
+
+
+ Defines the strategy use for matching incoming requests. Currently the options are 'mvc'
+ (for Spring MVC matcher), 'ant' (for ant path patterns), 'regex' for regular expressions
+ and 'ciRegex' for case-insensitive regular expressions.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Specifies an IP port number. Used to configure an embedded LDAP server, for example.
+
+
+
+
+
+
+
+ Specifies a URL.
+
+
+
+
+
+
+
+ A bean identifier, used for referring to the bean elsewhere in the context.
+
+
+
+
+
+
+
+ A bean identifier, used for referring to the bean elsewhere in the context.
+
+
+
+
+
+
+
+ Defines a reference to a Spring bean Id.
+
+
+
+
+
+
+
+ Defines a reference to a cache for use with a UserDetailsService.
+
+
+
+
+
+
+
+ A reference to a user-service (or UserDetailsService bean) Id
+
+
+
+
+
+
+
+ A reference to an AuthenticationManager bean
+
+
+
+
+
+
+
+ A reference to a DataSource bean
+
+
+
+
+
+
+ Enables Spring Security debugging infrastructure. This will provide human-readable
+ (multi-line) debugging information to monitor requests coming into the security filters.
+ This may include sensitive information, such as request parameters or headers, and should
+ only be used in a development environment.
+
+
+
+
+
+
+
+
+ Defines a reference to a Spring bean Id.
+
+
+
+
+
+ Defines the hashing algorithm used on user passwords. Bcrypt is recommended.
+
+
+
+
+
+
+
+
+
+
+
+
+ A non-empty string prefix that will be added to role strings loaded from persistent
+ storage (e.g. "ROLE_"). Use the value "none" for no prefix in cases where the default is
+ non-empty.
+
+
+
+
+
+
+
+ Enables the use of expressions in the 'access' attributes in <intercept-url> elements
+ rather than the traditional list of configuration attributes. Defaults to 'true'. If
+ enabled, each attribute should contain a single boolean expression. If the expression
+ evaluates to 'true', access will be granted.
+
+
+
+
+
+
+ Defines an LDAP server location or starts an embedded server. The url indicates the
+ location of a remote server. If no url is given, an embedded server will be started,
+ listening on the supplied port number. The port is optional and defaults to 33389. A
+ Spring LDAP ContextSource bean will be registered for the server with the id supplied.
+
+
+
+
+
+
+
+
+
+ A bean identifier, used for referring to the bean elsewhere in the context.
+
+
+
+
+
+ Specifies a URL.
+
+
+
+
+
+ Specifies an IP port number. Used to configure an embedded LDAP server, for example.
+
+
+
+
+
+ Username (DN) of the "manager" user identity which will be used to authenticate to a
+ (non-embedded) LDAP server. If omitted, anonymous access will be used.
+
+
+
+
+
+ The password for the manager DN. This is required if the manager-dn is specified.
+
+
+
+
+
+ Explicitly specifies an ldif file resource to load into an embedded LDAP server. The
+ default is classpath*:*.ldiff
+
+
+
+
+
+ Optional root suffix for the embedded LDAP server. Default is "dc=springframework,dc=org"
+
+
+
+
+
+ Explicitly specifies which embedded ldap server should use. Values are 'apacheds' and
+ 'unboundid'. By default, it will depends if the library is available in the classpath.
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The optional server to use. If omitted, and a default LDAP server is registered (using
+ <ldap-server> with no Id), that server will be used.
+
+
+
+
+
+
+
+ Group search filter. Defaults to (uniqueMember={0}). The substituted parameter is the DN
+ of the user.
+
+
+
+
+
+
+
+ Search base for group membership searches. Defaults to "" (searching from the root).
+
+
+
+
+
+
+
+ The LDAP filter used to search for users (optional). For example "(uid={0})". The
+ substituted parameter is the user's login name.
+
+
+
+
+
+
+
+ Search base for user searches. Defaults to "". Only used with a 'user-search-filter'.
+
+
+
+
+
+
+
+ The LDAP attribute name which contains the role name which will be used within Spring
+ Security. Defaults to "cn".
+
+
+
+
+
+
+
+ Allows the objectClass of the user entry to be specified. If set, the framework will
+ attempt to load standard attributes for the defined class into the returned UserDetails
+ object
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Allows explicit customization of the loaded user object by specifying a
+ UserDetailsContextMapper bean which will be called with the context information from the
+ user's directory entry
+
+
+
+
+
+
+ This element configures a LdapUserDetailsService which is a combination of a
+ FilterBasedLdapUserSearch and a DefaultLdapAuthoritiesPopulator.
+
+
+
+
+
+
+
+
+
+ A bean identifier, used for referring to the bean elsewhere in the context.
+
+
+
+
+
+ The optional server to use. If omitted, and a default LDAP server is registered (using
+ <ldap-server> with no Id), that server will be used.
+
+
+
+
+
+ The LDAP filter used to search for users (optional). For example "(uid={0})". The
+ substituted parameter is the user's login name.
+
+
+
+
+
+ Search base for user searches. Defaults to "". Only used with a 'user-search-filter'.
+
+
+
+
+
+ Group search filter. Defaults to (uniqueMember={0}). The substituted parameter is the DN
+ of the user.
+
+
+
+
+
+ Search base for group membership searches. Defaults to "" (searching from the root).
+
+
+
+
+
+ The LDAP attribute name which contains the role name which will be used within Spring
+ Security. Defaults to "cn".
+
+
+
+
+
+ Defines a reference to a cache for use with a UserDetailsService.
+
+
+
+
+
+ A non-empty string prefix that will be added to role strings loaded from persistent
+ storage (e.g. "ROLE_"). Use the value "none" for no prefix in cases where the default is
+ non-empty.
+
+
+
+
+
+ Allows the objectClass of the user entry to be specified. If set, the framework will
+ attempt to load standard attributes for the defined class into the returned UserDetails
+ object
+
+
+
+
+
+
+
+
+
+
+
+ Allows explicit customization of the loaded user object by specifying a
+ UserDetailsContextMapper bean which will be called with the context information from the
+ user's directory entry
+
+
+
+
+
+
+
+
+ The optional server to use. If omitted, and a default LDAP server is registered (using
+ <ldap-server> with no Id), that server will be used.
+
+
+
+
+
+ Search base for user searches. Defaults to "". Only used with a 'user-search-filter'.
+
+
+
+
+
+ The LDAP filter used to search for users (optional). For example "(uid={0})". The
+ substituted parameter is the user's login name.
+
+
+
+
+
+ Search base for group membership searches. Defaults to "" (searching from the root).
+
+
+
+
+
+ Group search filter. Defaults to (uniqueMember={0}). The substituted parameter is the DN
+ of the user.
+
+
+
+
+
+ The LDAP attribute name which contains the role name which will be used within Spring
+ Security. Defaults to "cn".
+
+
+
+
+
+ A specific pattern used to build the user's DN, for example "uid={0},ou=people". The key
+ "{0}" must be present and will be substituted with the username.
+
+
+
+
+
+ A non-empty string prefix that will be added to role strings loaded from persistent
+ storage (e.g. "ROLE_"). Use the value "none" for no prefix in cases where the default is
+ non-empty.
+
+
+
+
+
+ Allows the objectClass of the user entry to be specified. If set, the framework will
+ attempt to load standard attributes for the defined class into the returned UserDetails
+ object
+
+
+
+
+
+
+
+
+
+
+
+ Allows explicit customization of the loaded user object by specifying a
+ UserDetailsContextMapper bean which will be called with the context information from the
+ user's directory entry
+
+
+
+
+
+
+
+
+ The attribute in the directory which contains the user password. Defaults to
+ "userPassword".
+
+
+
+
+
+ Defines the hashing algorithm used on user passwords. Bcrypt is recommended.
+
+
+
+
+
+
+
+
+
+
+
+ Can be used inside a bean definition to add a security interceptor to the bean and set up
+ access configuration attributes for the bean's methods
+
+
+
+
+
+
+ Defines a protected method and the access control configuration attributes that apply to
+ it. We strongly advise you NOT to mix "protect" declarations with any services provided
+ "global-method-security".
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Optional AccessDecisionManager bean ID to be used by the created method security
+ interceptor.
+
+
+
+
+
+
+
+
+ A method name
+
+
+
+
+
+ Access configuration attributes list that applies to the method, e.g. "ROLE_A,ROLE_B".
+
+
+
+
+
+
+ Creates a MethodSecurityMetadataSource instance
+
+
+
+
+
+
+ Defines a protected method and the access control configuration attributes that apply to
+ it. We strongly advise you NOT to mix "protect" declarations with any services provided
+ "global-method-security".
+
+
+
+
+
+
+
+
+
+
+
+
+
+ A bean identifier, used for referring to the bean elsewhere in the context.
+
+
+
+
+
+ Enables the use of expressions in the 'access' attributes in <intercept-url> elements
+ rather than the traditional list of configuration attributes. Defaults to 'true'. If
+ enabled, each attribute should contain a single boolean expression. If the expression
+ evaluates to 'true', access will be granted.
+
+
+
+
+
+
+ Provides method security for all beans registered in the Spring application context.
+ Specifically, beans will be scanned for matches with Spring Security annotations. Where
+ there is a match, the beans will automatically be proxied and security authorization
+ applied to the methods accordingly. Interceptors are invoked in the order specified in
+ AuthorizationInterceptorsOrder. Use can create your own interceptors using Spring AOP.
+
+
+
+
+
+
+ Defines the SecurityExpressionHandler instance which will be used if expression-based
+ access-control is enabled. A default implementation (with no ACL support) will be used if
+ not supplied.
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Specifies whether the use of Spring Security's pre and post invocation annotations
+ (@PreFilter, @PreAuthorize, @PostFilter, @PostAuthorize) should be enabled for this
+ application context. Defaults to "true".
+
+
+
+
+
+ Specifies whether the use of Spring Security's @Secured annotations should be enabled for
+ this application context. Defaults to "false".
+
+
+
+
+
+ Specifies whether JSR-250 style attributes are to be used (for example "RolesAllowed").
+ This will require the javax.annotation.security classes on the classpath. Defaults to
+ "false".
+
+
+
+
+
+ If true, class-based proxying will be used instead of interface-based proxying.
+
+
+
+
+
+
+ Provides method security for all beans registered in the Spring application context.
+ Specifically, beans will be scanned for matches with the ordered list of
+ "protect-pointcut" sub-elements, Spring Security annotations and/or. Where there is a
+ match, the beans will automatically be proxied and security authorization applied to the
+ methods accordingly. If you use and enable all four sources of method security metadata
+ (ie "protect-pointcut" declarations, expression annotations, @Secured and also JSR250
+ security annotations), the metadata sources will be queried in that order. In practical
+ terms, this enables you to use XML to override method security metadata expressed in
+ annotations. If using annotations, the order of precedence is EL-based (@PreAuthorize
+ etc.), @Secured and finally JSR-250.
+
+
+
+
+
+
+
+ Allows the default expression-based mechanism for handling Spring Security's pre and post
+ invocation annotations (@PreFilter, @PreAuthorize, @PostFilter, @PostAuthorize) to be
+ replace entirely. Only applies if these annotations are enabled.
+
+
+
+
+
+
+ Defines the PrePostInvocationAttributeFactory instance which is used to generate pre and
+ post invocation metadata from the annotated methods.
+
+
+
+
+
+
+
+
+ Customizes the PreInvocationAuthorizationAdviceVoter with the ref as the
+ PreInvocationAuthorizationAdviceVoter for the <pre-post-annotation-handling> element.
+
+
+
+
+
+
+
+
+ Customizes the PostInvocationAdviceProvider with the ref as the
+ PostInvocationAuthorizationAdvice for the <pre-post-annotation-handling> element.
+
+
+
+
+
+
+
+
+
+
+
+ Defines the SecurityExpressionHandler instance which will be used if expression-based
+ access-control is enabled. A default implementation (with no ACL support) will be used if
+ not supplied.
+
+
+
+
+
+
+
+
+
+ Defines a protected pointcut and the access control configuration attributes that apply to
+ it. Every bean registered in the Spring application context that provides a method that
+ matches the pointcut will receive security authorization.
+
+
+
+
+
+
+
+
+ Allows addition of extra AfterInvocationProvider beans which should be called by the
+ MethodSecurityInterceptor created by global-method-security.
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Specifies whether the use of Spring Security's pre and post invocation annotations
+ (@PreFilter, @PreAuthorize, @PostFilter, @PostAuthorize) should be enabled for this
+ application context. Defaults to "disabled".
+
+
+
+
+
+
+
+
+
+
+
+ Specifies whether the use of Spring Security's @Secured annotations should be enabled for
+ this application context. Defaults to "disabled".
+
+
+
+
+
+
+
+
+
+
+
+ Specifies whether JSR-250 style attributes are to be used (for example "RolesAllowed").
+ This will require the javax.annotation.security classes on the classpath. Defaults to
+ "disabled".
+
+
+
+
+
+
+
+
+
+
+
+ Optional AccessDecisionManager bean ID to override the default used for method security.
+
+
+
+
+
+ Optional RunAsmanager implementation which will be used by the configured
+ MethodSecurityInterceptor
+
+
+
+
+
+ Allows the advice "order" to be set for the method security interceptor.
+
+
+
+
+
+ If true, class based proxying will be used instead of interface based proxying.
+
+
+
+
+
+ Can be used to specify that AspectJ should be used instead of the default Spring AOP. If
+ set, secured classes must be woven with the AnnotationSecurityAspect from the
+ spring-security-aspects module.
+
+
+
+
+
+
+
+
+
+
+ An external MethodSecurityMetadataSource instance can be supplied which will take priority
+ over other sources (such as the default annotations).
+
+
+
+
+
+ A reference to an AuthenticationManager bean
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ An AspectJ expression, including the 'execution' keyword. For example, 'execution(int
+ com.foo.TargetObject.countLength(String))' (without the quotes).
+
+
+
+
+
+ Access configuration attributes list that applies to all methods matching the pointcut,
+ e.g. "ROLE_A,ROLE_B"
+
+
+
+
+
+
+ Allows securing a Message Broker. There are two modes. If no id is specified: ensures that
+ any SimpAnnotationMethodMessageHandler has the AuthenticationPrincipalArgumentResolver
+ registered as a custom argument resolver; ensures that the
+ SecurityContextChannelInterceptor is automatically registered for the
+ clientInboundChannel; and that a ChannelSecurityInterceptor is registered with the
+ clientInboundChannel. If the id is specified, creates a ChannelSecurityInterceptor that
+ can be manually registered with the clientInboundChannel.
+
+
+
+
+
+
+
+ Defines the SecurityExpressionHandler instance which will be used if expression-based
+ access-control is enabled. A default implementation (with no ACL support) will be used if
+ not supplied.
+
+
+
+
+
+
+
+
+
+
+
+
+
+ A bean identifier, used for referring to the bean elsewhere in the context. If specified,
+ explicit configuration within clientInboundChannel is required. If not specified, ensures
+ that any SimpAnnotationMethodMessageHandler has the
+ AuthenticationPrincipalArgumentResolver registered as a custom argument resolver; ensures
+ that the SecurityContextChannelInterceptor is automatically registered for the
+ clientInboundChannel; and that a ChannelSecurityInterceptor is registered with the
+ clientInboundChannel.
+
+
+
+
+
+ Disables the requirement for CSRF token to be present in the Stomp headers (default
+ false). Changing the default is useful if it is necessary to allow other origins to make
+ SockJS connections.
+
+
+
+
+
+
+ Creates an authorization rule for a websocket message.
+
+
+
+
+
+
+
+
+
+ The destination ant pattern which will be mapped to the access attribute. For example, /**
+ matches any message with a destination, /admin/** matches any message that has a
+ destination that starts with admin.
+
+
+
+
+
+ The access configuration attributes that apply for the configured message. For example,
+ permitAll grants access to anyone, hasRole('ROLE_ADMIN') requires the user have the role
+ 'ROLE_ADMIN'.
+
+
+
+
+
+ The type of message to match on. Valid values are defined in SimpMessageType (i.e.
+ CONNECT, CONNECT_ACK, HEARTBEAT, MESSAGE, SUBSCRIBE, UNSUBSCRIBE, DISCONNECT,
+ DISCONNECT_ACK, OTHER).
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Allows a custom instance of HttpFirewall to be injected into the FilterChainProxy created
+ by the namespace.
+
+
+
+
+
+
+
+
+ Container element for HTTP security configuration. Multiple elements can now be defined,
+ each with a specific pattern to which the enclosed security configuration applies. A
+ pattern can also be configured to bypass Spring Security's filters completely by setting
+ the "security" attribute to "none".
+
+
+
+
+
+
+ Specifies the access attributes and/or filter list for a particular set of URLs.
+
+
+
+
+
+
+
+
+ Defines the access-denied strategy that should be used. An access denied page can be
+ defined or a reference to an AccessDeniedHandler instance.
+
+
+
+
+
+
+
+
+ Sets up a form login configuration for authentication with a username and password
+
+
+
+
+
+
+
+
+
+
+
+ Sets up form login for authentication with an Open ID identity. NOTE: The OpenID 1.0 and
+ 2.0 protocols have been deprecated and users are <a
+ href="https://openid.net/specs/openid-connect-migration-1_0.html">encouraged to
+ migrate</a> to <a href="https://openid.net/connect/">OpenID Connect</a>, which is
+ supported by <code>spring-security-oauth2</code>.
+
+
+
+
+
+
+
+
+
+ A reference to a user-service (or UserDetailsService bean) Id
+
+
+
+
+
+
+
+ Adds support for X.509 client authentication.
+
+
+
+
+
+
+
+
+
+ Adds support for basic authentication
+
+
+
+
+
+
+
+
+ Incorporates a logout processing filter. Most web applications require a logout filter,
+ although you may not require one if you write a controller to provider similar logic.
+
+
+
+
+
+
+
+
+
+ Session-management related functionality is implemented by the addition of a
+ SessionManagementFilter to the filter stack.
+
+
+
+
+
+
+ Enables concurrent session control, limiting the number of authenticated sessions a user
+ may have at the same time.
+
+
+
+
+
+
+
+
+
+
+
+
+ Sets up remember-me authentication. If used with the "key" attribute (or no attributes)
+ the cookie-only implementation will be used. Specifying "token-repository-ref" or
+ "remember-me-data-source-ref" will use the more secure, persisten token approach.
+
+
+
+
+
+
+
+
+ Adds support for automatically granting all anonymous web requests a particular principal
+ identity and a corresponding granted authority.
+
+
+
+
+
+
+
+
+ Defines the list of mappings between http and https ports for use in redirects
+
+
+
+
+
+
+ Provides a method to map http ports to https ports when forcing a redirect.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Defines the SecurityExpressionHandler instance which will be used if expression-based
+ access-control is enabled. A default implementation (with no ACL support) will be used if
+ not supplied.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The request URL pattern which will be mapped to the filter chain created by this <http>
+ element. If omitted, the filter chain will match all requests.
+
+
+
+
+
+ When set to 'none', requests matching the pattern attribute will be ignored by Spring
+ Security. No security filters will be applied and no SecurityContext will be available. If
+ set, the <http> element must be empty, with no children.
+
+
+
+
+
+
+
+
+
+
+ Allows a RequestMatcher instance to be used, as an alternative to pattern-matching.
+
+
+
+
+
+ A legacy attribute which automatically registers a login form, BASIC authentication and a
+ logout URL and logout services. If unspecified, defaults to "false". We'd recommend you
+ avoid using this and instead explicitly configure the services you require.
+
+
+
+
+
+ Enables the use of expressions in the 'access' attributes in <intercept-url> elements
+ rather than the traditional list of configuration attributes. Defaults to 'true'. If
+ enabled, each attribute should contain a single boolean expression. If the expression
+ evaluates to 'true', access will be granted.
+
+
+
+
+
+ Controls the eagerness with which an HTTP session is created by Spring Security classes.
+ If not set, defaults to "ifRequired". If "stateless" is used, this implies that the
+ application guarantees that it will not create a session. This differs from the use of
+ "never" which means that Spring Security will not create a session, but will make use of
+ one if the application does.
+
+
+
+
+
+
+
+
+
+
+
+
+
+ A reference to a SecurityContextRepository bean. This can be used to customize how the
+ SecurityContext is stored between requests.
+
+
+
+
+
+ Defines the strategy use for matching incoming requests. Currently the options are 'mvc'
+ (for Spring MVC matcher), 'ant' (for ant path patterns), 'regex' for regular expressions
+ and 'ciRegex' for case-insensitive regular expressions.
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Provides versions of HttpServletRequest security methods such as isUserInRole() and
+ getPrincipal() which are implemented by accessing the Spring SecurityContext. Defaults to
+ "true".
+
+
+
+
+
+ If available, runs the request as the Subject acquired from the JaasAuthenticationToken.
+ Defaults to "false".
+
+
+
+
+
+ Optional attribute specifying the ID of the AccessDecisionManager implementation which
+ should be used for authorizing HTTP requests.
+
+
+
+
+
+ Optional attribute specifying the realm name that will be used for all authentication
+ features that require a realm name (eg BASIC and Digest authentication). If unspecified,
+ defaults to "Spring Security Application".
+
+
+
+
+
+ Allows a customized AuthenticationEntryPoint to be set on the ExceptionTranslationFilter.
+
+
+
+
+
+ Corresponds to the observeOncePerRequest property of FilterSecurityInterceptor. Defaults
+ to "true"
+
+
+
+
+
+ Prevents the jsessionid parameter from being added to rendered URLs. Defaults to "true"
+ (rewriting is disabled).
+
+
+
+
+
+ A bean identifier, used for referring to the bean elsewhere in the context.
+
+
+
+
+
+ A reference to an AuthenticationManager bean
+
+
+
+
+
+
+
+
+ Defines a reference to a Spring bean Id.
+
+
+
+
+
+ The access denied page that an authenticated user will be redirected to if they request a
+ page which they don't have the authority to access.
+
+
+
+
+
+
+
+ The access denied page that an authenticated user will be redirected to if they request a
+ page which they don't have the authority to access.
+
+
+
+
+
+
+
+
+ The request URL pattern which will be mapped to the FilterChain.
+
+
+
+
+
+ Allows a RequestMatcher instance to be used, as an alternative to pattern-matching.
+
+
+
+
+
+ The access configuration attributes that apply for the configured path.
+
+
+
+
+
+ The HTTP Method for which the access configuration attributes should apply. If not
+ specified, the attributes will apply to any method.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Used to specify that a URL must be accessed over http or https, or that there is no
+ preference. The value should be "http", "https" or "any", respectively.
+
+
+
+
+
+ The path to the servlet. This attribute is only applicable when 'request-matcher' is
+ 'mvc'. In addition, the value is only required in the following 2 use cases: 1) There are
+ 2 or more HttpServlet's registered in the ServletContext that have mappings starting with
+ '/' and are different; 2) The pattern starts with the same value of a registered
+ HttpServlet path, excluding the default (root) HttpServlet '/'.
+
+
+
+
+
+
+
+
+ Specifies the URL that will cause a logout. Spring Security will initialize a filter that
+ responds to this particular URL. Defaults to /logout if unspecified.
+
+
+
+
+
+ Specifies the URL to display once the user has logged out. If not specified, defaults to
+ <form-login-login-page>/?logout (i.e. /login?logout).
+
+
+
+
+
+ Specifies whether a logout also causes HttpSession invalidation, which is generally
+ desirable. If unspecified, defaults to true.
+
+
+
+
+
+ A reference to a LogoutSuccessHandler implementation which will be used to determine the
+ destination to which the user is taken after logging out.
+
+
+
+
+
+ A comma-separated list of the names of cookies which should be deleted when the user logs
+ out
+
+
+
+
+
+
+ Allow the RequestCache used for saving requests during the login process to be set
+
+
+
+
+
+
+
+
+
+
+ The URL that the login form is posted to. If unspecified, it defaults to /login.
+
+
+
+
+
+ The name of the request parameter which contains the username. Defaults to 'username'.
+
+
+
+
+
+ The name of the request parameter which contains the password. Defaults to 'password'.
+
+
+
+
+
+ The URL that will be redirected to after successful authentication, if the user's previous
+ action could not be resumed. This generally happens if the user visits a login page
+ without having first requested a secured operation that triggers authentication. If
+ unspecified, defaults to the root of the application.
+
+
+
+
+
+ Whether the user should always be redirected to the default-target-url after login.
+
+
+
+
+
+ The URL for the login page. If no login URL is specified, Spring Security will
+ automatically create a login URL at GET /login and a corresponding filter to render that
+ login URL when requested.
+
+
+
+
+
+ The URL for the login failure page. If no login failure URL is specified, Spring Security
+ will automatically create a failure login URL at /login?error and a corresponding filter
+ to render that login failure URL when requested.
+
+
+
+
+
+ Reference to an AuthenticationSuccessHandler bean which should be used to handle a
+ successful authentication request. Should not be used in combination with
+ default-target-url (or always-use-default-target-url) as the implementation should always
+ deal with navigation to the subsequent destination
+
+
+
+
+
+ Reference to an AuthenticationFailureHandler bean which should be used to handle a failed
+ authentication request. Should not be used in combination with authentication-failure-url
+ as the implementation should always deal with navigation to the subsequent destination
+
+
+
+
+
+ Reference to an AuthenticationDetailsSource which will be used by the authentication
+ filter
+
+
+
+
+
+ The URL for the ForwardAuthenticationFailureHandler
+
+
+
+
+
+ The URL for the ForwardAuthenticationSuccessHandler
+
+
+
+
+
+
+ Configures authentication support using an OAuth 2.0 and/or OpenID Connect 1.0 Provider.
+
+
+
+
+
+
+
+
+
+ Reference to the ClientRegistrationRepository
+
+
+
+
+
+ Reference to the OAuth2AuthorizedClientRepository
+
+
+
+
+
+ Reference to the OAuth2AuthorizedClientService
+
+
+
+
+
+ Reference to the AuthorizationRequestRepository
+
+
+
+
+
+ Reference to the OAuth2AuthorizationRequestResolver
+
+
+
+
+
+ Reference to the OAuth2AccessTokenResponseClient
+
+
+
+
+
+ Reference to the GrantedAuthoritiesMapper
+
+
+
+
+
+ Reference to the OAuth2UserService
+
+
+
+
+
+ Reference to the OpenID Connect OAuth2UserService
+
+
+
+
+
+ The URI where the filter processes authentication requests
+
+
+
+
+
+ The URI to send users to login
+
+
+
+
+
+ Reference to the AuthenticationSuccessHandler
+
+
+
+
+
+ Reference to the AuthenticationFailureHandler
+
+
+
+
+
+ Reference to the JwtDecoderFactory used by OidcAuthorizationCodeAuthenticationProvider
+
+
+
+
+
+
+ Configures OAuth 2.0 Client support.
+
+
+
+
+
+
+
+
+
+
+
+
+ Reference to the ClientRegistrationRepository
+
+
+
+
+
+ Reference to the OAuth2AuthorizedClientRepository
+
+
+
+
+
+ Reference to the OAuth2AuthorizedClientService
+
+
+
+
+
+
+ Configures OAuth 2.0 Authorization Code Grant.
+
+
+
+
+
+
+
+
+
+ Reference to the AuthorizationRequestRepository
+
+
+
+
+
+ Reference to the OAuth2AuthorizationRequestResolver
+
+
+
+
+
+ Reference to the OAuth2AccessTokenResponseClient
+
+
+
+
+
+
+ Container element for client(s) registered with an OAuth 2.0 or OpenID Connect 1.0
+ Provider.
+
+
+
+
+
+
+
+
+
+
+
+ Represents a client registered with an OAuth 2.0 or OpenID Connect 1.0 Provider.
+
+
+
+
+
+
+
+
+
+ The ID that uniquely identifies the client registration.
+
+
+
+
+
+ The client identifier.
+
+
+
+
+
+ The client secret.
+
+
+
+
+
+ The method used to authenticate the client with the provider. The supported values are
+ client_secret_basic, client_secret_post and none (public clients).
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The OAuth 2.0 Authorization Framework defines four Authorization Grant types. The
+ supported values are authorization_code, client_credentials, password and implicit.
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The client’s registered redirect URI that the Authorization Server redirects the
+ end-user’s user-agent to after the end-user has authenticated and authorized access to the
+ client.
+
+
+
+
+
+ A comma-separated list of scope(s) requested by the client during the Authorization
+ Request flow, such as openid, email, or profile.
+
+
+
+
+
+ A descriptive name used for the client. The name may be used in certain scenarios, such as
+ when displaying the name of the client in the auto-generated login page.
+
+
+
+
+
+ A reference to the associated provider. May reference a 'provider' element or use one of
+ the common providers (google, github, facebook, okta).
+
+
+
+
+
+
+ The configuration information for an OAuth 2.0 or OpenID Connect 1.0 Provider.
+
+
+
+
+
+
+
+
+
+ The ID that uniquely identifies the provider.
+
+
+
+
+
+ The Authorization Endpoint URI for the Authorization Server.
+
+
+
+
+
+ The Token Endpoint URI for the Authorization Server.
+
+
+
+
+
+ The UserInfo Endpoint URI used to access the claims/attributes of the authenticated
+ end-user.
+
+
+
+
+
+ The authentication method used when sending the access token to the UserInfo Endpoint. The
+ supported values are header, form and query.
+
+
+
+
+
+
+
+
+
+
+
+
+ The name of the attribute returned in the UserInfo Response that references the Name or
+ Identifier of the end-user.
+
+
+
+
+
+ The URI used to retrieve the JSON Web Key (JWK) Set from the Authorization Server, which
+ contains the cryptographic key(s) used to verify the JSON Web Signature (JWS) of the ID
+ Token and optionally the UserInfo Response.
+
+
+
+
+
+ The URI used to discover the configuration information for an OAuth 2.0 or OpenID Connect
+ 1.0 Provider.
+
+
+
+
+
+
+ Configures authentication support as an OAuth 2.0 Resource Server.
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Reference to an AuthenticationManagerResolver
+
+
+
+
+
+ Reference to a BearerTokenResolver
+
+
+
+
+
+ Reference to a AuthenticationEntryPoint
+
+
+
+
+
+
+ Configures JWT authentication
+
+
+
+
+
+
+
+
+
+ The URI to use to collect the JWK Set for verifying JWTs
+
+
+
+
+
+ Reference to a JwtDecoder
+
+
+
+
+
+ Reference to a Converter<Jwt, AbstractAuthenticationToken>
+
+
+
+
+
+
+ Configuration Opaque Token authentication
+
+
+
+
+
+
+
+
+
+ The URI to use to introspect opaque token attributes
+
+
+
+
+
+ The Client ID to use to authenticate the introspection request
+
+
+
+
+
+ The Client secret to use to authenticate the introspection request
+
+
+
+
+
+ Reference to an OpaqueTokenIntrospector
+
+
+
+
+
+
+
+ Sets up an attribute exchange configuration to request specified attributes from the
+ OpenID identity provider. When multiple elements are used, each must have an
+ identifier-attribute attribute. Each configuration will be matched in turn against the
+ supplied login identifier until a match is found.
+
+
+
+
+
+
+
+
+
+
+
+
+ A regular expression which will be compared against the claimed identity, when deciding
+ which attribute-exchange configuration to use during authentication.
+
+
+
+
+
+
+ Attributes used when making an OpenID AX Fetch Request. NOTE: The OpenID 1.0 and 2.0
+ protocols have been deprecated and users are <a
+ href="https://openid.net/specs/openid-connect-migration-1_0.html">encouraged to
+ migrate</a> to <a href="https://openid.net/connect/">OpenID Connect</a>, which is
+ supported by <code>spring-security-oauth2</code>.
+
+
+
+
+
+
+
+
+
+ Specifies the name of the attribute that you wish to get back. For example, email.
+
+
+
+
+
+ Specifies the attribute type. For example, https://axschema.org/contact/email. See your
+ OP's documentation for valid attribute types.
+
+
+
+
+
+ Specifies if this attribute is required to the OP, but does not error out if the OP does
+ not return the attribute. Default is false.
+
+
+
+
+
+ Specifies the number of attributes that you wish to get back. For example, return 3
+ emails. The default value is 1.
+
+
+
+
+
+
+ Used to explicitly configure a FilterChainProxy instance with a FilterChainMap
+
+
+
+
+
+
+
+
+
+
+
+
+ Defines the strategy use for matching incoming requests. Currently the options are 'mvc'
+ (for Spring MVC matcher), 'ant' (for ant path patterns), 'regex' for regular expressions
+ and 'ciRegex' for case-insensitive regular expressions.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Used within to define a specific URL pattern and the list of filters which apply to the
+ URLs matching that pattern. When multiple filter-chain elements are assembled in a list in
+ order to configure a FilterChainProxy, the most specific patterns must be placed at the
+ top of the list, with most general ones at the bottom.
+
+
+
+
+
+
+
+
+
+ The request URL pattern which will be mapped to the FilterChain.
+
+
+
+
+
+ Allows a RequestMatcher instance to be used, as an alternative to pattern-matching.
+
+
+
+
+
+ A comma separated list of bean names that implement Filter that should be processed for
+ this FilterChain. If the value is none, then no Filters will be used for this FilterChain.
+
+
+
+
+
+
+
+ The request URL pattern which will be mapped to the FilterChain.
+
+
+
+
+
+
+
+ Allows a RequestMatcher instance to be used, as an alternative to pattern-matching.
+
+
+
+
+
+
+ Used to explicitly configure a FilterSecurityMetadataSource bean for use with a
+ FilterSecurityInterceptor. Usually only needed if you are configuring a FilterChainProxy
+ explicitly, rather than using the <http> element. The intercept-url elements used should
+ only contain pattern, method and access attributes. Any others will result in a
+ configuration error.
+
+
+
+
+
+
+ Specifies the access attributes and/or filter list for a particular set of URLs.
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Enables the use of expressions in the 'access' attributes in <intercept-url> elements
+ rather than the traditional list of configuration attributes. Defaults to 'true'. If
+ enabled, each attribute should contain a single boolean expression. If the expression
+ evaluates to 'true', access will be granted.
+
+
+
+
+
+ A bean identifier, used for referring to the bean elsewhere in the context.
+
+
+
+
+
+ Defines the strategy use for matching incoming requests. Currently the options are 'mvc'
+ (for Spring MVC matcher), 'ant' (for ant path patterns), 'regex' for regular expressions
+ and 'ciRegex' for case-insensitive regular expressions.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Sets the AuthenticationEntryPoint which is used by the BasicAuthenticationFilter.
+
+
+
+
+
+ Reference to an AuthenticationDetailsSource which will be used by the authentication
+ filter
+
+
+
+
+
+
+ Adds support for the password management.
+
+
+
+
+
+
+
+
+
+ The change password page. Defaults to "/change-password".
+
+
+
+
+
+
+
+
+ Indicates how session fixation protection will be applied when a user authenticates. If
+ set to "none", no protection will be applied. "newSession" will create a new empty
+ session, with only Spring Security-related attributes migrated. "migrateSession" will
+ create a new session and copy all session attributes to the new session. In Servlet 3.1
+ (Java EE 7) and newer containers, specifying "changeSessionId" will keep the existing
+ session and use the container-supplied session fixation protection
+ (HttpServletRequest#changeSessionId()). Defaults to "changeSessionId" in Servlet 3.1 and
+ newer containers, "migrateSession" in older containers. Throws an exception if
+ "changeSessionId" is used in older containers.
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The URL to which a user will be redirected if they submit an invalid session indentifier.
+ Typically used to detect session timeouts.
+
+
+
+
+
+ Allows injection of the InvalidSessionStrategy instance used by the
+ SessionManagementFilter
+
+
+
+
+
+ Allows injection of the SessionAuthenticationStrategy instance used by the
+ SessionManagementFilter
+
+
+
+
+
+ Defines the URL of the error page which should be shown when the
+ SessionAuthenticationStrategy raises an exception. If not set, an unauthorized (401) error
+ code will be returned to the client. Note that this attribute doesn't apply if the error
+ occurs during a form-based login, where the URL for authentication failure will take
+ precedence.
+
+
+
+
+
+
+
+
+ The maximum number of sessions a single authenticated user can have open at the same time.
+ Defaults to "1". A negative value denotes unlimited sessions.
+
+
+
+
+
+ The URL a user will be redirected to if they attempt to use a session which has been
+ "expired" because they have logged in again.
+
+
+
+
+
+ Allows injection of the SessionInformationExpiredStrategy instance used by the
+ ConcurrentSessionFilter
+
+
+
+
+
+ Specifies that an unauthorized error should be reported when a user attempts to login when
+ they already have the maximum configured sessions open. The default behaviour is to expire
+ the original session. If the session-authentication-error-url attribute is set on the
+ session-management URL, the user will be redirected to this URL.
+
+
+
+
+
+ Allows you to define an alias for the SessionRegistry bean in order to access it in your
+ own configuration.
+
+
+
+
+
+ Allows you to define an external SessionRegistry bean to be used by the concurrency
+ control setup.
+
+
+
+
+
+
+
+
+ The "key" used to identify cookies from a specific token-based remember-me application.
+ You should set this to a unique value for your application. If unset, it will default to a
+ random value generated by SecureRandom.
+
+
+
+
+
+ Reference to a PersistentTokenRepository bean for use with the persistent token
+ remember-me implementation.
+
+
+
+
+
+ A reference to a DataSource bean
+
+
+
+
+
+
+ A reference to a user-service (or UserDetailsService bean) Id
+
+
+
+
+
+ Exports the internally defined RememberMeServices as a bean alias, allowing it to be used
+ by other beans in the application context.
+
+
+
+
+
+ Determines whether the "secure" flag will be set on the remember-me cookie. If set to
+ true, the cookie will only be submitted over HTTPS (recommended). By default, secure
+ cookies will be used if the request is made on a secure connection.
+
+
+
+
+
+ The period (in seconds) for which the remember-me cookie should be valid.
+
+
+
+
+
+ Reference to an AuthenticationSuccessHandler bean which should be used to handle a
+ successful remember-me authentication.
+
+
+
+
+
+ The name of the request parameter which toggles remember-me authentication. Defaults to
+ 'remember-me'.
+
+
+
+
+
+ The name of cookie which store the token for remember-me authentication. Defaults to
+ 'remember-me'.
+
+
+
+
+
+
+
+ Reference to a PersistentTokenRepository bean for use with the persistent token
+ remember-me implementation.
+
+
+
+
+
+
+
+ Allows a custom implementation of RememberMeServices to be used. Note that this
+ implementation should return RememberMeAuthenticationToken instances with the same "key"
+ value as specified in the remember-me element. Alternatively it should register its own
+ AuthenticationProvider. It should also implement the LogoutHandler interface, which will
+ be invoked when a user logs out. Typically the remember-me cookie would be removed on
+ logout.
+
+
+
+
+
+
+
+
+
+
+
+ The key shared between the provider and filter. This generally does not need to be set. If
+ unset, it will default to a random value generated by SecureRandom.
+
+
+
+
+
+ The username that should be assigned to the anonymous request. This allows the principal
+ to be identified, which may be important for logging and auditing. if unset, defaults to
+ "anonymousUser".
+
+
+
+
+
+ The granted authority that should be assigned to the anonymous request. Commonly this is
+ used to assign the anonymous request particular roles, which can subsequently be used in
+ authorization decisions. If unset, defaults to "ROLE_ANONYMOUS".
+
+
+
+
+
+ With the default namespace setup, the anonymous "authentication" facility is automatically
+ enabled. You can disable it using this property.
+
+
+
+
+
+
+
+
+
+ The http port to use.
+
+
+
+
+
+
+
+ The https port to use.
+
+
+
+
+
+
+
+
+ The regular expression used to obtain the username from the certificate's subject.
+ Defaults to matching on the common name using the pattern "CN=(.*?),".
+
+
+
+
+
+ A reference to a user-service (or UserDetailsService bean) Id
+
+
+
+
+
+ Reference to an AuthenticationDetailsSource which will be used by the authentication
+ filter
+
+
+
+
+
+
+ Adds a J2eePreAuthenticatedProcessingFilter to the filter chain to provide integration
+ with container authentication.
+
+
+
+
+
+
+
+
+
+ A comma-separate list of roles to look for in the incoming HttpServletRequest.
+
+
+
+
+
+ A reference to a user-service (or UserDetailsService bean) Id
+
+
+
+
+
+
+ Registers the AuthenticationManager instance and allows its list of
+ AuthenticationProviders to be defined. Also allows you to define an alias to allow you to
+ reference the AuthenticationManager in your own beans.
+
+
+
+
+
+
+ Indicates that the contained user-service should be used as an authentication source.
+
+
+
+
+
+
+
+ element which defines a password encoding strategy. Used by an authentication provider to
+ convert submitted passwords to hashed versions, for example.
+
+
+
+
+
+
+
+
+
+
+
+
+ Sets up an ldap authentication provider
+
+
+
+
+
+
+ Specifies that an LDAP provider should use an LDAP compare operation of the user's
+ password to authenticate the user
+
+
+
+
+
+
+ element which defines a password encoding strategy. Used by an authentication provider to
+ convert submitted passwords to hashed versions, for example.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ A bean identifier, used for referring to the bean elsewhere in the context.
+
+
+
+
+
+ An alias you wish to use for the AuthenticationManager bean (not required it you are using
+ a specific id)
+
+
+
+
+
+ If set to true, the AuthenticationManger will attempt to clear any credentials data in the
+ returned Authentication object, once the user has been authenticated.
+
+
+
+
+
+
+
+
+ Defines a reference to a Spring bean Id.
+
+
+
+
+
+ A reference to a user-service (or UserDetailsService bean) Id
+
+
+
+
+
+
+ Creates an in-memory UserDetailsService from a properties file or a list of "user" child
+ elements. Usernames are converted to lower-case internally to allow for case-insensitive
+ lookups, so this should not be used if case-sensitivity is required.
+
+
+
+
+
+
+ Represents a user in the application.
+
+
+
+
+
+
+
+
+
+ A bean identifier, used for referring to the bean elsewhere in the context.
+
+
+
+
+
+
+
+
+
+ The location of a Properties file where each line is in the format of
+ username=password,grantedAuthority[,grantedAuthority][,enabled|disabled]
+
+
+
+
+
+
+
+
+ The username assigned to the user.
+
+
+
+
+
+ The password assigned to the user. This may be hashed if the corresponding authentication
+ provider supports hashing (remember to set the "hash" attribute of the "user-service"
+ element). This attribute be omitted in the case where the data will not be used for
+ authentication, but only for accessing authorities. If omitted, the namespace will
+ generate a random value, preventing its accidental use for authentication. Cannot be
+ empty.
+
+
+
+
+
+ One of more authorities granted to the user. Separate authorities with a comma (but no
+ space). For example, "ROLE_USER,ROLE_ADMINISTRATOR"
+
+
+
+
+
+ Can be set to "true" to mark an account as locked and unusable.
+
+
+
+
+
+ Can be set to "true" to mark an account as disabled and unusable.
+
+
+
+
+
+
+ Causes creation of a JDBC-based UserDetailsService.
+
+
+
+
+
+ A bean identifier, used for referring to the bean elsewhere in the context.
+
+
+
+
+
+
+
+
+
+ The bean ID of the DataSource which provides the required tables.
+
+
+
+
+
+ Defines a reference to a cache for use with a UserDetailsService.
+
+
+
+
+
+ An SQL statement to query a username, password, and enabled status given a username.
+ Default is "select username,password,enabled from users where username = ?"
+
+
+
+
+
+ An SQL statement to query for a user's granted authorities given a username. The default
+ is "select username, authority from authorities where username = ?"
+
+
+
+
+
+ An SQL statement to query user's group authorities given a username. The default is
+ "select g.id, g.group_name, ga.authority from groups g, group_members gm,
+ group_authorities ga where gm.username = ? and g.id = ga.group_id and g.id = gm.group_id"
+
+
+
+
+
+ A non-empty string prefix that will be added to role strings loaded from persistent
+ storage (e.g. "ROLE_"). Use the value "none" for no prefix in cases where the default is
+ non-empty.
+
+
+
+
+
+
+ Element for configuration of the CsrfFilter for protection against CSRF. It also updates
+ the default RequestCache to only replay "GET" requests.
+
+
+
+
+
+
+
+
+
+ Specifies if csrf protection should be disabled. Default false (i.e. CSRF protection is
+ enabled).
+
+
+
+
+
+ The RequestMatcher instance to be used to determine if CSRF should be applied. Default is
+ any HTTP method except "GET", "TRACE", "HEAD", "OPTIONS"
+
+
+
+
+
+ The CsrfTokenRepository to use. The default is HttpSessionCsrfTokenRepository wrapped by
+ LazyCsrfTokenRepository.
+
+
+
+
+
+
+ Element for configuration of the HeaderWritersFilter. Enables easy setting for the
+ X-Frame-Options, X-XSS-Protection and X-Content-Type-Options headers.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Specifies if the default headers should be disabled. Default false.
+
+
+
+
+
+ Specifies if headers should be disabled. Default false.
+
+
+
+
+
+
+ Adds support for HTTP Strict Transport Security (HSTS)
+
+
+
+
+
+
+
+
+
+ Specifies if HTTP Strict Transport Security (HSTS) should be disabled. Default false.
+
+
+
+
+
+ Specifies if subdomains should be included. Default true.
+
+
+
+
+
+ Specifies the maximum amount of time the host should be considered a Known HSTS Host.
+ Default one year.
+
+
+
+
+
+ The RequestMatcher instance to be used to determine if the header should be set. Default
+ is if HttpServletRequest.isSecure() is true.
+
+
+
+
+
+ Specifies if preload should be included. Default false.
+
+
+
+
+
+
+ Element for configuration of CorsFilter. If no CorsFilter or CorsConfigurationSource is
+ specified a HandlerMappingIntrospector is used as the CorsConfigurationSource
+
+
+
+
+
+
+
+
+
+ Defines a reference to a Spring bean Id.
+
+
+
+
+
+ Specifies a bean id that is a CorsConfigurationSource used to construct the CorsFilter to
+ use
+
+
+
+
+
+
+ Adds support for HTTP Public Key Pinning (HPKP).
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The list with pins
+
+
+
+
+
+
+
+
+
+
+ A pin is specified using the base64-encoded SPKI fingerprint as value and the
+ cryptographic hash algorithm as attribute
+
+
+
+
+
+ The cryptographic hash algorithm
+
+
+
+
+
+
+
+
+ Specifies if HTTP Public Key Pinning (HPKP) should be disabled. Default false.
+
+
+
+
+
+ Specifies if subdomains should be included. Default false.
+
+
+
+
+
+ Sets the value for the max-age directive of the Public-Key-Pins header. Default 60 days.
+
+
+
+
+
+ Specifies if the browser should only report pin validation failures. Default true.
+
+
+
+
+
+ Specifies the URI to which the browser should report pin validation failures.
+
+
+
+
+
+
+ Adds support for Content Security Policy (CSP)
+
+
+
+
+
+
+
+
+
+ The security policy directive(s) for the Content-Security-Policy header or if report-only
+ is set to true, then the Content-Security-Policy-Report-Only header is used.
+
+
+
+
+
+ Set to true, to enable the Content-Security-Policy-Report-Only header for reporting policy
+ violations only. Defaults to false.
+
+
+
+
+
+
+ Adds support for Referrer Policy
+
+
+
+
+
+
+
+
+
+ The policies for the Referrer-Policy header.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Adds support for Feature Policy
+
+
+
+
+
+
+
+
+
+ The security policy directive(s) for the Feature-Policy header.
+
+
+
+
+
+
+ Adds support for Permissions Policy
+
+
+
+
+
+
+
+
+
+ The policies for the Permissions-Policy header.
+
+
+
+
+
+
+ Adds Cache-Control no-cache, no-store, must-revalidate, Pragma no-cache, and Expires 0 for
+ every request
+
+
+
+
+
+
+
+
+
+ Specifies if Cache Control should be disabled. Default false.
+
+
+
+
+
+
+ Enable basic clickjacking support for newer browsers (IE8+), will set the X-Frame-Options
+ header.
+
+
+
+
+
+
+
+
+
+ If disabled, the X-Frame-Options header will not be included. Default false.
+
+
+
+
+
+ Specify the policy to use for the X-Frame-Options-Header.
+
+
+
+
+
+
+
+
+
+
+
+
+ Specify the strategy to use when ALLOW-FROM is chosen.
+
+
+
+
+
+
+
+
+
+
+
+
+ Defines a reference to a Spring bean Id.
+
+
+
+
+
+ Specify a value to use for the chosen strategy.
+
+
+
+
+
+ Specify the request parameter to use for the origin when using a 'whitelist' or 'regexp'
+ based strategy. Default is 'from'. Deprecated ALLOW-FROM is an obsolete directive that no
+ longer works in modern browsers. Instead use Content-Security-Policy with the <a
+ href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/frame-ancestors">frame-ancestors</a>
+ directive.
+
+
+
+
+
+
+ Enable basic XSS browser protection, supported by newer browsers (IE8+), will set the
+ X-XSS-Protection header.
+
+
+
+
+
+
+
+
+
+ disable the X-XSS-Protection header. Default is 'false' meaning it is enabled.
+
+
+
+
+
+ specify that XSS Protection should be explicitly enabled or disabled. Default is 'true'
+ meaning it is enabled.
+
+
+
+
+
+ Add mode=block to the header or not, default is on.
+
+
+
+
+
+
+ Add a X-Content-Type-Options header to the resopnse. Value is always 'nosniff'.
+
+
+
+
+
+
+
+
+
+ If disabled, the X-Content-Type-Options header will not be included. Default false.
+
+
+
+
+
+
+ Add additional headers to the response.
+
+
+
+
+
+
+
+
+
+ The name of the header to add.
+
+
+
+
+
+ The value for the header.
+
+
+
+
+
+ Defines a reference to a Spring bean Id.
+
+
+
+
+
+
+
+ Used to indicate that a filter bean declaration should be incorporated into the security
+ filter chain.
+
+
+
+
+
+
+
+
+
+
+ The filter immediately after which the custom-filter should be placed in the chain. This
+ feature will only be needed by advanced users who wish to mix their own filters into the
+ security filter chain and have some knowledge of the standard Spring Security filters. The
+ filter names map to specific Spring Security implementation filters.
+
+
+
+
+
+ The filter immediately before which the custom-filter should be placed in the chain
+
+
+
+
+
+ The explicit position at which the custom-filter should be placed in the chain. Use if you
+ are replacing a standard filter.
+
+
+
+
+
+
+
+ The filter immediately after which the custom-filter should be placed in the chain. This
+ feature will only be needed by advanced users who wish to mix their own filters into the
+ security filter chain and have some knowledge of the standard Spring Security filters. The
+ filter names map to specific Spring Security implementation filters.
+
+
+
+
+
+
+
+ The filter immediately before which the custom-filter should be placed in the chain
+
+
+
+
+
+
+
+ The explicit position at which the custom-filter should be placed in the chain. Use if you
+ are replacing a standard filter.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/config/src/test/java/org/springframework/security/config/FilterChainProxyConfigTests.java b/config/src/test/java/org/springframework/security/config/FilterChainProxyConfigTests.java
index edd33b4b10b..b0dde842f57 100644
--- a/config/src/test/java/org/springframework/security/config/FilterChainProxyConfigTests.java
+++ b/config/src/test/java/org/springframework/security/config/FilterChainProxyConfigTests.java
@@ -18,10 +18,10 @@
import java.util.List;
-import javax.servlet.Filter;
-import javax.servlet.FilterChain;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
+import jakarta.servlet.Filter;
+import jakarta.servlet.FilterChain;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
diff --git a/config/src/test/java/org/springframework/security/config/SecurityNamespaceHandlerTests.java b/config/src/test/java/org/springframework/security/config/SecurityNamespaceHandlerTests.java
index 31d31c7a937..4e6d6ed9767 100644
--- a/config/src/test/java/org/springframework/security/config/SecurityNamespaceHandlerTests.java
+++ b/config/src/test/java/org/springframework/security/config/SecurityNamespaceHandlerTests.java
@@ -83,7 +83,7 @@ public void pre32SchemaAreNotSupported() {
// SEC-1868
@Test
public void initDoesNotLogErrorWhenFilterChainProxyFailsToLoad() throws Exception {
- String className = "javax.servlet.Filter";
+ String className = "jakarta.servlet.Filter";
Log logger = mock(Log.class);
SecurityNamespaceHandler handler = new SecurityNamespaceHandler();
ReflectionTestUtils.setField(handler, "logger", logger);
@@ -94,7 +94,7 @@ public void initDoesNotLogErrorWhenFilterChainProxyFailsToLoad() throws Exceptio
@Test
public void filterNoClassDefFoundError() throws Exception {
- String className = "javax.servlet.Filter";
+ String className = "jakarta.servlet.Filter";
expectClassUtilsForNameThrowsNoClassDefFoundError(className);
assertThatExceptionOfType(BeanDefinitionParsingException.class)
.isThrownBy(() -> new InMemoryXmlApplicationContext(XML_AUTHENTICATION_MANAGER + XML_HTTP_BLOCK))
@@ -103,7 +103,7 @@ public void filterNoClassDefFoundError() throws Exception {
@Test
public void filterNoClassDefFoundErrorNoHttpBlock() throws Exception {
- String className = "javax.servlet.Filter";
+ String className = "jakarta.servlet.Filter";
expectClassUtilsForNameThrowsNoClassDefFoundError(className);
new InMemoryXmlApplicationContext(XML_AUTHENTICATION_MANAGER);
// should load just fine since no http block
diff --git a/config/src/test/java/org/springframework/security/config/annotation/issue50/Issue50Tests.java b/config/src/test/java/org/springframework/security/config/annotation/issue50/Issue50Tests.java
index 6de1764992b..1a2b82b0048 100644
--- a/config/src/test/java/org/springframework/security/config/annotation/issue50/Issue50Tests.java
+++ b/config/src/test/java/org/springframework/security/config/annotation/issue50/Issue50Tests.java
@@ -16,7 +16,7 @@
package org.springframework.security.config.annotation.issue50;
-import javax.transaction.Transactional;
+import jakarta.transaction.Transactional;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
diff --git a/config/src/test/java/org/springframework/security/config/annotation/issue50/domain/User.java b/config/src/test/java/org/springframework/security/config/annotation/issue50/domain/User.java
index d30ada88c45..0a5a1d1d85a 100644
--- a/config/src/test/java/org/springframework/security/config/annotation/issue50/domain/User.java
+++ b/config/src/test/java/org/springframework/security/config/annotation/issue50/domain/User.java
@@ -16,10 +16,10 @@
package org.springframework.security.config.annotation.issue50.domain;
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
+import jakarta.persistence.Entity;
+import jakarta.persistence.GeneratedValue;
+import jakarta.persistence.GenerationType;
+import jakarta.persistence.Id;
/**
* @author Rob Winch
diff --git a/config/src/test/java/org/springframework/security/config/annotation/method/configuration/MethodSecurityService.java b/config/src/test/java/org/springframework/security/config/annotation/method/configuration/MethodSecurityService.java
index b3675705c03..3638e844851 100644
--- a/config/src/test/java/org/springframework/security/config/annotation/method/configuration/MethodSecurityService.java
+++ b/config/src/test/java/org/springframework/security/config/annotation/method/configuration/MethodSecurityService.java
@@ -18,8 +18,8 @@
import java.util.List;
-import javax.annotation.security.DenyAll;
-import javax.annotation.security.PermitAll;
+import jakarta.annotation.security.DenyAll;
+import jakarta.annotation.security.PermitAll;
import org.springframework.security.access.annotation.Secured;
import org.springframework.security.access.prepost.PostAuthorize;
diff --git a/config/src/test/java/org/springframework/security/config/annotation/sec2758/Sec2758Tests.java b/config/src/test/java/org/springframework/security/config/annotation/sec2758/Sec2758Tests.java
index ddc1c1f634f..222c20abe2c 100644
--- a/config/src/test/java/org/springframework/security/config/annotation/sec2758/Sec2758Tests.java
+++ b/config/src/test/java/org/springframework/security/config/annotation/sec2758/Sec2758Tests.java
@@ -16,7 +16,7 @@
package org.springframework.security.config.annotation.sec2758;
-import javax.annotation.security.RolesAllowed;
+import jakarta.annotation.security.RolesAllowed;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
diff --git a/config/src/test/java/org/springframework/security/config/annotation/web/AbstractRequestMatcherRegistryTests.java b/config/src/test/java/org/springframework/security/config/annotation/web/AbstractRequestMatcherRegistryTests.java
index 1b38cac950b..bc8b85adf2a 100644
--- a/config/src/test/java/org/springframework/security/config/annotation/web/AbstractRequestMatcherRegistryTests.java
+++ b/config/src/test/java/org/springframework/security/config/annotation/web/AbstractRequestMatcherRegistryTests.java
@@ -18,7 +18,7 @@
import java.util.List;
-import javax.servlet.DispatcherType;
+import jakarta.servlet.DispatcherType;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
diff --git a/config/src/test/java/org/springframework/security/config/annotation/web/HttpSecurityHeadersTests.java b/config/src/test/java/org/springframework/security/config/annotation/web/HttpSecurityHeadersTests.java
index 39b800955c0..72e00cf57fd 100644
--- a/config/src/test/java/org/springframework/security/config/annotation/web/HttpSecurityHeadersTests.java
+++ b/config/src/test/java/org/springframework/security/config/annotation/web/HttpSecurityHeadersTests.java
@@ -16,7 +16,7 @@
package org.springframework.security.config.annotation.web;
-import javax.servlet.Filter;
+import jakarta.servlet.Filter;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
diff --git a/config/src/test/java/org/springframework/security/config/annotation/web/SampleWebSecurityConfigurerAdapterTests.java b/config/src/test/java/org/springframework/security/config/annotation/web/SampleWebSecurityConfigurerAdapterTests.java
index 176ba69bb7a..9248f84bb3f 100644
--- a/config/src/test/java/org/springframework/security/config/annotation/web/SampleWebSecurityConfigurerAdapterTests.java
+++ b/config/src/test/java/org/springframework/security/config/annotation/web/SampleWebSecurityConfigurerAdapterTests.java
@@ -18,7 +18,7 @@
import java.util.Base64;
-import javax.servlet.http.HttpServletResponse;
+import jakarta.servlet.http.HttpServletResponse;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
diff --git a/config/src/test/java/org/springframework/security/config/annotation/web/WebSecurityConfigurerAdapterTests.java b/config/src/test/java/org/springframework/security/config/annotation/web/WebSecurityConfigurerAdapterTests.java
index 563696b7942..4a126cf7db2 100644
--- a/config/src/test/java/org/springframework/security/config/annotation/web/WebSecurityConfigurerAdapterTests.java
+++ b/config/src/test/java/org/springframework/security/config/annotation/web/WebSecurityConfigurerAdapterTests.java
@@ -20,10 +20,10 @@
import java.util.ArrayList;
import java.util.List;
-import javax.servlet.FilterChain;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
+import jakarta.servlet.FilterChain;
+import jakarta.servlet.ServletException;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
diff --git a/config/src/test/java/org/springframework/security/config/annotation/web/builders/FilterOrderRegistrationTests.java b/config/src/test/java/org/springframework/security/config/annotation/web/builders/FilterOrderRegistrationTests.java
index 3991a622cf7..a38a37f28d3 100644
--- a/config/src/test/java/org/springframework/security/config/annotation/web/builders/FilterOrderRegistrationTests.java
+++ b/config/src/test/java/org/springframework/security/config/annotation/web/builders/FilterOrderRegistrationTests.java
@@ -18,11 +18,11 @@
import java.io.IOException;
-import javax.servlet.Filter;
-import javax.servlet.FilterChain;
-import javax.servlet.ServletException;
-import javax.servlet.ServletRequest;
-import javax.servlet.ServletResponse;
+import jakarta.servlet.Filter;
+import jakarta.servlet.FilterChain;
+import jakarta.servlet.ServletException;
+import jakarta.servlet.ServletRequest;
+import jakarta.servlet.ServletResponse;
import org.junit.jupiter.api.Test;
diff --git a/config/src/test/java/org/springframework/security/config/annotation/web/builders/HttpConfigurationTests.java b/config/src/test/java/org/springframework/security/config/annotation/web/builders/HttpConfigurationTests.java
index 53635b93d89..5afcf873faa 100644
--- a/config/src/test/java/org/springframework/security/config/annotation/web/builders/HttpConfigurationTests.java
+++ b/config/src/test/java/org/springframework/security/config/annotation/web/builders/HttpConfigurationTests.java
@@ -18,12 +18,12 @@
import java.io.IOException;
-import javax.servlet.FilterChain;
-import javax.servlet.ServletException;
-import javax.servlet.ServletRequest;
-import javax.servlet.ServletResponse;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
+import jakarta.servlet.FilterChain;
+import jakarta.servlet.ServletException;
+import jakarta.servlet.ServletRequest;
+import jakarta.servlet.ServletResponse;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
diff --git a/config/src/test/java/org/springframework/security/config/annotation/web/builders/HttpSecurityAddFilterTest.java b/config/src/test/java/org/springframework/security/config/annotation/web/builders/HttpSecurityAddFilterTest.java
index d3b5044c427..19519b6b671 100644
--- a/config/src/test/java/org/springframework/security/config/annotation/web/builders/HttpSecurityAddFilterTest.java
+++ b/config/src/test/java/org/springframework/security/config/annotation/web/builders/HttpSecurityAddFilterTest.java
@@ -20,11 +20,11 @@
import java.util.List;
import java.util.stream.Collectors;
-import javax.servlet.Filter;
-import javax.servlet.FilterChain;
-import javax.servlet.ServletException;
-import javax.servlet.ServletRequest;
-import javax.servlet.ServletResponse;
+import jakarta.servlet.Filter;
+import jakarta.servlet.FilterChain;
+import jakarta.servlet.ServletException;
+import jakarta.servlet.ServletRequest;
+import jakarta.servlet.ServletResponse;
import org.assertj.core.api.ListAssert;
import org.junit.jupiter.api.Test;
diff --git a/config/src/test/java/org/springframework/security/config/annotation/web/builders/NamespaceHttpTests.java b/config/src/test/java/org/springframework/security/config/annotation/web/builders/NamespaceHttpTests.java
index ae167e0e5cb..a51e3490a6b 100644
--- a/config/src/test/java/org/springframework/security/config/annotation/web/builders/NamespaceHttpTests.java
+++ b/config/src/test/java/org/springframework/security/config/annotation/web/builders/NamespaceHttpTests.java
@@ -18,8 +18,9 @@
import javax.security.auth.Subject;
import javax.security.auth.login.LoginContext;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpSession;
+
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpSession;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
diff --git a/config/src/test/java/org/springframework/security/config/annotation/web/builders/WebSecurityTests.java b/config/src/test/java/org/springframework/security/config/annotation/web/builders/WebSecurityTests.java
index 275c5d23c9b..3076cb5d2ba 100644
--- a/config/src/test/java/org/springframework/security/config/annotation/web/builders/WebSecurityTests.java
+++ b/config/src/test/java/org/springframework/security/config/annotation/web/builders/WebSecurityTests.java
@@ -16,7 +16,7 @@
package org.springframework.security.config.annotation.web.builders;
-import javax.servlet.http.HttpServletResponse;
+import jakarta.servlet.http.HttpServletResponse;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
diff --git a/config/src/test/java/org/springframework/security/config/annotation/web/configuration/HttpSecurityConfigurationTests.java b/config/src/test/java/org/springframework/security/config/annotation/web/configuration/HttpSecurityConfigurationTests.java
index 813723e2839..2158b06cb8b 100644
--- a/config/src/test/java/org/springframework/security/config/annotation/web/configuration/HttpSecurityConfigurationTests.java
+++ b/config/src/test/java/org/springframework/security/config/annotation/web/configuration/HttpSecurityConfigurationTests.java
@@ -18,7 +18,7 @@
import java.util.concurrent.Callable;
-import javax.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletRequest;
import com.google.common.net.HttpHeaders;
import org.junit.jupiter.api.Test;
diff --git a/config/src/test/java/org/springframework/security/config/annotation/web/configuration/OAuth2ClientConfigurationTests.java b/config/src/test/java/org/springframework/security/config/annotation/web/configuration/OAuth2ClientConfigurationTests.java
index d70f27453c6..4f7876c0dbc 100644
--- a/config/src/test/java/org/springframework/security/config/annotation/web/configuration/OAuth2ClientConfigurationTests.java
+++ b/config/src/test/java/org/springframework/security/config/annotation/web/configuration/OAuth2ClientConfigurationTests.java
@@ -16,7 +16,7 @@
package org.springframework.security.config.annotation.web.configuration;
-import javax.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletRequest;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
diff --git a/config/src/test/java/org/springframework/security/config/annotation/web/configuration/SecurityReactorContextConfigurationResourceServerTests.java b/config/src/test/java/org/springframework/security/config/annotation/web/configuration/SecurityReactorContextConfigurationResourceServerTests.java
index 251ccbd88cc..4b5f4cb24f9 100644
--- a/config/src/test/java/org/springframework/security/config/annotation/web/configuration/SecurityReactorContextConfigurationResourceServerTests.java
+++ b/config/src/test/java/org/springframework/security/config/annotation/web/configuration/SecurityReactorContextConfigurationResourceServerTests.java
@@ -16,7 +16,7 @@
package org.springframework.security.config.annotation.web.configuration;
-import javax.annotation.PreDestroy;
+import jakarta.annotation.PreDestroy;
import okhttp3.mockwebserver.Dispatcher;
import okhttp3.mockwebserver.MockResponse;
diff --git a/config/src/test/java/org/springframework/security/config/annotation/web/configuration/SecurityReactorContextConfigurationTests.java b/config/src/test/java/org/springframework/security/config/annotation/web/configuration/SecurityReactorContextConfigurationTests.java
index e0e57c86c45..6a20b0fafd4 100644
--- a/config/src/test/java/org/springframework/security/config/annotation/web/configuration/SecurityReactorContextConfigurationTests.java
+++ b/config/src/test/java/org/springframework/security/config/annotation/web/configuration/SecurityReactorContextConfigurationTests.java
@@ -20,8 +20,8 @@
import java.util.HashMap;
import java.util.Map;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
diff --git a/config/src/test/java/org/springframework/security/config/annotation/web/configuration/WebSecurityConfigurationTests.java b/config/src/test/java/org/springframework/security/config/annotation/web/configuration/WebSecurityConfigurationTests.java
index ce9977c7c5d..7fa1908957f 100644
--- a/config/src/test/java/org/springframework/security/config/annotation/web/configuration/WebSecurityConfigurationTests.java
+++ b/config/src/test/java/org/springframework/security/config/annotation/web/configuration/WebSecurityConfigurationTests.java
@@ -22,8 +22,8 @@
import java.util.ArrayList;
import java.util.List;
-import javax.servlet.Filter;
-import javax.servlet.http.HttpServletRequest;
+import jakarta.servlet.Filter;
+import jakarta.servlet.http.HttpServletRequest;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
diff --git a/config/src/test/java/org/springframework/security/config/annotation/web/configurers/AuthorizeRequestsTests.java b/config/src/test/java/org/springframework/security/config/annotation/web/configurers/AuthorizeRequestsTests.java
index cc8c9dc8856..d3e972094a7 100644
--- a/config/src/test/java/org/springframework/security/config/annotation/web/configurers/AuthorizeRequestsTests.java
+++ b/config/src/test/java/org/springframework/security/config/annotation/web/configurers/AuthorizeRequestsTests.java
@@ -16,7 +16,7 @@
package org.springframework.security.config.annotation.web.configurers;
-import javax.servlet.http.HttpServletResponse;
+import jakarta.servlet.http.HttpServletResponse;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
diff --git a/config/src/test/java/org/springframework/security/config/annotation/web/configurers/CsrfConfigurerTests.java b/config/src/test/java/org/springframework/security/config/annotation/web/configurers/CsrfConfigurerTests.java
index 750609bf149..c0853a20a80 100644
--- a/config/src/test/java/org/springframework/security/config/annotation/web/configurers/CsrfConfigurerTests.java
+++ b/config/src/test/java/org/springframework/security/config/annotation/web/configurers/CsrfConfigurerTests.java
@@ -18,8 +18,8 @@
import java.net.URI;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
diff --git a/config/src/test/java/org/springframework/security/config/annotation/web/configurers/DefaultFiltersTests.java b/config/src/test/java/org/springframework/security/config/annotation/web/configurers/DefaultFiltersTests.java
index 37f9b28c72a..be2da0c432a 100644
--- a/config/src/test/java/org/springframework/security/config/annotation/web/configurers/DefaultFiltersTests.java
+++ b/config/src/test/java/org/springframework/security/config/annotation/web/configurers/DefaultFiltersTests.java
@@ -20,8 +20,8 @@
import java.util.List;
import java.util.stream.Collectors;
-import javax.servlet.Filter;
-import javax.servlet.ServletException;
+import jakarta.servlet.Filter;
+import jakarta.servlet.ServletException;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
diff --git a/config/src/test/java/org/springframework/security/config/annotation/web/configurers/ExceptionHandlingConfigurerTests.java b/config/src/test/java/org/springframework/security/config/annotation/web/configurers/ExceptionHandlingConfigurerTests.java
index 06d66a0f89a..25b64b421a6 100644
--- a/config/src/test/java/org/springframework/security/config/annotation/web/configurers/ExceptionHandlingConfigurerTests.java
+++ b/config/src/test/java/org/springframework/security/config/annotation/web/configurers/ExceptionHandlingConfigurerTests.java
@@ -16,8 +16,8 @@
package org.springframework.security.config.annotation.web.configurers;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
diff --git a/config/src/test/java/org/springframework/security/config/annotation/web/configurers/HttpBasicConfigurerTests.java b/config/src/test/java/org/springframework/security/config/annotation/web/configurers/HttpBasicConfigurerTests.java
index 58f83e9d085..0b441f69882 100644
--- a/config/src/test/java/org/springframework/security/config/annotation/web/configurers/HttpBasicConfigurerTests.java
+++ b/config/src/test/java/org/springframework/security/config/annotation/web/configurers/HttpBasicConfigurerTests.java
@@ -16,8 +16,8 @@
package org.springframework.security.config.annotation.web.configurers;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
diff --git a/config/src/test/java/org/springframework/security/config/annotation/web/configurers/HttpSecurityAntMatchersTests.java b/config/src/test/java/org/springframework/security/config/annotation/web/configurers/HttpSecurityAntMatchersTests.java
index 73d366be009..7719249759a 100644
--- a/config/src/test/java/org/springframework/security/config/annotation/web/configurers/HttpSecurityAntMatchersTests.java
+++ b/config/src/test/java/org/springframework/security/config/annotation/web/configurers/HttpSecurityAntMatchersTests.java
@@ -16,7 +16,7 @@
package org.springframework.security.config.annotation.web.configurers;
-import javax.servlet.http.HttpServletResponse;
+import jakarta.servlet.http.HttpServletResponse;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
diff --git a/config/src/test/java/org/springframework/security/config/annotation/web/configurers/HttpSecurityRequestMatchersTests.java b/config/src/test/java/org/springframework/security/config/annotation/web/configurers/HttpSecurityRequestMatchersTests.java
index 9e60e93994f..02ea35edfec 100644
--- a/config/src/test/java/org/springframework/security/config/annotation/web/configurers/HttpSecurityRequestMatchersTests.java
+++ b/config/src/test/java/org/springframework/security/config/annotation/web/configurers/HttpSecurityRequestMatchersTests.java
@@ -16,7 +16,7 @@
package org.springframework.security.config.annotation.web.configurers;
-import javax.servlet.http.HttpServletResponse;
+import jakarta.servlet.http.HttpServletResponse;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
diff --git a/config/src/test/java/org/springframework/security/config/annotation/web/configurers/Issue55Tests.java b/config/src/test/java/org/springframework/security/config/annotation/web/configurers/Issue55Tests.java
index e0f25237b12..069aca52536 100644
--- a/config/src/test/java/org/springframework/security/config/annotation/web/configurers/Issue55Tests.java
+++ b/config/src/test/java/org/springframework/security/config/annotation/web/configurers/Issue55Tests.java
@@ -19,7 +19,7 @@
import java.lang.reflect.InvocationTargetException;
import java.util.List;
-import javax.servlet.Filter;
+import jakarta.servlet.Filter;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
diff --git a/config/src/test/java/org/springframework/security/config/annotation/web/configurers/NamespaceHttpBasicTests.java b/config/src/test/java/org/springframework/security/config/annotation/web/configurers/NamespaceHttpBasicTests.java
index b66fa2de263..77c257c91b9 100644
--- a/config/src/test/java/org/springframework/security/config/annotation/web/configurers/NamespaceHttpBasicTests.java
+++ b/config/src/test/java/org/springframework/security/config/annotation/web/configurers/NamespaceHttpBasicTests.java
@@ -16,7 +16,7 @@
package org.springframework.security.config.annotation.web.configurers;
-import javax.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletRequest;
import org.apache.http.HttpHeaders;
import org.junit.jupiter.api.Test;
diff --git a/config/src/test/java/org/springframework/security/config/annotation/web/configurers/NamespaceHttpCustomFilterTests.java b/config/src/test/java/org/springframework/security/config/annotation/web/configurers/NamespaceHttpCustomFilterTests.java
index cb0d6cc089d..83621fabae3 100644
--- a/config/src/test/java/org/springframework/security/config/annotation/web/configurers/NamespaceHttpCustomFilterTests.java
+++ b/config/src/test/java/org/springframework/security/config/annotation/web/configurers/NamespaceHttpCustomFilterTests.java
@@ -20,10 +20,10 @@
import java.util.List;
import java.util.stream.Collectors;
-import javax.servlet.FilterChain;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
+import jakarta.servlet.FilterChain;
+import jakarta.servlet.ServletException;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
import org.assertj.core.api.ListAssert;
import org.junit.jupiter.api.Test;
diff --git a/config/src/test/java/org/springframework/security/config/annotation/web/configurers/NamespaceHttpFirewallTests.java b/config/src/test/java/org/springframework/security/config/annotation/web/configurers/NamespaceHttpFirewallTests.java
index a2f2cbbde05..ec529e249ae 100644
--- a/config/src/test/java/org/springframework/security/config/annotation/web/configurers/NamespaceHttpFirewallTests.java
+++ b/config/src/test/java/org/springframework/security/config/annotation/web/configurers/NamespaceHttpFirewallTests.java
@@ -16,7 +16,7 @@
package org.springframework.security.config.annotation.web.configurers;
-import javax.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletRequest;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
diff --git a/config/src/test/java/org/springframework/security/config/annotation/web/configurers/NamespaceHttpFormLoginTests.java b/config/src/test/java/org/springframework/security/config/annotation/web/configurers/NamespaceHttpFormLoginTests.java
index 90d8a2a6ed8..fe03e67fc31 100644
--- a/config/src/test/java/org/springframework/security/config/annotation/web/configurers/NamespaceHttpFormLoginTests.java
+++ b/config/src/test/java/org/springframework/security/config/annotation/web/configurers/NamespaceHttpFormLoginTests.java
@@ -16,7 +16,7 @@
package org.springframework.security.config.annotation.web.configurers;
-import javax.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletRequest;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
diff --git a/config/src/test/java/org/springframework/security/config/annotation/web/configurers/NamespaceHttpLogoutTests.java b/config/src/test/java/org/springframework/security/config/annotation/web/configurers/NamespaceHttpLogoutTests.java
index a5d1884b29c..9c468d87b70 100644
--- a/config/src/test/java/org/springframework/security/config/annotation/web/configurers/NamespaceHttpLogoutTests.java
+++ b/config/src/test/java/org/springframework/security/config/annotation/web/configurers/NamespaceHttpLogoutTests.java
@@ -20,7 +20,7 @@
import java.util.Optional;
import java.util.function.Predicate;
-import javax.servlet.http.HttpSession;
+import jakarta.servlet.http.HttpSession;
import org.assertj.core.api.Condition;
import org.junit.jupiter.api.Test;
diff --git a/config/src/test/java/org/springframework/security/config/annotation/web/configurers/NamespaceHttpOpenIDLoginTests.java b/config/src/test/java/org/springframework/security/config/annotation/web/configurers/NamespaceHttpOpenIDLoginTests.java
index d57a9ab8bf6..31af12b0144 100644
--- a/config/src/test/java/org/springframework/security/config/annotation/web/configurers/NamespaceHttpOpenIDLoginTests.java
+++ b/config/src/test/java/org/springframework/security/config/annotation/web/configurers/NamespaceHttpOpenIDLoginTests.java
@@ -19,7 +19,7 @@
import java.util.Arrays;
import java.util.List;
-import javax.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletRequest;
import okhttp3.mockwebserver.MockResponse;
import okhttp3.mockwebserver.MockWebServer;
diff --git a/config/src/test/java/org/springframework/security/config/annotation/web/configurers/NamespaceHttpRequestCacheTests.java b/config/src/test/java/org/springframework/security/config/annotation/web/configurers/NamespaceHttpRequestCacheTests.java
index ea4ba0442e3..b9ec9faa4ba 100644
--- a/config/src/test/java/org/springframework/security/config/annotation/web/configurers/NamespaceHttpRequestCacheTests.java
+++ b/config/src/test/java/org/springframework/security/config/annotation/web/configurers/NamespaceHttpRequestCacheTests.java
@@ -16,9 +16,9 @@
package org.springframework.security.config.annotation.web.configurers;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.servlet.http.HttpSession;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
+import jakarta.servlet.http.HttpSession;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
diff --git a/config/src/test/java/org/springframework/security/config/annotation/web/configurers/NamespaceHttpServerAccessDeniedHandlerTests.java b/config/src/test/java/org/springframework/security/config/annotation/web/configurers/NamespaceHttpServerAccessDeniedHandlerTests.java
index 7e2cfa0e413..0414368d7e9 100644
--- a/config/src/test/java/org/springframework/security/config/annotation/web/configurers/NamespaceHttpServerAccessDeniedHandlerTests.java
+++ b/config/src/test/java/org/springframework/security/config/annotation/web/configurers/NamespaceHttpServerAccessDeniedHandlerTests.java
@@ -16,8 +16,8 @@
package org.springframework.security.config.annotation.web.configurers;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
diff --git a/config/src/test/java/org/springframework/security/config/annotation/web/configurers/NamespaceHttpX509Tests.java b/config/src/test/java/org/springframework/security/config/annotation/web/configurers/NamespaceHttpX509Tests.java
index d54a0a286e2..7cbfd570317 100644
--- a/config/src/test/java/org/springframework/security/config/annotation/web/configurers/NamespaceHttpX509Tests.java
+++ b/config/src/test/java/org/springframework/security/config/annotation/web/configurers/NamespaceHttpX509Tests.java
@@ -21,11 +21,14 @@
import java.security.cert.CertificateFactory;
import java.security.cert.X509Certificate;
-import javax.servlet.http.HttpServletRequest;
+import javax.security.auth.x500.X500Principal;
+import jakarta.servlet.http.HttpServletRequest;
+
+import org.bouncycastle.asn1.x500.X500Name;
+import org.bouncycastle.asn1.x500.style.BCStyle;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
-import sun.security.x509.X500Name;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
@@ -240,12 +243,8 @@ protected void configure(HttpSecurity http) throws Exception {
}
private String extractCommonName(X509Certificate certificate) {
- try {
- return ((X500Name) certificate.getSubjectDN()).getCommonName();
- }
- catch (Exception ex) {
- throw new IllegalArgumentException(ex);
- }
+ X500Principal principal = certificate.getSubjectX500Principal();
+ return new X500Name(principal.getName()).getRDNs(BCStyle.CN)[0].getFirst().getValue().toString();
}
}
diff --git a/config/src/test/java/org/springframework/security/config/annotation/web/configurers/NamespaceRememberMeTests.java b/config/src/test/java/org/springframework/security/config/annotation/web/configurers/NamespaceRememberMeTests.java
index 9487d6ee0a9..ad2c6cbdc74 100644
--- a/config/src/test/java/org/springframework/security/config/annotation/web/configurers/NamespaceRememberMeTests.java
+++ b/config/src/test/java/org/springframework/security/config/annotation/web/configurers/NamespaceRememberMeTests.java
@@ -16,9 +16,9 @@
package org.springframework.security.config.annotation.web.configurers;
-import javax.servlet.http.Cookie;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
+import jakarta.servlet.http.Cookie;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
diff --git a/config/src/test/java/org/springframework/security/config/annotation/web/configurers/NamespaceSessionManagementTests.java b/config/src/test/java/org/springframework/security/config/annotation/web/configurers/NamespaceSessionManagementTests.java
index c88a240965b..b20b51d399a 100644
--- a/config/src/test/java/org/springframework/security/config/annotation/web/configurers/NamespaceSessionManagementTests.java
+++ b/config/src/test/java/org/springframework/security/config/annotation/web/configurers/NamespaceSessionManagementTests.java
@@ -21,8 +21,8 @@
import java.util.Date;
import java.util.List;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
diff --git a/config/src/test/java/org/springframework/security/config/annotation/web/configurers/RememberMeConfigurerTests.java b/config/src/test/java/org/springframework/security/config/annotation/web/configurers/RememberMeConfigurerTests.java
index aa91f3a8f16..643f1d0d0e9 100644
--- a/config/src/test/java/org/springframework/security/config/annotation/web/configurers/RememberMeConfigurerTests.java
+++ b/config/src/test/java/org/springframework/security/config/annotation/web/configurers/RememberMeConfigurerTests.java
@@ -18,8 +18,8 @@
import java.util.Collections;
-import javax.servlet.http.Cookie;
-import javax.servlet.http.HttpSession;
+import jakarta.servlet.http.Cookie;
+import jakarta.servlet.http.HttpSession;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
diff --git a/config/src/test/java/org/springframework/security/config/annotation/web/configurers/RequestCacheConfigurerTests.java b/config/src/test/java/org/springframework/security/config/annotation/web/configurers/RequestCacheConfigurerTests.java
index c3a38ef24d1..fc62d353648 100644
--- a/config/src/test/java/org/springframework/security/config/annotation/web/configurers/RequestCacheConfigurerTests.java
+++ b/config/src/test/java/org/springframework/security/config/annotation/web/configurers/RequestCacheConfigurerTests.java
@@ -16,8 +16,8 @@
package org.springframework.security.config.annotation.web.configurers;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
diff --git a/config/src/test/java/org/springframework/security/config/annotation/web/configurers/SecurityContextConfigurerTests.java b/config/src/test/java/org/springframework/security/config/annotation/web/configurers/SecurityContextConfigurerTests.java
index bd1f4e937b9..f1faf2f76e5 100644
--- a/config/src/test/java/org/springframework/security/config/annotation/web/configurers/SecurityContextConfigurerTests.java
+++ b/config/src/test/java/org/springframework/security/config/annotation/web/configurers/SecurityContextConfigurerTests.java
@@ -16,7 +16,7 @@
package org.springframework.security.config.annotation.web.configurers;
-import javax.servlet.http.HttpSession;
+import jakarta.servlet.http.HttpSession;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
diff --git a/config/src/test/java/org/springframework/security/config/annotation/web/configurers/ServletApiConfigurerTests.java b/config/src/test/java/org/springframework/security/config/annotation/web/configurers/ServletApiConfigurerTests.java
index f86916d26a5..4b48ce8ec88 100644
--- a/config/src/test/java/org/springframework/security/config/annotation/web/configurers/ServletApiConfigurerTests.java
+++ b/config/src/test/java/org/springframework/security/config/annotation/web/configurers/ServletApiConfigurerTests.java
@@ -18,10 +18,10 @@
import java.util.List;
-import javax.servlet.Filter;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
+import jakarta.servlet.Filter;
+import jakarta.servlet.ServletException;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
diff --git a/config/src/test/java/org/springframework/security/config/annotation/web/configurers/SessionManagementConfigurerServlet31Tests.java b/config/src/test/java/org/springframework/security/config/annotation/web/configurers/SessionManagementConfigurerServlet31Tests.java
index e833999f1a6..5a766e1c073 100644
--- a/config/src/test/java/org/springframework/security/config/annotation/web/configurers/SessionManagementConfigurerServlet31Tests.java
+++ b/config/src/test/java/org/springframework/security/config/annotation/web/configurers/SessionManagementConfigurerServlet31Tests.java
@@ -16,7 +16,7 @@
package org.springframework.security.config.annotation.web.configurers;
-import javax.servlet.Filter;
+import jakarta.servlet.Filter;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
diff --git a/config/src/test/java/org/springframework/security/config/annotation/web/configurers/SessionManagementConfigurerSessionAuthenticationStrategyTests.java b/config/src/test/java/org/springframework/security/config/annotation/web/configurers/SessionManagementConfigurerSessionAuthenticationStrategyTests.java
index 1b68b8a866a..5c9befad9dd 100644
--- a/config/src/test/java/org/springframework/security/config/annotation/web/configurers/SessionManagementConfigurerSessionAuthenticationStrategyTests.java
+++ b/config/src/test/java/org/springframework/security/config/annotation/web/configurers/SessionManagementConfigurerSessionAuthenticationStrategyTests.java
@@ -16,8 +16,8 @@
package org.springframework.security.config.annotation.web.configurers;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
diff --git a/config/src/test/java/org/springframework/security/config/annotation/web/configurers/SessionManagementConfigurerTests.java b/config/src/test/java/org/springframework/security/config/annotation/web/configurers/SessionManagementConfigurerTests.java
index 7fdf966b529..58619d310ff 100644
--- a/config/src/test/java/org/springframework/security/config/annotation/web/configurers/SessionManagementConfigurerTests.java
+++ b/config/src/test/java/org/springframework/security/config/annotation/web/configurers/SessionManagementConfigurerTests.java
@@ -16,9 +16,9 @@
package org.springframework.security.config.annotation.web.configurers;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.servlet.http.HttpSession;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
+import jakarta.servlet.http.HttpSession;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
diff --git a/config/src/test/java/org/springframework/security/config/annotation/web/configurers/UrlAuthorizationConfigurerTests.java b/config/src/test/java/org/springframework/security/config/annotation/web/configurers/UrlAuthorizationConfigurerTests.java
index 914ea135ea9..7caa7e33d3c 100644
--- a/config/src/test/java/org/springframework/security/config/annotation/web/configurers/UrlAuthorizationConfigurerTests.java
+++ b/config/src/test/java/org/springframework/security/config/annotation/web/configurers/UrlAuthorizationConfigurerTests.java
@@ -16,7 +16,7 @@
package org.springframework.security.config.annotation.web.configurers;
-import javax.servlet.http.HttpServletResponse;
+import jakarta.servlet.http.HttpServletResponse;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
diff --git a/config/src/test/java/org/springframework/security/config/annotation/web/configurers/UrlAuthorizationsTests.java b/config/src/test/java/org/springframework/security/config/annotation/web/configurers/UrlAuthorizationsTests.java
index e8540437740..f36bdb3f103 100644
--- a/config/src/test/java/org/springframework/security/config/annotation/web/configurers/UrlAuthorizationsTests.java
+++ b/config/src/test/java/org/springframework/security/config/annotation/web/configurers/UrlAuthorizationsTests.java
@@ -18,7 +18,7 @@
import java.util.List;
-import javax.servlet.Filter;
+import jakarta.servlet.Filter;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
diff --git a/config/src/test/java/org/springframework/security/config/annotation/web/configurers/oauth2/client/OAuth2ClientConfigurerTests.java b/config/src/test/java/org/springframework/security/config/annotation/web/configurers/oauth2/client/OAuth2ClientConfigurerTests.java
index fdb28a46fd0..c1087c3e888 100644
--- a/config/src/test/java/org/springframework/security/config/annotation/web/configurers/oauth2/client/OAuth2ClientConfigurerTests.java
+++ b/config/src/test/java/org/springframework/security/config/annotation/web/configurers/oauth2/client/OAuth2ClientConfigurerTests.java
@@ -19,8 +19,8 @@
import java.util.HashMap;
import java.util.Map;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
diff --git a/config/src/test/java/org/springframework/security/config/annotation/web/configurers/oauth2/server/resource/OAuth2ResourceServerConfigurerTests.java b/config/src/test/java/org/springframework/security/config/annotation/web/configurers/oauth2/server/resource/OAuth2ResourceServerConfigurerTests.java
index f43127de1ec..32626bf8b8d 100644
--- a/config/src/test/java/org/springframework/security/config/annotation/web/configurers/oauth2/server/resource/OAuth2ResourceServerConfigurerTests.java
+++ b/config/src/test/java/org/springframework/security/config/annotation/web/configurers/oauth2/server/resource/OAuth2ResourceServerConfigurerTests.java
@@ -32,8 +32,8 @@
import java.util.Map;
import java.util.stream.Collectors;
-import javax.annotation.PreDestroy;
-import javax.servlet.http.HttpServletRequest;
+import jakarta.annotation.PreDestroy;
+import jakarta.servlet.http.HttpServletRequest;
import com.nimbusds.jose.JWSAlgorithm;
import com.nimbusds.jose.JWSHeader;
diff --git a/config/src/test/java/org/springframework/security/config/annotation/web/configurers/saml2/Saml2LoginConfigurerTests.java b/config/src/test/java/org/springframework/security/config/annotation/web/configurers/saml2/Saml2LoginConfigurerTests.java
index b37040eff36..83e555430df 100644
--- a/config/src/test/java/org/springframework/security/config/annotation/web/configurers/saml2/Saml2LoginConfigurerTests.java
+++ b/config/src/test/java/org/springframework/security/config/annotation/web/configurers/saml2/Saml2LoginConfigurerTests.java
@@ -24,9 +24,9 @@
import java.util.Collection;
import java.util.Collections;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
+import jakarta.servlet.ServletException;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Assertions;
diff --git a/config/src/test/java/org/springframework/security/config/annotation/web/socket/AbstractSecurityWebSocketMessageBrokerConfigurerTests.java b/config/src/test/java/org/springframework/security/config/annotation/web/socket/AbstractSecurityWebSocketMessageBrokerConfigurerTests.java
index 8d0ad848357..a9ad443d6d5 100644
--- a/config/src/test/java/org/springframework/security/config/annotation/web/socket/AbstractSecurityWebSocketMessageBrokerConfigurerTests.java
+++ b/config/src/test/java/org/springframework/security/config/annotation/web/socket/AbstractSecurityWebSocketMessageBrokerConfigurerTests.java
@@ -19,7 +19,7 @@
import java.util.HashMap;
import java.util.Map;
-import javax.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletRequest;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
diff --git a/config/src/test/java/org/springframework/security/config/core/GrantedAuthorityDefaultsJcTests.java b/config/src/test/java/org/springframework/security/config/core/GrantedAuthorityDefaultsJcTests.java
index e90098d4471..ec3f02e95ae 100644
--- a/config/src/test/java/org/springframework/security/config/core/GrantedAuthorityDefaultsJcTests.java
+++ b/config/src/test/java/org/springframework/security/config/core/GrantedAuthorityDefaultsJcTests.java
@@ -18,11 +18,11 @@
import java.io.IOException;
-import javax.servlet.ServletException;
-import javax.servlet.ServletRequest;
-import javax.servlet.ServletResponse;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
+import jakarta.servlet.ServletException;
+import jakarta.servlet.ServletRequest;
+import jakarta.servlet.ServletResponse;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
diff --git a/config/src/test/java/org/springframework/security/config/core/GrantedAuthorityDefaultsXmlTests.java b/config/src/test/java/org/springframework/security/config/core/GrantedAuthorityDefaultsXmlTests.java
index 8fb04ed1d53..f459db36a5c 100644
--- a/config/src/test/java/org/springframework/security/config/core/GrantedAuthorityDefaultsXmlTests.java
+++ b/config/src/test/java/org/springframework/security/config/core/GrantedAuthorityDefaultsXmlTests.java
@@ -18,11 +18,11 @@
import java.io.IOException;
-import javax.servlet.ServletException;
-import javax.servlet.ServletRequest;
-import javax.servlet.ServletResponse;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
+import jakarta.servlet.ServletException;
+import jakarta.servlet.ServletRequest;
+import jakarta.servlet.ServletResponse;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
diff --git a/config/src/test/java/org/springframework/security/config/core/HelloWorldMessageService.java b/config/src/test/java/org/springframework/security/config/core/HelloWorldMessageService.java
index 452a20042fb..9ab9b3442dd 100755
--- a/config/src/test/java/org/springframework/security/config/core/HelloWorldMessageService.java
+++ b/config/src/test/java/org/springframework/security/config/core/HelloWorldMessageService.java
@@ -16,7 +16,7 @@
package org.springframework.security.config.core;
-import javax.annotation.security.RolesAllowed;
+import jakarta.annotation.security.RolesAllowed;
import org.springframework.security.access.prepost.PreAuthorize;
diff --git a/config/src/test/java/org/springframework/security/config/doc/XsdDocumentedTests.java b/config/src/test/java/org/springframework/security/config/doc/XsdDocumentedTests.java
index 35d857c84a9..78a1e0f0d4e 100644
--- a/config/src/test/java/org/springframework/security/config/doc/XsdDocumentedTests.java
+++ b/config/src/test/java/org/springframework/security/config/doc/XsdDocumentedTests.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2020 the original author or authors.
+ * Copyright 2002-2021 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.
@@ -64,7 +64,7 @@ public class XsdDocumentedTests {
String schema31xDocumentLocation = "org/springframework/security/config/spring-security-3.1.xsd";
- String schemaDocumentLocation = "org/springframework/security/config/spring-security-5.6.xsd";
+ String schemaDocumentLocation = "org/springframework/security/config/spring-security-6.0.xsd";
XmlSupport xml = new XmlSupport();
@@ -149,8 +149,8 @@ public void sizeWhenReadingFilesystemThenIsCorrectNumberOfSchemaFiles() throws I
.getParentFile()
.list((dir, name) -> name.endsWith(".xsd"));
// @formatter:on
- assertThat(schemas.length).isEqualTo(18)
- .withFailMessage("the count is equal to 18, if not then schemaDocument needs updating");
+ assertThat(schemas.length).isEqualTo(19)
+ .withFailMessage("the count is equal to 19, if not then schemaDocument needs updating");
}
/**
diff --git a/config/src/test/java/org/springframework/security/config/http/AccessDeniedConfigTests.java b/config/src/test/java/org/springframework/security/config/http/AccessDeniedConfigTests.java
index 3a831ac78af..9c31a81089c 100644
--- a/config/src/test/java/org/springframework/security/config/http/AccessDeniedConfigTests.java
+++ b/config/src/test/java/org/springframework/security/config/http/AccessDeniedConfigTests.java
@@ -16,8 +16,8 @@
package org.springframework.security.config.http;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
import org.eclipse.jetty.http.HttpStatus;
import org.junit.jupiter.api.Test;
diff --git a/config/src/test/java/org/springframework/security/config/http/CsrfConfigTests.java b/config/src/test/java/org/springframework/security/config/http/CsrfConfigTests.java
index ce17aebd9ac..99a4465da37 100644
--- a/config/src/test/java/org/springframework/security/config/http/CsrfConfigTests.java
+++ b/config/src/test/java/org/springframework/security/config/http/CsrfConfigTests.java
@@ -19,9 +19,9 @@
import java.net.URI;
import java.util.List;
-import javax.servlet.Filter;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
+import jakarta.servlet.Filter;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
import org.eclipse.jetty.http.HttpStatus;
import org.junit.jupiter.api.Test;
diff --git a/config/src/test/java/org/springframework/security/config/http/FormLoginConfigTests.java b/config/src/test/java/org/springframework/security/config/http/FormLoginConfigTests.java
index c03c855c47c..82a3c924981 100644
--- a/config/src/test/java/org/springframework/security/config/http/FormLoginConfigTests.java
+++ b/config/src/test/java/org/springframework/security/config/http/FormLoginConfigTests.java
@@ -18,9 +18,9 @@
import java.util.List;
-import javax.servlet.Filter;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
+import jakarta.servlet.Filter;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
diff --git a/config/src/test/java/org/springframework/security/config/http/HttpConfigTests.java b/config/src/test/java/org/springframework/security/config/http/HttpConfigTests.java
index 990a6482211..40ba00ce494 100644
--- a/config/src/test/java/org/springframework/security/config/http/HttpConfigTests.java
+++ b/config/src/test/java/org/springframework/security/config/http/HttpConfigTests.java
@@ -16,8 +16,8 @@
package org.springframework.security.config.http;
-import javax.servlet.http.HttpServletResponse;
-import javax.servlet.http.HttpServletResponseWrapper;
+import jakarta.servlet.http.HttpServletResponse;
+import jakarta.servlet.http.HttpServletResponseWrapper;
import org.apache.http.HttpStatus;
import org.junit.jupiter.api.Test;
diff --git a/config/src/test/java/org/springframework/security/config/http/HttpInterceptUrlTests.java b/config/src/test/java/org/springframework/security/config/http/HttpInterceptUrlTests.java
index 462fa5dd385..106dd0cc203 100644
--- a/config/src/test/java/org/springframework/security/config/http/HttpInterceptUrlTests.java
+++ b/config/src/test/java/org/springframework/security/config/http/HttpInterceptUrlTests.java
@@ -16,7 +16,7 @@
package org.springframework.security.config.http;
-import javax.servlet.Filter;
+import jakarta.servlet.Filter;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Test;
diff --git a/config/src/test/java/org/springframework/security/config/http/InterceptUrlConfigTests.java b/config/src/test/java/org/springframework/security/config/http/InterceptUrlConfigTests.java
index 2ebd408395f..1c4a87b2922 100644
--- a/config/src/test/java/org/springframework/security/config/http/InterceptUrlConfigTests.java
+++ b/config/src/test/java/org/springframework/security/config/http/InterceptUrlConfigTests.java
@@ -19,7 +19,7 @@
import java.util.Collections;
import java.util.Map;
-import javax.servlet.ServletRegistration;
+import jakarta.servlet.ServletRegistration;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
diff --git a/config/src/test/java/org/springframework/security/config/http/MiscHttpConfigTests.java b/config/src/test/java/org/springframework/security/config/http/MiscHttpConfigTests.java
index 0fc87cfe8cb..9f6128b0898 100644
--- a/config/src/test/java/org/springframework/security/config/http/MiscHttpConfigTests.java
+++ b/config/src/test/java/org/springframework/security/config/http/MiscHttpConfigTests.java
@@ -32,11 +32,12 @@
import javax.security.auth.Subject;
import javax.security.auth.callback.CallbackHandler;
import javax.security.auth.spi.LoginModule;
-import javax.servlet.Filter;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.servlet.http.HttpServletResponseWrapper;
+
+import jakarta.servlet.Filter;
+import jakarta.servlet.ServletException;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
+import jakarta.servlet.http.HttpServletResponseWrapper;
import ch.qos.logback.classic.Logger;
import ch.qos.logback.classic.spi.ILoggingEvent;
diff --git a/config/src/test/java/org/springframework/security/config/http/NamespaceHttpBasicTests.java b/config/src/test/java/org/springframework/security/config/http/NamespaceHttpBasicTests.java
index 1616a8b6c77..3366458955b 100644
--- a/config/src/test/java/org/springframework/security/config/http/NamespaceHttpBasicTests.java
+++ b/config/src/test/java/org/springframework/security/config/http/NamespaceHttpBasicTests.java
@@ -19,8 +19,8 @@
import java.lang.reflect.Method;
import java.util.Base64;
-import javax.servlet.Filter;
-import javax.servlet.http.HttpServletResponse;
+import jakarta.servlet.Filter;
+import jakarta.servlet.http.HttpServletResponse;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
diff --git a/config/src/test/java/org/springframework/security/config/http/OAuth2ResourceServerBeanDefinitionParserTests.java b/config/src/test/java/org/springframework/security/config/http/OAuth2ResourceServerBeanDefinitionParserTests.java
index e5613347138..2a43d604e14 100644
--- a/config/src/test/java/org/springframework/security/config/http/OAuth2ResourceServerBeanDefinitionParserTests.java
+++ b/config/src/test/java/org/springframework/security/config/http/OAuth2ResourceServerBeanDefinitionParserTests.java
@@ -30,7 +30,7 @@
import java.util.Properties;
import java.util.stream.Collectors;
-import javax.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletRequest;
import com.nimbusds.jose.JWSAlgorithm;
import com.nimbusds.jose.JWSHeader;
diff --git a/config/src/test/java/org/springframework/security/config/http/OpenIDConfigTests.java b/config/src/test/java/org/springframework/security/config/http/OpenIDConfigTests.java
index 80a43d8859d..dee0a388181 100644
--- a/config/src/test/java/org/springframework/security/config/http/OpenIDConfigTests.java
+++ b/config/src/test/java/org/springframework/security/config/http/OpenIDConfigTests.java
@@ -19,8 +19,8 @@
import java.util.HashSet;
import java.util.Set;
-import javax.servlet.Filter;
-import javax.servlet.http.HttpServletRequest;
+import jakarta.servlet.Filter;
+import jakarta.servlet.http.HttpServletRequest;
import okhttp3.mockwebserver.MockResponse;
import okhttp3.mockwebserver.MockWebServer;
diff --git a/config/src/test/java/org/springframework/security/config/http/RememberMeConfigTests.java b/config/src/test/java/org/springframework/security/config/http/RememberMeConfigTests.java
index 3843c280bd4..8cc9fe2516d 100644
--- a/config/src/test/java/org/springframework/security/config/http/RememberMeConfigTests.java
+++ b/config/src/test/java/org/springframework/security/config/http/RememberMeConfigTests.java
@@ -18,7 +18,7 @@
import java.util.Collections;
-import javax.servlet.http.Cookie;
+import jakarta.servlet.http.Cookie;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
diff --git a/config/src/test/java/org/springframework/security/config/http/SecurityContextHolderAwareRequestConfigTests.java b/config/src/test/java/org/springframework/security/config/http/SecurityContextHolderAwareRequestConfigTests.java
index 7371dc5ec5f..a14b5c9c905 100644
--- a/config/src/test/java/org/springframework/security/config/http/SecurityContextHolderAwareRequestConfigTests.java
+++ b/config/src/test/java/org/springframework/security/config/http/SecurityContextHolderAwareRequestConfigTests.java
@@ -18,9 +18,9 @@
import java.io.IOException;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
+import jakarta.servlet.ServletException;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
import org.apache.http.HttpHeaders;
import org.junit.jupiter.api.Test;
diff --git a/config/src/test/java/org/springframework/security/config/http/SessionManagementConfigServlet31Tests.java b/config/src/test/java/org/springframework/security/config/http/SessionManagementConfigServlet31Tests.java
index c21f42b9850..e64e54f7e9d 100644
--- a/config/src/test/java/org/springframework/security/config/http/SessionManagementConfigServlet31Tests.java
+++ b/config/src/test/java/org/springframework/security/config/http/SessionManagementConfigServlet31Tests.java
@@ -16,7 +16,7 @@
package org.springframework.security.config.http;
-import javax.servlet.Filter;
+import jakarta.servlet.Filter;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
diff --git a/config/src/test/java/org/springframework/security/config/http/SessionManagementConfigTests.java b/config/src/test/java/org/springframework/security/config/http/SessionManagementConfigTests.java
index dc5c4c1a634..e4cbcb4f433 100644
--- a/config/src/test/java/org/springframework/security/config/http/SessionManagementConfigTests.java
+++ b/config/src/test/java/org/springframework/security/config/http/SessionManagementConfigTests.java
@@ -20,12 +20,12 @@
import java.security.Principal;
import java.util.List;
-import javax.servlet.Filter;
-import javax.servlet.ServletContext;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.servlet.http.HttpServletResponseWrapper;
+import jakarta.servlet.Filter;
+import jakarta.servlet.ServletContext;
+import jakarta.servlet.ServletException;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
+import jakarta.servlet.http.HttpServletResponseWrapper;
import org.apache.http.HttpStatus;
import org.junit.jupiter.api.Test;
diff --git a/config/src/test/java/org/springframework/security/config/http/customconfigurer/CustomHttpSecurityConfigurerTests.java b/config/src/test/java/org/springframework/security/config/http/customconfigurer/CustomHttpSecurityConfigurerTests.java
index 3644ed52eab..a6bf001e363 100644
--- a/config/src/test/java/org/springframework/security/config/http/customconfigurer/CustomHttpSecurityConfigurerTests.java
+++ b/config/src/test/java/org/springframework/security/config/http/customconfigurer/CustomHttpSecurityConfigurerTests.java
@@ -18,7 +18,7 @@
import java.util.Properties;
-import javax.servlet.http.HttpServletResponse;
+import jakarta.servlet.http.HttpServletResponse;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
diff --git a/config/src/test/java/org/springframework/security/config/method/GlobalMethodSecurityBeanDefinitionParserTests.java b/config/src/test/java/org/springframework/security/config/method/GlobalMethodSecurityBeanDefinitionParserTests.java
index c4d08dc5295..378abd27ee9 100644
--- a/config/src/test/java/org/springframework/security/config/method/GlobalMethodSecurityBeanDefinitionParserTests.java
+++ b/config/src/test/java/org/springframework/security/config/method/GlobalMethodSecurityBeanDefinitionParserTests.java
@@ -208,24 +208,6 @@ public void duplicateElementCausesError() {
.isThrownBy(() -> setContext("" + ""));
}
- // SEC-936
- @Test
- public void worksWithoutTargetOrClass() {
- // @formatter:off
- setContext(""
- + ""
- + " "
- + " "
- + ""
- + ConfigTestUtils.AUTH_PROVIDER_XML);
- // @formatter:on
- UsernamePasswordAuthenticationToken token = new UsernamePasswordAuthenticationToken("Test", "Password",
- AuthorityUtils.createAuthorityList("ROLE_SOMEOTHERROLE"));
- SecurityContextHolder.getContext().setAuthentication(token);
- this.target = (BusinessService) this.appContext.getBean("businessService");
- assertThatExceptionOfType(AccessDeniedException.class).isThrownBy(this.target::someUserMethod1);
- }
-
// Expression configuration tests
@SuppressWarnings("unchecked")
@Test
diff --git a/config/src/test/java/org/springframework/security/config/method/sec2136/JpaPermissionEvaluator.java b/config/src/test/java/org/springframework/security/config/method/sec2136/JpaPermissionEvaluator.java
index d186330f0ee..db25f03c7d4 100644
--- a/config/src/test/java/org/springframework/security/config/method/sec2136/JpaPermissionEvaluator.java
+++ b/config/src/test/java/org/springframework/security/config/method/sec2136/JpaPermissionEvaluator.java
@@ -18,7 +18,7 @@
import java.io.Serializable;
-import javax.persistence.EntityManager;
+import jakarta.persistence.EntityManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.PermissionEvaluator;
diff --git a/config/src/test/java/org/springframework/security/config/test/SpringTestContext.java b/config/src/test/java/org/springframework/security/config/test/SpringTestContext.java
index 36a741b99ad..3ca308e511c 100644
--- a/config/src/test/java/org/springframework/security/config/test/SpringTestContext.java
+++ b/config/src/test/java/org/springframework/security/config/test/SpringTestContext.java
@@ -20,10 +20,10 @@
import java.util.ArrayList;
import java.util.List;
-import javax.servlet.Filter;
-import javax.servlet.FilterChain;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
+import jakarta.servlet.Filter;
+import jakarta.servlet.FilterChain;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor;
import org.springframework.mock.web.MockServletConfig;
diff --git a/config/src/test/java/org/springframework/security/config/web/server/OAuth2ResourceServerSpecTests.java b/config/src/test/java/org/springframework/security/config/web/server/OAuth2ResourceServerSpecTests.java
index ef3ff4db4d5..4a6d0c373c8 100644
--- a/config/src/test/java/org/springframework/security/config/web/server/OAuth2ResourceServerSpecTests.java
+++ b/config/src/test/java/org/springframework/security/config/web/server/OAuth2ResourceServerSpecTests.java
@@ -28,7 +28,7 @@
import java.util.stream.Collectors;
import java.util.stream.Stream;
-import javax.annotation.PreDestroy;
+import jakarta.annotation.PreDestroy;
import okhttp3.mockwebserver.Dispatcher;
import okhttp3.mockwebserver.MockResponse;
@@ -70,7 +70,6 @@
import org.springframework.security.web.server.authentication.HttpStatusServerEntryPoint;
import org.springframework.security.web.server.authentication.ServerAuthenticationConverter;
import org.springframework.security.web.server.authorization.HttpStatusServerAccessDeniedHandler;
-import org.springframework.test.context.junit.jupiter.SpringExtension;
import org.springframework.test.web.reactive.server.WebTestClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
@@ -93,7 +92,7 @@
* Tests for
* {@link org.springframework.security.config.web.server.ServerHttpSecurity.OAuth2ResourceServerSpec}
*/
-@ExtendWith({ SpringExtension.class, SpringTestContextExtension.class })
+@ExtendWith({ SpringTestContextExtension.class })
public class OAuth2ResourceServerSpecTests {
private String expired = "eyJhbGciOiJSUzI1NiJ9.eyJleHAiOjE1MzUwMzc4OTd9.jqZDDjfc2eysX44lHXEIr9XFd2S8vjIZHCccZU-dRWMRJNsQ1QN5VNnJGklqJBXJR4qgla6cmVqPOLkUHDb0sL0nxM5XuzQaG5ZzKP81RV88shFyAiT0fD-6nl1k-Fai-Fu-VkzSpNXgeONoTxDaYhdB-yxmgrgsApgmbOTE_9AcMk-FQDXQ-pL9kynccFGV0lZx4CA7cyknKN7KBxUilfIycvXODwgKCjj_1WddLTCNGYogJJSg__7NoxzqbyWd3udbHVjqYq7GsMMrGB4_2kBD4CkghOSNcRHbT_DIXowxfAVT7PAg7Q0E5ruZsr2zPZacEUDhJ6-wbvlA0FAOUg";
diff --git a/config/src/test/java/org/springframework/security/config/websocket/WebSocketMessageBrokerConfigTests.java b/config/src/test/java/org/springframework/security/config/websocket/WebSocketMessageBrokerConfigTests.java
index 1c5eb64faa8..7496bc9c2d9 100644
--- a/config/src/test/java/org/springframework/security/config/websocket/WebSocketMessageBrokerConfigTests.java
+++ b/config/src/test/java/org/springframework/security/config/websocket/WebSocketMessageBrokerConfigTests.java
@@ -40,7 +40,7 @@
import org.springframework.messaging.handler.invocation.HandlerMethodArgumentResolver;
import org.springframework.messaging.simp.SimpMessageHeaderAccessor;
import org.springframework.messaging.simp.SimpMessageType;
-import org.springframework.messaging.support.ChannelInterceptorAdapter;
+import org.springframework.messaging.support.ChannelInterceptor;
import org.springframework.messaging.support.GenericMessage;
import org.springframework.security.access.AccessDeniedException;
import org.springframework.security.access.expression.SecurityExpressionOperations;
@@ -444,7 +444,7 @@ public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory)
}
- static class ExceptingInterceptor extends ChannelInterceptorAdapter {
+ static class ExceptingInterceptor implements ChannelInterceptor {
@Override
public Message> preSend(Message> message, MessageChannel channel) {
diff --git a/config/src/test/java/org/springframework/security/htmlunit/server/WebTestClientWebConnection.java b/config/src/test/java/org/springframework/security/htmlunit/server/WebTestClientWebConnection.java
index a2fed90d58d..91e948bf904 100644
--- a/config/src/test/java/org/springframework/security/htmlunit/server/WebTestClientWebConnection.java
+++ b/config/src/test/java/org/springframework/security/htmlunit/server/WebTestClientWebConnection.java
@@ -60,8 +60,8 @@ public WebTestClientWebConnection(WebTestClient webTestClient, WebClient webClie
* Validate the supplied {@code contextPath}.
*
* If the value is not {@code null}, it must conform to
- * {@link javax.servlet.http.HttpServletRequest#getContextPath()} which states that it
- * can be an empty string and otherwise must start with a "/" character and not end
+ * {@link jakarta.servlet.http.HttpServletRequest#getContextPath()} which states that
+ * it can be an empty string and otherwise must start with a "/" character and not end
* with a "/" character.
* @param contextPath the path to validate
*/
diff --git a/config/src/test/kotlin/org/springframework/security/config/web/servlet/AnonymousDslTests.kt b/config/src/test/kotlin/org/springframework/security/config/annotation/web/configurers/AnonymousDslTests.kt
similarity index 98%
rename from config/src/test/kotlin/org/springframework/security/config/web/servlet/AnonymousDslTests.kt
rename to config/src/test/kotlin/org/springframework/security/config/annotation/web/configurers/AnonymousDslTests.kt
index 754a9d91ff7..2574802eb04 100644
--- a/config/src/test/kotlin/org/springframework/security/config/web/servlet/AnonymousDslTests.kt
+++ b/config/src/test/kotlin/org/springframework/security/config/annotation/web/configurers/AnonymousDslTests.kt
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.springframework.security.config.web.servlet
+package org.springframework.security.config.annotation.web.configurers
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.extension.ExtendWith
diff --git a/config/src/test/kotlin/org/springframework/security/config/web/servlet/AuthorizeRequestsDslTests.kt b/config/src/test/kotlin/org/springframework/security/config/annotation/web/configurers/AuthorizeRequestsDslTests.kt
similarity index 99%
rename from config/src/test/kotlin/org/springframework/security/config/web/servlet/AuthorizeRequestsDslTests.kt
rename to config/src/test/kotlin/org/springframework/security/config/annotation/web/configurers/AuthorizeRequestsDslTests.kt
index 279d78b359a..e0f99c9b45a 100644
--- a/config/src/test/kotlin/org/springframework/security/config/web/servlet/AuthorizeRequestsDslTests.kt
+++ b/config/src/test/kotlin/org/springframework/security/config/annotation/web/configurers/AuthorizeRequestsDslTests.kt
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.springframework.security.config.web.servlet
+package org.springframework.security.config.annotation.web.configurers
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.extension.ExtendWith
diff --git a/config/src/test/kotlin/org/springframework/security/config/web/servlet/CorsDslTests.kt b/config/src/test/kotlin/org/springframework/security/config/annotation/web/configurers/CorsDslTests.kt
similarity index 98%
rename from config/src/test/kotlin/org/springframework/security/config/web/servlet/CorsDslTests.kt
rename to config/src/test/kotlin/org/springframework/security/config/annotation/web/configurers/CorsDslTests.kt
index bd33989bb7c..b12420f5732 100644
--- a/config/src/test/kotlin/org/springframework/security/config/web/servlet/CorsDslTests.kt
+++ b/config/src/test/kotlin/org/springframework/security/config/annotation/web/configurers/CorsDslTests.kt
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.springframework.security.config.web.servlet
+package org.springframework.security.config.annotation.web.configurers
import org.assertj.core.api.Assertions.assertThatThrownBy
import org.junit.jupiter.api.Test
diff --git a/config/src/test/kotlin/org/springframework/security/config/web/servlet/CsrfDslTests.kt b/config/src/test/kotlin/org/springframework/security/config/annotation/web/configurers/CsrfDslTests.kt
similarity index 99%
rename from config/src/test/kotlin/org/springframework/security/config/web/servlet/CsrfDslTests.kt
rename to config/src/test/kotlin/org/springframework/security/config/annotation/web/configurers/CsrfDslTests.kt
index 19b885e29b7..2ed2df0a1da 100644
--- a/config/src/test/kotlin/org/springframework/security/config/web/servlet/CsrfDslTests.kt
+++ b/config/src/test/kotlin/org/springframework/security/config/annotation/web/configurers/CsrfDslTests.kt
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.springframework.security.config.web.servlet
+package org.springframework.security.config.annotation.web.configurers
import io.mockk.every
import io.mockk.mockkObject
diff --git a/config/src/test/kotlin/org/springframework/security/config/web/servlet/ExceptionHandlingDslTests.kt b/config/src/test/kotlin/org/springframework/security/config/annotation/web/configurers/ExceptionHandlingDslTests.kt
similarity index 99%
rename from config/src/test/kotlin/org/springframework/security/config/web/servlet/ExceptionHandlingDslTests.kt
rename to config/src/test/kotlin/org/springframework/security/config/annotation/web/configurers/ExceptionHandlingDslTests.kt
index 43a525148f7..2e3bebbaae6 100644
--- a/config/src/test/kotlin/org/springframework/security/config/web/servlet/ExceptionHandlingDslTests.kt
+++ b/config/src/test/kotlin/org/springframework/security/config/annotation/web/configurers/ExceptionHandlingDslTests.kt
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.springframework.security.config.web.servlet
+package org.springframework.security.config.annotation.web.configurers
import org.assertj.core.api.Assertions.assertThatExceptionOfType
import org.junit.jupiter.api.Test
diff --git a/config/src/test/kotlin/org/springframework/security/config/web/servlet/FormLoginDslTests.kt b/config/src/test/kotlin/org/springframework/security/config/annotation/web/configurers/FormLoginDslTests.kt
similarity index 98%
rename from config/src/test/kotlin/org/springframework/security/config/web/servlet/FormLoginDslTests.kt
rename to config/src/test/kotlin/org/springframework/security/config/annotation/web/configurers/FormLoginDslTests.kt
index 16783f1307c..b0a88a19990 100644
--- a/config/src/test/kotlin/org/springframework/security/config/web/servlet/FormLoginDslTests.kt
+++ b/config/src/test/kotlin/org/springframework/security/config/annotation/web/configurers/FormLoginDslTests.kt
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.springframework.security.config.web.servlet
+package org.springframework.security.config.annotation.web.configurers
import io.mockk.every
import io.mockk.mockkObject
@@ -40,7 +40,7 @@ import org.springframework.test.web.servlet.get
import org.springframework.test.web.servlet.result.MockMvcResultMatchers.redirectedUrl
import org.springframework.test.web.servlet.result.MockMvcResultMatchers.status
import org.springframework.web.bind.annotation.GetMapping
-import javax.servlet.http.HttpServletRequest
+import jakarta.servlet.http.HttpServletRequest
/**
* Tests for [FormLoginDsl]
diff --git a/config/src/test/kotlin/org/springframework/security/config/web/servlet/HeadersDslTests.kt b/config/src/test/kotlin/org/springframework/security/config/annotation/web/configurers/HeadersDslTests.kt
similarity index 97%
rename from config/src/test/kotlin/org/springframework/security/config/web/servlet/HeadersDslTests.kt
rename to config/src/test/kotlin/org/springframework/security/config/annotation/web/configurers/HeadersDslTests.kt
index c2cbfb371dd..f7056433bc7 100644
--- a/config/src/test/kotlin/org/springframework/security/config/web/servlet/HeadersDslTests.kt
+++ b/config/src/test/kotlin/org/springframework/security/config/annotation/web/configurers/HeadersDslTests.kt
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.springframework.security.config.web.servlet
+package org.springframework.security.config.annotation.web.configurers
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.extension.ExtendWith
@@ -25,7 +25,6 @@ import org.springframework.security.config.annotation.web.configuration.EnableWe
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter
import org.springframework.security.config.test.SpringTestContext
import org.springframework.security.config.test.SpringTestContextExtension
-import org.springframework.security.config.web.servlet.headers.PermissionsPolicyDsl
import org.springframework.security.web.header.writers.StaticHeadersWriter
import org.springframework.security.web.header.writers.frameoptions.XFrameOptionsHeaderWriter
import org.springframework.security.web.server.header.ContentTypeOptionsServerHttpHeadersWriter
diff --git a/config/src/test/kotlin/org/springframework/security/config/web/servlet/HttpBasicDslTests.kt b/config/src/test/kotlin/org/springframework/security/config/annotation/web/configurers/HttpBasicDslTests.kt
similarity index 98%
rename from config/src/test/kotlin/org/springframework/security/config/web/servlet/HttpBasicDslTests.kt
rename to config/src/test/kotlin/org/springframework/security/config/annotation/web/configurers/HttpBasicDslTests.kt
index cb6f6b47f8c..b6dcff2e7ee 100644
--- a/config/src/test/kotlin/org/springframework/security/config/web/servlet/HttpBasicDslTests.kt
+++ b/config/src/test/kotlin/org/springframework/security/config/annotation/web/configurers/HttpBasicDslTests.kt
@@ -14,12 +14,12 @@
* limitations under the License.
*/
-package org.springframework.security.config.web.servlet
+package org.springframework.security.config.annotation.web.configurers
import io.mockk.every
import io.mockk.mockkObject
import io.mockk.verify
-import javax.servlet.http.HttpServletRequest
+import jakarta.servlet.http.HttpServletRequest
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.extension.ExtendWith
import org.springframework.beans.factory.annotation.Autowired
diff --git a/config/src/test/kotlin/org/springframework/security/config/web/servlet/HttpSecurityDslTests.kt b/config/src/test/kotlin/org/springframework/security/config/annotation/web/configurers/HttpSecurityDslTests.kt
similarity index 99%
rename from config/src/test/kotlin/org/springframework/security/config/web/servlet/HttpSecurityDslTests.kt
rename to config/src/test/kotlin/org/springframework/security/config/annotation/web/configurers/HttpSecurityDslTests.kt
index eea2c3bff1e..456f1605a6c 100644
--- a/config/src/test/kotlin/org/springframework/security/config/web/servlet/HttpSecurityDslTests.kt
+++ b/config/src/test/kotlin/org/springframework/security/config/annotation/web/configurers/HttpSecurityDslTests.kt
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.springframework.security.config.web.servlet
+package org.springframework.security.config.annotation.web.configurers
import io.mockk.every
import io.mockk.mockkObject
@@ -52,7 +52,7 @@ import org.springframework.test.web.servlet.get
import org.springframework.test.web.servlet.post
import org.springframework.test.web.servlet.request.MockMvcRequestBuilders
import org.springframework.web.servlet.config.annotation.EnableWebMvc
-import javax.servlet.Filter
+import jakarta.servlet.Filter
/**
* Tests for [HttpSecurityDsl]
diff --git a/config/src/test/kotlin/org/springframework/security/config/web/servlet/LogoutDslTests.kt b/config/src/test/kotlin/org/springframework/security/config/annotation/web/configurers/LogoutDslTests.kt
similarity index 99%
rename from config/src/test/kotlin/org/springframework/security/config/web/servlet/LogoutDslTests.kt
rename to config/src/test/kotlin/org/springframework/security/config/annotation/web/configurers/LogoutDslTests.kt
index 2bf1af54716..14a12921fd1 100644
--- a/config/src/test/kotlin/org/springframework/security/config/web/servlet/LogoutDslTests.kt
+++ b/config/src/test/kotlin/org/springframework/security/config/annotation/web/configurers/LogoutDslTests.kt
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.springframework.security.config.web.servlet
+package org.springframework.security.config.annotation.web.configurers
import io.mockk.every
import io.mockk.mockkObject
diff --git a/config/src/test/kotlin/org/springframework/security/config/web/servlet/OAuth2ClientDslTests.kt b/config/src/test/kotlin/org/springframework/security/config/annotation/web/configurers/OAuth2ClientDslTests.kt
similarity index 98%
rename from config/src/test/kotlin/org/springframework/security/config/web/servlet/OAuth2ClientDslTests.kt
rename to config/src/test/kotlin/org/springframework/security/config/annotation/web/configurers/OAuth2ClientDslTests.kt
index ba45eb97cbb..4ab7925a5d7 100644
--- a/config/src/test/kotlin/org/springframework/security/config/web/servlet/OAuth2ClientDslTests.kt
+++ b/config/src/test/kotlin/org/springframework/security/config/annotation/web/configurers/OAuth2ClientDslTests.kt
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.springframework.security.config.web.servlet
+package org.springframework.security.config.annotation.web.configurers
import io.mockk.every
import io.mockk.mockkObject
diff --git a/config/src/test/kotlin/org/springframework/security/config/web/servlet/OAuth2LoginDslTests.kt b/config/src/test/kotlin/org/springframework/security/config/annotation/web/configurers/OAuth2LoginDslTests.kt
similarity index 98%
rename from config/src/test/kotlin/org/springframework/security/config/web/servlet/OAuth2LoginDslTests.kt
rename to config/src/test/kotlin/org/springframework/security/config/annotation/web/configurers/OAuth2LoginDslTests.kt
index f0b146a3c18..333d143decb 100644
--- a/config/src/test/kotlin/org/springframework/security/config/web/servlet/OAuth2LoginDslTests.kt
+++ b/config/src/test/kotlin/org/springframework/security/config/annotation/web/configurers/OAuth2LoginDslTests.kt
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.springframework.security.config.web.servlet
+package org.springframework.security.config.annotation.web.configurers
import io.mockk.every
import io.mockk.mockkObject
@@ -42,7 +42,7 @@ import org.springframework.test.web.servlet.get
import org.springframework.test.web.servlet.post
import org.springframework.web.bind.annotation.GetMapping
import org.springframework.web.bind.annotation.RestController
-import javax.servlet.http.HttpServletRequest
+import jakarta.servlet.http.HttpServletRequest
/**
* Tests for [OAuth2LoginDsl]
diff --git a/config/src/test/kotlin/org/springframework/security/config/web/servlet/OAuth2ResourceServerDslTests.kt b/config/src/test/kotlin/org/springframework/security/config/annotation/web/configurers/OAuth2ResourceServerDslTests.kt
similarity index 98%
rename from config/src/test/kotlin/org/springframework/security/config/web/servlet/OAuth2ResourceServerDslTests.kt
rename to config/src/test/kotlin/org/springframework/security/config/annotation/web/configurers/OAuth2ResourceServerDslTests.kt
index 72b0fae55e8..d8f289cfdcb 100644
--- a/config/src/test/kotlin/org/springframework/security/config/web/servlet/OAuth2ResourceServerDslTests.kt
+++ b/config/src/test/kotlin/org/springframework/security/config/annotation/web/configurers/OAuth2ResourceServerDslTests.kt
@@ -14,13 +14,13 @@
* limitations under the License.
*/
-package org.springframework.security.config.web.servlet
+package org.springframework.security.config.annotation.web.configurers
import io.mockk.every
import io.mockk.mockk
import io.mockk.mockkObject
import io.mockk.verify
-import javax.servlet.http.HttpServletRequest
+import jakarta.servlet.http.HttpServletRequest
import org.assertj.core.api.Assertions
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.extension.ExtendWith
diff --git a/config/src/test/kotlin/org/springframework/security/config/web/servlet/PasswordManagementDslTests.kt b/config/src/test/kotlin/org/springframework/security/config/annotation/web/configurers/PasswordManagementDslTests.kt
similarity index 97%
rename from config/src/test/kotlin/org/springframework/security/config/web/servlet/PasswordManagementDslTests.kt
rename to config/src/test/kotlin/org/springframework/security/config/annotation/web/configurers/PasswordManagementDslTests.kt
index af302cf96ff..a38fee019a8 100644
--- a/config/src/test/kotlin/org/springframework/security/config/web/servlet/PasswordManagementDslTests.kt
+++ b/config/src/test/kotlin/org/springframework/security/config/annotation/web/configurers/PasswordManagementDslTests.kt
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.springframework.security.config.web.servlet
+package org.springframework.security.config.annotation.web.configurers
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.extension.ExtendWith
diff --git a/config/src/test/kotlin/org/springframework/security/config/web/servlet/PortMapperDslTests.kt b/config/src/test/kotlin/org/springframework/security/config/annotation/web/configurers/PortMapperDslTests.kt
similarity index 97%
rename from config/src/test/kotlin/org/springframework/security/config/web/servlet/PortMapperDslTests.kt
rename to config/src/test/kotlin/org/springframework/security/config/annotation/web/configurers/PortMapperDslTests.kt
index 7f020208c82..86fce3776c8 100644
--- a/config/src/test/kotlin/org/springframework/security/config/web/servlet/PortMapperDslTests.kt
+++ b/config/src/test/kotlin/org/springframework/security/config/annotation/web/configurers/PortMapperDslTests.kt
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.springframework.security.config.web.servlet
+package org.springframework.security.config.annotation.web.configurers
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.extension.ExtendWith
diff --git a/config/src/test/kotlin/org/springframework/security/config/web/servlet/RememberMeDslTests.kt b/config/src/test/kotlin/org/springframework/security/config/annotation/web/configurers/RememberMeDslTests.kt
similarity index 98%
rename from config/src/test/kotlin/org/springframework/security/config/web/servlet/RememberMeDslTests.kt
rename to config/src/test/kotlin/org/springframework/security/config/annotation/web/configurers/RememberMeDslTests.kt
index 17efacf3a4d..eea14f2fd92 100644
--- a/config/src/test/kotlin/org/springframework/security/config/web/servlet/RememberMeDslTests.kt
+++ b/config/src/test/kotlin/org/springframework/security/config/annotation/web/configurers/RememberMeDslTests.kt
@@ -14,24 +14,20 @@
* limitations under the License.
*/
-package org.springframework.security.config.web.servlet
+package org.springframework.security.config.annotation.web.configurers
-import io.mockk.Called
-import io.mockk.confirmVerified
import io.mockk.every
import io.mockk.justRun
import io.mockk.mockk
import io.mockk.mockkObject
import io.mockk.verify
-import javax.servlet.http.HttpServletRequest
+import jakarta.servlet.http.HttpServletRequest
import org.assertj.core.api.Assertions.assertThat
import org.junit.jupiter.api.Test
-import org.junit.jupiter.api.extension.ExtendWith
import org.junit.jupiter.api.fail
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.context.annotation.Bean
import org.springframework.core.annotation.Order
-import org.springframework.mock.web.MockHttpServletRequest
import org.springframework.mock.web.MockHttpSession
import org.springframework.security.authentication.RememberMeAuthenticationToken
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder
@@ -39,7 +35,6 @@ import org.springframework.security.config.annotation.web.builders.HttpSecurity
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter
import org.springframework.security.config.test.SpringTestContext
-import org.springframework.security.config.test.SpringTestContextExtension
import org.springframework.security.core.Authentication
import org.springframework.security.core.authority.AuthorityUtils
import org.springframework.security.core.userdetails.PasswordEncodedUser
diff --git a/config/src/test/kotlin/org/springframework/security/config/web/servlet/RequestCacheDslTests.kt b/config/src/test/kotlin/org/springframework/security/config/annotation/web/configurers/RequestCacheDslTests.kt
similarity index 97%
rename from config/src/test/kotlin/org/springframework/security/config/web/servlet/RequestCacheDslTests.kt
rename to config/src/test/kotlin/org/springframework/security/config/annotation/web/configurers/RequestCacheDslTests.kt
index 52ee0492e58..ff0322a996e 100644
--- a/config/src/test/kotlin/org/springframework/security/config/web/servlet/RequestCacheDslTests.kt
+++ b/config/src/test/kotlin/org/springframework/security/config/annotation/web/configurers/RequestCacheDslTests.kt
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.springframework.security.config.web.servlet
+package org.springframework.security.config.annotation.web.configurers
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.extension.ExtendWith
diff --git a/config/src/test/kotlin/org/springframework/security/config/web/servlet/RequiresChannelDslTests.kt b/config/src/test/kotlin/org/springframework/security/config/annotation/web/configurers/RequiresChannelDslTests.kt
similarity index 98%
rename from config/src/test/kotlin/org/springframework/security/config/web/servlet/RequiresChannelDslTests.kt
rename to config/src/test/kotlin/org/springframework/security/config/annotation/web/configurers/RequiresChannelDslTests.kt
index 3ec020307bc..69e19900538 100644
--- a/config/src/test/kotlin/org/springframework/security/config/web/servlet/RequiresChannelDslTests.kt
+++ b/config/src/test/kotlin/org/springframework/security/config/annotation/web/configurers/RequiresChannelDslTests.kt
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.springframework.security.config.web.servlet
+package org.springframework.security.config.annotation.web.configurers
import io.mockk.mockkObject
import io.mockk.verify
diff --git a/config/src/test/kotlin/org/springframework/security/config/web/servlet/Saml2DslTests.kt b/config/src/test/kotlin/org/springframework/security/config/annotation/web/configurers/Saml2DslTests.kt
similarity index 98%
rename from config/src/test/kotlin/org/springframework/security/config/web/servlet/Saml2DslTests.kt
rename to config/src/test/kotlin/org/springframework/security/config/annotation/web/configurers/Saml2DslTests.kt
index a9dc47a2daf..69433d5767c 100644
--- a/config/src/test/kotlin/org/springframework/security/config/web/servlet/Saml2DslTests.kt
+++ b/config/src/test/kotlin/org/springframework/security/config/annotation/web/configurers/Saml2DslTests.kt
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.springframework.security.config.web.servlet
+package org.springframework.security.config.annotation.web.configurers
import io.mockk.every
import io.mockk.mockk
diff --git a/config/src/test/kotlin/org/springframework/security/config/web/servlet/SessionManagementDslTests.kt b/config/src/test/kotlin/org/springframework/security/config/annotation/web/configurers/SessionManagementDslTests.kt
similarity index 99%
rename from config/src/test/kotlin/org/springframework/security/config/web/servlet/SessionManagementDslTests.kt
rename to config/src/test/kotlin/org/springframework/security/config/annotation/web/configurers/SessionManagementDslTests.kt
index 25302355ea2..a7a6463f8c0 100644
--- a/config/src/test/kotlin/org/springframework/security/config/web/servlet/SessionManagementDslTests.kt
+++ b/config/src/test/kotlin/org/springframework/security/config/annotation/web/configurers/SessionManagementDslTests.kt
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.springframework.security.config.web.servlet
+package org.springframework.security.config.annotation.web.configurers
import io.mockk.every
import io.mockk.justRun
diff --git a/config/src/test/kotlin/org/springframework/security/config/web/servlet/X509DslTests.kt b/config/src/test/kotlin/org/springframework/security/config/annotation/web/configurers/X509DslTests.kt
similarity index 99%
rename from config/src/test/kotlin/org/springframework/security/config/web/servlet/X509DslTests.kt
rename to config/src/test/kotlin/org/springframework/security/config/annotation/web/configurers/X509DslTests.kt
index e0f6577f149..f3334c9317d 100644
--- a/config/src/test/kotlin/org/springframework/security/config/web/servlet/X509DslTests.kt
+++ b/config/src/test/kotlin/org/springframework/security/config/annotation/web/configurers/X509DslTests.kt
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.springframework.security.config.web.servlet
+package org.springframework.security.config.annotation.web.configurers
import io.mockk.mockk
import java.security.cert.Certificate
diff --git a/config/src/test/kotlin/org/springframework/security/config/web/servlet/headers/CacheControlDslTests.kt b/config/src/test/kotlin/org/springframework/security/config/annotation/web/configurers/headers/CacheControlDslTests.kt
similarity index 95%
rename from config/src/test/kotlin/org/springframework/security/config/web/servlet/headers/CacheControlDslTests.kt
rename to config/src/test/kotlin/org/springframework/security/config/annotation/web/configurers/headers/CacheControlDslTests.kt
index ab2782ac43b..cd3c96262d1 100644
--- a/config/src/test/kotlin/org/springframework/security/config/web/servlet/headers/CacheControlDslTests.kt
+++ b/config/src/test/kotlin/org/springframework/security/config/annotation/web/configurers/headers/CacheControlDslTests.kt
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.springframework.security.config.web.servlet.headers
+package org.springframework.security.config.annotation.web.configurers.headers
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.extension.ExtendWith
@@ -23,7 +23,7 @@ import org.springframework.http.HttpHeaders
import org.springframework.security.config.annotation.web.builders.HttpSecurity
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter
-import org.springframework.security.config.web.servlet.invoke
+import org.springframework.security.config.annotation.web.configurers.invoke
import org.springframework.security.config.test.SpringTestContext
import org.springframework.security.config.test.SpringTestContextExtension
import org.springframework.test.web.servlet.MockMvc
diff --git a/config/src/test/kotlin/org/springframework/security/config/web/servlet/headers/ContentSecurityPolicyDslTests.kt b/config/src/test/kotlin/org/springframework/security/config/annotation/web/configurers/headers/ContentSecurityPolicyDslTests.kt
similarity index 96%
rename from config/src/test/kotlin/org/springframework/security/config/web/servlet/headers/ContentSecurityPolicyDslTests.kt
rename to config/src/test/kotlin/org/springframework/security/config/annotation/web/configurers/headers/ContentSecurityPolicyDslTests.kt
index b312311cd65..9e6c49c7ae5 100644
--- a/config/src/test/kotlin/org/springframework/security/config/web/servlet/headers/ContentSecurityPolicyDslTests.kt
+++ b/config/src/test/kotlin/org/springframework/security/config/annotation/web/configurers/headers/ContentSecurityPolicyDslTests.kt
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.springframework.security.config.web.servlet.headers
+package org.springframework.security.config.annotation.web.configurers.headers
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.extension.ExtendWith
@@ -22,7 +22,7 @@ import org.springframework.beans.factory.annotation.Autowired
import org.springframework.security.config.annotation.web.builders.HttpSecurity
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter
-import org.springframework.security.config.web.servlet.invoke
+import org.springframework.security.config.annotation.web.configurers.invoke
import org.springframework.security.config.test.SpringTestContext
import org.springframework.security.config.test.SpringTestContextExtension
import org.springframework.security.web.server.header.ContentSecurityPolicyServerHttpHeadersWriter
diff --git a/config/src/test/kotlin/org/springframework/security/config/web/servlet/headers/ContentTypeOptionsDslTests.kt b/config/src/test/kotlin/org/springframework/security/config/annotation/web/configurers/headers/ContentTypeOptionsDslTests.kt
similarity index 95%
rename from config/src/test/kotlin/org/springframework/security/config/web/servlet/headers/ContentTypeOptionsDslTests.kt
rename to config/src/test/kotlin/org/springframework/security/config/annotation/web/configurers/headers/ContentTypeOptionsDslTests.kt
index ce682ed76d4..42a2926c986 100644
--- a/config/src/test/kotlin/org/springframework/security/config/web/servlet/headers/ContentTypeOptionsDslTests.kt
+++ b/config/src/test/kotlin/org/springframework/security/config/annotation/web/configurers/headers/ContentTypeOptionsDslTests.kt
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.springframework.security.config.web.servlet.headers
+package org.springframework.security.config.annotation.web.configurers.headers
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.extension.ExtendWith
@@ -22,7 +22,7 @@ import org.springframework.beans.factory.annotation.Autowired
import org.springframework.security.config.annotation.web.builders.HttpSecurity
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter
-import org.springframework.security.config.web.servlet.invoke
+import org.springframework.security.config.annotation.web.configurers.invoke
import org.springframework.security.config.test.SpringTestContext
import org.springframework.security.config.test.SpringTestContextExtension
import org.springframework.security.web.server.header.ContentTypeOptionsServerHttpHeadersWriter
diff --git a/config/src/test/kotlin/org/springframework/security/config/web/servlet/headers/FrameOptionsDslTests.kt b/config/src/test/kotlin/org/springframework/security/config/annotation/web/configurers/headers/FrameOptionsDslTests.kt
similarity index 97%
rename from config/src/test/kotlin/org/springframework/security/config/web/servlet/headers/FrameOptionsDslTests.kt
rename to config/src/test/kotlin/org/springframework/security/config/annotation/web/configurers/headers/FrameOptionsDslTests.kt
index 021dda0848f..cb164d844a2 100644
--- a/config/src/test/kotlin/org/springframework/security/config/web/servlet/headers/FrameOptionsDslTests.kt
+++ b/config/src/test/kotlin/org/springframework/security/config/annotation/web/configurers/headers/FrameOptionsDslTests.kt
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.springframework.security.config.web.servlet.headers
+package org.springframework.security.config.annotation.web.configurers.headers
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.extension.ExtendWith
@@ -22,7 +22,7 @@ import org.springframework.beans.factory.annotation.Autowired
import org.springframework.security.config.annotation.web.builders.HttpSecurity
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter
-import org.springframework.security.config.web.servlet.invoke
+import org.springframework.security.config.annotation.web.configurers.invoke
import org.springframework.security.config.test.SpringTestContext
import org.springframework.security.config.test.SpringTestContextExtension
import org.springframework.security.web.header.writers.frameoptions.XFrameOptionsHeaderWriter
diff --git a/config/src/test/kotlin/org/springframework/security/config/web/servlet/headers/HttpPublicKeyPinningDslTests.kt b/config/src/test/kotlin/org/springframework/security/config/annotation/web/configurers/headers/HttpPublicKeyPinningDslTests.kt
similarity index 98%
rename from config/src/test/kotlin/org/springframework/security/config/web/servlet/headers/HttpPublicKeyPinningDslTests.kt
rename to config/src/test/kotlin/org/springframework/security/config/annotation/web/configurers/headers/HttpPublicKeyPinningDslTests.kt
index e4759fb2840..e882bf4b122 100644
--- a/config/src/test/kotlin/org/springframework/security/config/web/servlet/headers/HttpPublicKeyPinningDslTests.kt
+++ b/config/src/test/kotlin/org/springframework/security/config/annotation/web/configurers/headers/HttpPublicKeyPinningDslTests.kt
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.springframework.security.config.web.servlet.headers
+package org.springframework.security.config.annotation.web.configurers.headers
import org.assertj.core.api.Assertions
import org.junit.jupiter.api.Test
@@ -25,7 +25,7 @@ import org.springframework.security.config.annotation.web.configuration.EnableWe
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter
import org.springframework.security.config.test.SpringTestContext
import org.springframework.security.config.test.SpringTestContextExtension
-import org.springframework.security.config.web.servlet.invoke
+import org.springframework.security.config.annotation.web.configurers.invoke
import org.springframework.test.web.servlet.MockMvc
import org.springframework.test.web.servlet.get
diff --git a/config/src/test/kotlin/org/springframework/security/config/web/servlet/headers/HttpStrictTransportSecurityDslTests.kt b/config/src/test/kotlin/org/springframework/security/config/annotation/web/configurers/headers/HttpStrictTransportSecurityDslTests.kt
similarity index 97%
rename from config/src/test/kotlin/org/springframework/security/config/web/servlet/headers/HttpStrictTransportSecurityDslTests.kt
rename to config/src/test/kotlin/org/springframework/security/config/annotation/web/configurers/headers/HttpStrictTransportSecurityDslTests.kt
index 374eb607c30..9701bf418ea 100644
--- a/config/src/test/kotlin/org/springframework/security/config/web/servlet/headers/HttpStrictTransportSecurityDslTests.kt
+++ b/config/src/test/kotlin/org/springframework/security/config/annotation/web/configurers/headers/HttpStrictTransportSecurityDslTests.kt
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.springframework.security.config.web.servlet.headers
+package org.springframework.security.config.annotation.web.configurers.headers
import org.assertj.core.api.Assertions
import org.junit.jupiter.api.Test
@@ -23,7 +23,7 @@ import org.springframework.beans.factory.annotation.Autowired
import org.springframework.security.config.annotation.web.builders.HttpSecurity
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter
-import org.springframework.security.config.web.servlet.invoke
+import org.springframework.security.config.annotation.web.configurers.invoke
import org.springframework.security.config.test.SpringTestContext
import org.springframework.security.config.test.SpringTestContextExtension
import org.springframework.security.web.server.header.StrictTransportSecurityServerHttpHeadersWriter
diff --git a/config/src/test/kotlin/org/springframework/security/config/web/servlet/headers/ReferrerPolicyDslTests.kt b/config/src/test/kotlin/org/springframework/security/config/annotation/web/configurers/headers/ReferrerPolicyDslTests.kt
similarity index 95%
rename from config/src/test/kotlin/org/springframework/security/config/web/servlet/headers/ReferrerPolicyDslTests.kt
rename to config/src/test/kotlin/org/springframework/security/config/annotation/web/configurers/headers/ReferrerPolicyDslTests.kt
index c9d3c04d067..65881103f6c 100644
--- a/config/src/test/kotlin/org/springframework/security/config/web/servlet/headers/ReferrerPolicyDslTests.kt
+++ b/config/src/test/kotlin/org/springframework/security/config/annotation/web/configurers/headers/ReferrerPolicyDslTests.kt
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.springframework.security.config.web.servlet.headers
+package org.springframework.security.config.annotation.web.configurers.headers
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.extension.ExtendWith
@@ -22,7 +22,7 @@ import org.springframework.beans.factory.annotation.Autowired
import org.springframework.security.config.annotation.web.builders.HttpSecurity
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter
-import org.springframework.security.config.web.servlet.invoke
+import org.springframework.security.config.annotation.web.configurers.invoke
import org.springframework.security.config.test.SpringTestContext
import org.springframework.security.config.test.SpringTestContextExtension
import org.springframework.security.web.header.writers.ReferrerPolicyHeaderWriter
diff --git a/config/src/test/kotlin/org/springframework/security/config/web/servlet/headers/XssProtectionConfigDslTests.kt b/config/src/test/kotlin/org/springframework/security/config/annotation/web/configurers/headers/XssProtectionConfigDslTests.kt
similarity index 96%
rename from config/src/test/kotlin/org/springframework/security/config/web/servlet/headers/XssProtectionConfigDslTests.kt
rename to config/src/test/kotlin/org/springframework/security/config/annotation/web/configurers/headers/XssProtectionConfigDslTests.kt
index 8b10f28cce4..73b005cb9a7 100644
--- a/config/src/test/kotlin/org/springframework/security/config/web/servlet/headers/XssProtectionConfigDslTests.kt
+++ b/config/src/test/kotlin/org/springframework/security/config/annotation/web/configurers/headers/XssProtectionConfigDslTests.kt
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.springframework.security.config.web.servlet.headers
+package org.springframework.security.config.annotation.web.configurers.headers
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.extension.ExtendWith
@@ -22,7 +22,7 @@ import org.springframework.beans.factory.annotation.Autowired
import org.springframework.security.config.annotation.web.builders.HttpSecurity
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter
-import org.springframework.security.config.web.servlet.invoke
+import org.springframework.security.config.annotation.web.configurers.invoke
import org.springframework.security.config.test.SpringTestContext
import org.springframework.security.config.test.SpringTestContextExtension
import org.springframework.security.web.server.header.XXssProtectionServerHttpHeadersWriter
diff --git a/config/src/test/kotlin/org/springframework/security/config/web/servlet/oauth2/client/AuthorizationCodeGrantDslTests.kt b/config/src/test/kotlin/org/springframework/security/config/annotation/web/configurers/oauth2/client/AuthorizationCodeGrantDslTests.kt
similarity index 98%
rename from config/src/test/kotlin/org/springframework/security/config/web/servlet/oauth2/client/AuthorizationCodeGrantDslTests.kt
rename to config/src/test/kotlin/org/springframework/security/config/annotation/web/configurers/oauth2/client/AuthorizationCodeGrantDslTests.kt
index 72e5db552e3..0ea86c40e1d 100644
--- a/config/src/test/kotlin/org/springframework/security/config/web/servlet/oauth2/client/AuthorizationCodeGrantDslTests.kt
+++ b/config/src/test/kotlin/org/springframework/security/config/annotation/web/configurers/oauth2/client/AuthorizationCodeGrantDslTests.kt
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.springframework.security.config.web.servlet.oauth2.client
+package org.springframework.security.config.annotation.web.configurers.oauth2.client
import io.mockk.every
import io.mockk.mockk
@@ -31,7 +31,7 @@ import org.springframework.security.config.annotation.web.configuration.WebSecur
import org.springframework.security.config.oauth2.client.CommonOAuth2Provider
import org.springframework.security.config.test.SpringTestContext
import org.springframework.security.config.test.SpringTestContextExtension
-import org.springframework.security.config.web.servlet.invoke
+import org.springframework.security.config.annotation.web.configurers.invoke
import org.springframework.security.oauth2.client.endpoint.OAuth2AccessTokenResponseClient
import org.springframework.security.oauth2.client.endpoint.OAuth2AuthorizationCodeGrantRequest
import org.springframework.security.oauth2.client.registration.ClientRegistrationRepository
diff --git a/config/src/test/kotlin/org/springframework/security/config/web/servlet/oauth2/login/AuthorizationEndpointDslTests.kt b/config/src/test/kotlin/org/springframework/security/config/annotation/web/configurers/oauth2/login/AuthorizationEndpointDslTests.kt
similarity index 96%
rename from config/src/test/kotlin/org/springframework/security/config/web/servlet/oauth2/login/AuthorizationEndpointDslTests.kt
rename to config/src/test/kotlin/org/springframework/security/config/annotation/web/configurers/oauth2/login/AuthorizationEndpointDslTests.kt
index c4dff79baf6..8771468c3d6 100644
--- a/config/src/test/kotlin/org/springframework/security/config/web/servlet/oauth2/login/AuthorizationEndpointDslTests.kt
+++ b/config/src/test/kotlin/org/springframework/security/config/annotation/web/configurers/oauth2/login/AuthorizationEndpointDslTests.kt
@@ -14,12 +14,12 @@
* limitations under the License.
*/
-package org.springframework.security.config.web.servlet.oauth2.login
+package org.springframework.security.config.annotation.web.configurers.oauth2.login
import io.mockk.every
import io.mockk.mockkObject
import io.mockk.verify
-import javax.servlet.http.HttpServletRequest
+import jakarta.servlet.http.HttpServletRequest
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.extension.ExtendWith
import org.springframework.beans.factory.annotation.Autowired
@@ -31,7 +31,7 @@ import org.springframework.security.config.annotation.web.configuration.WebSecur
import org.springframework.security.config.oauth2.client.CommonOAuth2Provider
import org.springframework.security.config.test.SpringTestContext
import org.springframework.security.config.test.SpringTestContextExtension
-import org.springframework.security.config.web.servlet.invoke
+import org.springframework.security.config.annotation.web.configurers.invoke
import org.springframework.security.oauth2.client.registration.ClientRegistrationRepository
import org.springframework.security.oauth2.client.registration.InMemoryClientRegistrationRepository
import org.springframework.security.oauth2.client.web.AuthorizationRequestRepository
diff --git a/config/src/test/kotlin/org/springframework/security/config/web/servlet/oauth2/login/RedirectionEndpointDslTests.kt b/config/src/test/kotlin/org/springframework/security/config/annotation/web/configurers/oauth2/login/RedirectionEndpointDslTests.kt
similarity index 97%
rename from config/src/test/kotlin/org/springframework/security/config/web/servlet/oauth2/login/RedirectionEndpointDslTests.kt
rename to config/src/test/kotlin/org/springframework/security/config/annotation/web/configurers/oauth2/login/RedirectionEndpointDslTests.kt
index 9487e857ec8..6dacd27cdd1 100644
--- a/config/src/test/kotlin/org/springframework/security/config/web/servlet/oauth2/login/RedirectionEndpointDslTests.kt
+++ b/config/src/test/kotlin/org/springframework/security/config/annotation/web/configurers/oauth2/login/RedirectionEndpointDslTests.kt
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.springframework.security.config.web.servlet.oauth2.login
+package org.springframework.security.config.annotation.web.configurers.oauth2.login
import io.mockk.every
import io.mockk.mockkObject
@@ -29,7 +29,7 @@ import org.springframework.security.config.annotation.web.configuration.WebSecur
import org.springframework.security.config.oauth2.client.CommonOAuth2Provider
import org.springframework.security.config.test.SpringTestContext
import org.springframework.security.config.test.SpringTestContextExtension
-import org.springframework.security.config.web.servlet.invoke
+import org.springframework.security.config.annotation.web.configurers.invoke
import org.springframework.security.core.authority.SimpleGrantedAuthority
import org.springframework.security.oauth2.client.endpoint.OAuth2AccessTokenResponseClient
import org.springframework.security.oauth2.client.endpoint.OAuth2AuthorizationCodeGrantRequest
diff --git a/config/src/test/kotlin/org/springframework/security/config/web/servlet/oauth2/login/TokenEndpointDslTests.kt b/config/src/test/kotlin/org/springframework/security/config/annotation/web/configurers/oauth2/login/TokenEndpointDslTests.kt
similarity index 97%
rename from config/src/test/kotlin/org/springframework/security/config/web/servlet/oauth2/login/TokenEndpointDslTests.kt
rename to config/src/test/kotlin/org/springframework/security/config/annotation/web/configurers/oauth2/login/TokenEndpointDslTests.kt
index 9dc1df0cb51..442c03ebd07 100644
--- a/config/src/test/kotlin/org/springframework/security/config/web/servlet/oauth2/login/TokenEndpointDslTests.kt
+++ b/config/src/test/kotlin/org/springframework/security/config/annotation/web/configurers/oauth2/login/TokenEndpointDslTests.kt
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.springframework.security.config.web.servlet.oauth2.login
+package org.springframework.security.config.annotation.web.configurers.oauth2.login
import io.mockk.every
import io.mockk.mockkObject
@@ -30,7 +30,7 @@ import org.springframework.security.config.annotation.web.configuration.WebSecur
import org.springframework.security.config.oauth2.client.CommonOAuth2Provider
import org.springframework.security.config.test.SpringTestContext
import org.springframework.security.config.test.SpringTestContextExtension
-import org.springframework.security.config.web.servlet.invoke
+import org.springframework.security.config.annotation.web.configurers.invoke
import org.springframework.security.oauth2.client.endpoint.OAuth2AccessTokenResponseClient
import org.springframework.security.oauth2.client.endpoint.OAuth2AuthorizationCodeGrantRequest
import org.springframework.security.oauth2.client.registration.ClientRegistrationRepository
diff --git a/config/src/test/kotlin/org/springframework/security/config/web/servlet/oauth2/login/UserInfoEndpointDslTests.kt b/config/src/test/kotlin/org/springframework/security/config/annotation/web/configurers/oauth2/login/UserInfoEndpointDslTests.kt
similarity index 97%
rename from config/src/test/kotlin/org/springframework/security/config/web/servlet/oauth2/login/UserInfoEndpointDslTests.kt
rename to config/src/test/kotlin/org/springframework/security/config/annotation/web/configurers/oauth2/login/UserInfoEndpointDslTests.kt
index 477504ec5c3..3f5e2297f7f 100644
--- a/config/src/test/kotlin/org/springframework/security/config/web/servlet/oauth2/login/UserInfoEndpointDslTests.kt
+++ b/config/src/test/kotlin/org/springframework/security/config/annotation/web/configurers/oauth2/login/UserInfoEndpointDslTests.kt
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.springframework.security.config.web.servlet.oauth2.login
+package org.springframework.security.config.annotation.web.configurers.oauth2.login
import io.mockk.every
import io.mockk.mockk
@@ -31,7 +31,7 @@ import org.springframework.security.config.annotation.web.configuration.WebSecur
import org.springframework.security.config.oauth2.client.CommonOAuth2Provider
import org.springframework.security.config.test.SpringTestContext
import org.springframework.security.config.test.SpringTestContextExtension
-import org.springframework.security.config.web.servlet.invoke
+import org.springframework.security.config.annotation.web.configurers.invoke
import org.springframework.security.core.authority.SimpleGrantedAuthority
import org.springframework.security.oauth2.client.endpoint.OAuth2AccessTokenResponseClient
import org.springframework.security.oauth2.client.endpoint.OAuth2AuthorizationCodeGrantRequest
diff --git a/config/src/test/kotlin/org/springframework/security/config/web/servlet/oauth2/resourceserver/JwtDslTests.kt b/config/src/test/kotlin/org/springframework/security/config/annotation/web/configurers/oauth2/resourceserver/JwtDslTests.kt
similarity index 98%
rename from config/src/test/kotlin/org/springframework/security/config/web/servlet/oauth2/resourceserver/JwtDslTests.kt
rename to config/src/test/kotlin/org/springframework/security/config/annotation/web/configurers/oauth2/resourceserver/JwtDslTests.kt
index b0d92a53bd5..cd721089e09 100644
--- a/config/src/test/kotlin/org/springframework/security/config/web/servlet/oauth2/resourceserver/JwtDslTests.kt
+++ b/config/src/test/kotlin/org/springframework/security/config/annotation/web/configurers/oauth2/resourceserver/JwtDslTests.kt
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.springframework.security.config.web.servlet.oauth2.resourceserver
+package org.springframework.security.config.annotation.web.configurers.oauth2.resourceserver
import io.mockk.every
import io.mockk.mockk
@@ -35,7 +35,7 @@ import org.springframework.security.config.annotation.web.configuration.EnableWe
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter
import org.springframework.security.config.test.SpringTestContext
import org.springframework.security.config.test.SpringTestContextExtension
-import org.springframework.security.config.web.servlet.invoke
+import org.springframework.security.config.annotation.web.configurers.invoke
import org.springframework.security.core.Authentication
import org.springframework.security.oauth2.core.oidc.IdTokenClaimNames
import org.springframework.security.oauth2.jwt.Jwt
diff --git a/config/src/test/kotlin/org/springframework/security/config/web/servlet/oauth2/resourceserver/OpaqueTokenDslTests.kt b/config/src/test/kotlin/org/springframework/security/config/annotation/web/configurers/oauth2/resourceserver/OpaqueTokenDslTests.kt
similarity index 98%
rename from config/src/test/kotlin/org/springframework/security/config/web/servlet/oauth2/resourceserver/OpaqueTokenDslTests.kt
rename to config/src/test/kotlin/org/springframework/security/config/annotation/web/configurers/oauth2/resourceserver/OpaqueTokenDslTests.kt
index 218e0618b94..c6df2f0132c 100644
--- a/config/src/test/kotlin/org/springframework/security/config/web/servlet/oauth2/resourceserver/OpaqueTokenDslTests.kt
+++ b/config/src/test/kotlin/org/springframework/security/config/annotation/web/configurers/oauth2/resourceserver/OpaqueTokenDslTests.kt
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.springframework.security.config.web.servlet.oauth2.resourceserver
+package org.springframework.security.config.annotation.web.configurers.oauth2.resourceserver
import io.mockk.every
import io.mockk.mockkObject
@@ -35,7 +35,7 @@ import org.springframework.security.config.annotation.web.configuration.EnableWe
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter
import org.springframework.security.config.test.SpringTestContext
import org.springframework.security.config.test.SpringTestContextExtension
-import org.springframework.security.config.web.servlet.invoke
+import org.springframework.security.config.annotation.web.configurers.invoke
import org.springframework.security.core.Authentication
import org.springframework.security.oauth2.core.DefaultOAuth2AuthenticatedPrincipal
import org.springframework.security.oauth2.core.TestOAuth2AccessTokens
diff --git a/config/src/test/kotlin/org/springframework/security/config/web/servlet/session/SessionConcurrencyDslTests.kt b/config/src/test/kotlin/org/springframework/security/config/annotation/web/configurers/session/SessionConcurrencyDslTests.kt
similarity index 97%
rename from config/src/test/kotlin/org/springframework/security/config/web/servlet/session/SessionConcurrencyDslTests.kt
rename to config/src/test/kotlin/org/springframework/security/config/annotation/web/configurers/session/SessionConcurrencyDslTests.kt
index f35ca1284fa..cf4e1a4bd2e 100644
--- a/config/src/test/kotlin/org/springframework/security/config/web/servlet/session/SessionConcurrencyDslTests.kt
+++ b/config/src/test/kotlin/org/springframework/security/config/annotation/web/configurers/session/SessionConcurrencyDslTests.kt
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.springframework.security.config.web.servlet.session
+package org.springframework.security.config.annotation.web.configurers.session
import io.mockk.every
import io.mockk.mockkObject
@@ -30,7 +30,7 @@ import org.springframework.security.config.annotation.web.configuration.EnableWe
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter
import org.springframework.security.config.test.SpringTestContext
import org.springframework.security.config.test.SpringTestContextExtension
-import org.springframework.security.config.web.servlet.invoke
+import org.springframework.security.config.annotation.web.configurers.invoke
import org.springframework.security.core.session.SessionInformation
import org.springframework.security.core.session.SessionRegistry
import org.springframework.security.core.session.SessionRegistryImpl
diff --git a/config/src/test/kotlin/org/springframework/security/config/web/servlet/session/SessionFixationDslTests.kt b/config/src/test/kotlin/org/springframework/security/config/annotation/web/configurers/session/SessionFixationDslTests.kt
similarity index 97%
rename from config/src/test/kotlin/org/springframework/security/config/web/servlet/session/SessionFixationDslTests.kt
rename to config/src/test/kotlin/org/springframework/security/config/annotation/web/configurers/session/SessionFixationDslTests.kt
index c28d9397027..ebb3a7ea759 100644
--- a/config/src/test/kotlin/org/springframework/security/config/web/servlet/session/SessionFixationDslTests.kt
+++ b/config/src/test/kotlin/org/springframework/security/config/annotation/web/configurers/session/SessionFixationDslTests.kt
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.springframework.security.config.web.servlet.session
+package org.springframework.security.config.annotation.web.configurers.session
import org.assertj.core.api.Assertions.assertThat
import org.junit.jupiter.api.Test
@@ -28,7 +28,7 @@ import org.springframework.security.config.annotation.web.configuration.EnableWe
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter
import org.springframework.security.core.userdetails.User
import org.springframework.security.core.userdetails.UserDetailsService
-import org.springframework.security.config.web.servlet.invoke
+import org.springframework.security.config.annotation.web.configurers.invoke
import org.springframework.security.config.test.SpringTestContext
import org.springframework.security.config.test.SpringTestContextExtension
import org.springframework.security.provisioning.InMemoryUserDetailsManager
diff --git a/config/src/test/kotlin/org/springframework/security/config/web/server/ServerJwtDslTests.kt b/config/src/test/kotlin/org/springframework/security/config/web/server/ServerJwtDslTests.kt
index 52b92a041f6..2f01d9d5383 100644
--- a/config/src/test/kotlin/org/springframework/security/config/web/server/ServerJwtDslTests.kt
+++ b/config/src/test/kotlin/org/springframework/security/config/web/server/ServerJwtDslTests.kt
@@ -23,7 +23,7 @@ import java.math.BigInteger
import java.security.KeyFactory
import java.security.interfaces.RSAPublicKey
import java.security.spec.RSAPublicKeySpec
-import javax.annotation.PreDestroy
+import jakarta.annotation.PreDestroy
import okhttp3.mockwebserver.MockResponse
import okhttp3.mockwebserver.MockWebServer
import org.assertj.core.api.Assertions.assertThat
diff --git a/config/src/test/kotlin/org/springframework/security/config/web/server/ServerOpaqueTokenDslTests.kt b/config/src/test/kotlin/org/springframework/security/config/web/server/ServerOpaqueTokenDslTests.kt
index c201df93347..efa51a4b73e 100644
--- a/config/src/test/kotlin/org/springframework/security/config/web/server/ServerOpaqueTokenDslTests.kt
+++ b/config/src/test/kotlin/org/springframework/security/config/web/server/ServerOpaqueTokenDslTests.kt
@@ -33,7 +33,7 @@ import org.springframework.security.oauth2.server.resource.introspection.Reactiv
import org.springframework.security.web.server.SecurityWebFilterChain
import org.springframework.test.web.reactive.server.WebTestClient
import org.springframework.web.reactive.config.EnableWebFlux
-import javax.annotation.PreDestroy
+import jakarta.annotation.PreDestroy
/**
* Tests for [ServerOpaqueTokenDsl]
diff --git a/config/src/test/resources/org/springframework/security/config/http/MiscHttpConfigTests-CollidingFilters.xml b/config/src/test/resources/org/springframework/security/config/http/MiscHttpConfigTests-CollidingFilters.xml
index 905a1ad7025..e6a66cd5bf9 100644
--- a/config/src/test/resources/org/springframework/security/config/http/MiscHttpConfigTests-CollidingFilters.xml
+++ b/config/src/test/resources/org/springframework/security/config/http/MiscHttpConfigTests-CollidingFilters.xml
@@ -29,7 +29,7 @@
-
+
diff --git a/config/src/test/resources/org/springframework/security/config/http/MiscHttpConfigTests-CustomFilters.xml b/config/src/test/resources/org/springframework/security/config/http/MiscHttpConfigTests-CustomFilters.xml
index 024ee1f6624..e2e1ffbdc6e 100644
--- a/config/src/test/resources/org/springframework/security/config/http/MiscHttpConfigTests-CustomFilters.xml
+++ b/config/src/test/resources/org/springframework/security/config/http/MiscHttpConfigTests-CustomFilters.xml
@@ -33,7 +33,7 @@
-
+
diff --git a/core/spring-security-core.gradle b/core/spring-security-core.gradle
index 213f24f92c5..173b5baba1e 100644
--- a/core/spring-security-core.gradle
+++ b/core/spring-security-core.gradle
@@ -13,8 +13,7 @@ dependencies {
optional 'com.fasterxml.jackson.core:jackson-databind'
optional 'io.projectreactor:reactor-core'
- optional 'javax.annotation:jsr250-api'
- optional 'net.sf.ehcache:ehcache'
+ optional 'jakarta.annotation:jakarta.annotation-api'
optional 'org.aspectj:aspectjrt'
optional 'org.springframework:spring-jdbc'
optional 'org.springframework:spring-tx'
diff --git a/core/src/main/java/org/springframework/security/access/annotation/Jsr250MethodSecurityMetadataSource.java b/core/src/main/java/org/springframework/security/access/annotation/Jsr250MethodSecurityMetadataSource.java
index 2cc9700280b..0c279c92131 100644
--- a/core/src/main/java/org/springframework/security/access/annotation/Jsr250MethodSecurityMetadataSource.java
+++ b/core/src/main/java/org/springframework/security/access/annotation/Jsr250MethodSecurityMetadataSource.java
@@ -22,9 +22,9 @@
import java.util.Collection;
import java.util.List;
-import javax.annotation.security.DenyAll;
-import javax.annotation.security.PermitAll;
-import javax.annotation.security.RolesAllowed;
+import jakarta.annotation.security.DenyAll;
+import jakarta.annotation.security.PermitAll;
+import jakarta.annotation.security.RolesAllowed;
import org.springframework.core.annotation.AnnotationUtils;
import org.springframework.security.access.ConfigAttribute;
diff --git a/core/src/main/java/org/springframework/security/access/annotation/Jsr250SecurityConfig.java b/core/src/main/java/org/springframework/security/access/annotation/Jsr250SecurityConfig.java
index 133498535b1..17580721a58 100644
--- a/core/src/main/java/org/springframework/security/access/annotation/Jsr250SecurityConfig.java
+++ b/core/src/main/java/org/springframework/security/access/annotation/Jsr250SecurityConfig.java
@@ -16,8 +16,8 @@
package org.springframework.security.access.annotation;
-import javax.annotation.security.DenyAll;
-import javax.annotation.security.PermitAll;
+import jakarta.annotation.security.DenyAll;
+import jakarta.annotation.security.PermitAll;
import org.springframework.security.access.SecurityConfig;
diff --git a/core/src/main/java/org/springframework/security/authentication/rcp/RemoteAuthenticationException.java b/core/src/main/java/org/springframework/security/authentication/rcp/RemoteAuthenticationException.java
deleted file mode 100644
index fdfece6ba7c..00000000000
--- a/core/src/main/java/org/springframework/security/authentication/rcp/RemoteAuthenticationException.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright 2004, 2005, 2006 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.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.security.authentication.rcp;
-
-import org.springframework.core.NestedRuntimeException;
-import org.springframework.security.core.SpringSecurityCoreVersion;
-
-/**
- * Thrown if a RemoteAuthenticationManager cannot validate the presented
- * authentication request.
- *
- * This is thrown rather than the normal AuthenticationException because
- * AuthenticationException contains additional properties which may cause
- * issues for the remoting protocol.
- *
- * @author Ben Alex
- */
-public class RemoteAuthenticationException extends NestedRuntimeException {
-
- private static final long serialVersionUID = SpringSecurityCoreVersion.SERIAL_VERSION_UID;
-
- /**
- * Constructs a RemoteAuthenticationException with the specified message
- * and no root cause.
- * @param msg the detail message
- */
- public RemoteAuthenticationException(String msg) {
- super(msg);
- }
-
-}
diff --git a/core/src/main/java/org/springframework/security/authentication/rcp/RemoteAuthenticationManager.java b/core/src/main/java/org/springframework/security/authentication/rcp/RemoteAuthenticationManager.java
deleted file mode 100644
index f2bec46c898..00000000000
--- a/core/src/main/java/org/springframework/security/authentication/rcp/RemoteAuthenticationManager.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright 2004, 2005, 2006 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.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.security.authentication.rcp;
-
-import java.util.Collection;
-
-import org.springframework.security.core.GrantedAuthority;
-
-/**
- * Allows remote clients to attempt authentication.
- *
- * @author Ben Alex
- */
-public interface RemoteAuthenticationManager {
-
- /**
- * Attempts to authenticate the remote client using the presented username and
- * password. If authentication is successful, a collection of {@code GrantedAuthority}
- * objects will be returned.
- *
- * In order to maximise remoting protocol compatibility, a design decision was taken
- * to operate with minimal arguments and return only the minimal amount of information
- * required for remote clients to enable/disable relevant user interface commands etc.
- * There is nothing preventing users from implementing their own equivalent package
- * that works with more complex object types.
- * @param username the username the remote client wishes to authenticate with.
- * @param password the password the remote client wishes to authenticate with.
- * @return all of the granted authorities the specified username and password have
- * access to.
- * @throws RemoteAuthenticationException if the authentication failed.
- */
- Collection extends GrantedAuthority> attemptAuthentication(String username, String password)
- throws RemoteAuthenticationException;
-
-}
diff --git a/core/src/main/java/org/springframework/security/authentication/rcp/RemoteAuthenticationManagerImpl.java b/core/src/main/java/org/springframework/security/authentication/rcp/RemoteAuthenticationManagerImpl.java
deleted file mode 100644
index 2f3063cdd37..00000000000
--- a/core/src/main/java/org/springframework/security/authentication/rcp/RemoteAuthenticationManagerImpl.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Copyright 2004, 2005, 2006 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.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.security.authentication.rcp;
-
-import java.util.Collection;
-
-import org.springframework.beans.factory.InitializingBean;
-import org.springframework.security.authentication.AuthenticationManager;
-import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
-import org.springframework.security.core.AuthenticationException;
-import org.springframework.security.core.GrantedAuthority;
-import org.springframework.util.Assert;
-
-/**
- * Server-side processor of a remote authentication request.
- *
- * This bean requires no security interceptor to protect it. Instead, the bean uses the
- * configured AuthenticationManager to resolve an authentication request.
- *
- * @author Ben Alex
- */
-public class RemoteAuthenticationManagerImpl implements RemoteAuthenticationManager, InitializingBean {
-
- private AuthenticationManager authenticationManager;
-
- @Override
- public void afterPropertiesSet() {
- Assert.notNull(this.authenticationManager, "authenticationManager is required");
- }
-
- @Override
- public Collection extends GrantedAuthority> attemptAuthentication(String username, String password)
- throws RemoteAuthenticationException {
- UsernamePasswordAuthenticationToken request = new UsernamePasswordAuthenticationToken(username, password);
- try {
- return this.authenticationManager.authenticate(request).getAuthorities();
- }
- catch (AuthenticationException ex) {
- throw new RemoteAuthenticationException(ex.getMessage());
- }
- }
-
- protected AuthenticationManager getAuthenticationManager() {
- return this.authenticationManager;
- }
-
- public void setAuthenticationManager(AuthenticationManager authenticationManager) {
- this.authenticationManager = authenticationManager;
- }
-
-}
diff --git a/core/src/main/java/org/springframework/security/authentication/rcp/RemoteAuthenticationProvider.java b/core/src/main/java/org/springframework/security/authentication/rcp/RemoteAuthenticationProvider.java
deleted file mode 100644
index 3ed938a2482..00000000000
--- a/core/src/main/java/org/springframework/security/authentication/rcp/RemoteAuthenticationProvider.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Copyright 2004, 2005, 2006 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.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.security.authentication.rcp;
-
-import java.util.Collection;
-
-import org.springframework.beans.factory.InitializingBean;
-import org.springframework.security.authentication.AuthenticationProvider;
-import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
-import org.springframework.security.core.Authentication;
-import org.springframework.security.core.AuthenticationException;
-import org.springframework.security.core.GrantedAuthority;
-import org.springframework.util.Assert;
-
-/**
- * Client-side object which queries a {@link RemoteAuthenticationManager} to validate an
- * authentication request.
- *
- * A new Authentication object is created by this class comprising the
- * request Authentication object's principal,
- * credentials and the GrantedAuthority[]s returned by the
- * RemoteAuthenticationManager.
- *
- * The RemoteAuthenticationManager should not require any special username or
- * password setting on the remoting client proxy factory to execute the call. Instead the
- * entire authentication request must be encapsulated solely within the
- * Authentication request object. In practical terms this means the
- * RemoteAuthenticationManager will not be protected by BASIC or any
- * other HTTP-level authentication.
- *
- *
- * If authentication fails, a RemoteAuthenticationException will be thrown.
- * This exception should be caught and displayed to the user, enabling them to retry with
- * alternative credentials etc.
- *
- *
- * @author Ben Alex
- */
-public class RemoteAuthenticationProvider implements AuthenticationProvider, InitializingBean {
-
- private RemoteAuthenticationManager remoteAuthenticationManager;
-
- @Override
- public void afterPropertiesSet() {
- Assert.notNull(this.remoteAuthenticationManager, "remoteAuthenticationManager is mandatory");
- }
-
- @Override
- public Authentication authenticate(Authentication authentication) throws AuthenticationException {
- String username = authentication.getPrincipal().toString();
- Object credentials = authentication.getCredentials();
- String password = (credentials != null) ? credentials.toString() : null;
- Collection extends GrantedAuthority> authorities = this.remoteAuthenticationManager
- .attemptAuthentication(username, password);
- return new UsernamePasswordAuthenticationToken(username, password, authorities);
- }
-
- public RemoteAuthenticationManager getRemoteAuthenticationManager() {
- return this.remoteAuthenticationManager;
- }
-
- public void setRemoteAuthenticationManager(RemoteAuthenticationManager remoteAuthenticationManager) {
- this.remoteAuthenticationManager = remoteAuthenticationManager;
- }
-
- @Override
- public boolean supports(Class> authentication) {
- return (UsernamePasswordAuthenticationToken.class.isAssignableFrom(authentication));
- }
-
-}
diff --git a/core/src/main/java/org/springframework/security/authentication/rcp/package-info.java b/core/src/main/java/org/springframework/security/authentication/rcp/package-info.java
deleted file mode 100644
index b4010d186bb..00000000000
--- a/core/src/main/java/org/springframework/security/authentication/rcp/package-info.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * Copyright 2002-2016 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.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/**
- * Allows remote clients to authenticate and obtain a populated
- * Authentication object.
- */
-package org.springframework.security.authentication.rcp;
diff --git a/core/src/main/java/org/springframework/security/authorization/method/AuthorizationManagerBeforeMethodInterceptor.java b/core/src/main/java/org/springframework/security/authorization/method/AuthorizationManagerBeforeMethodInterceptor.java
index 38b6f03b1bf..b5a0f3b9921 100644
--- a/core/src/main/java/org/springframework/security/authorization/method/AuthorizationManagerBeforeMethodInterceptor.java
+++ b/core/src/main/java/org/springframework/security/authorization/method/AuthorizationManagerBeforeMethodInterceptor.java
@@ -18,9 +18,9 @@
import java.util.function.Supplier;
-import javax.annotation.security.DenyAll;
-import javax.annotation.security.PermitAll;
-import javax.annotation.security.RolesAllowed;
+import jakarta.annotation.security.DenyAll;
+import jakarta.annotation.security.PermitAll;
+import jakarta.annotation.security.RolesAllowed;
import org.aopalliance.aop.Advice;
import org.aopalliance.intercept.MethodInterceptor;
diff --git a/core/src/main/java/org/springframework/security/authorization/method/Jsr250AuthorizationManager.java b/core/src/main/java/org/springframework/security/authorization/method/Jsr250AuthorizationManager.java
index ccf8da60410..6f276c59343 100644
--- a/core/src/main/java/org/springframework/security/authorization/method/Jsr250AuthorizationManager.java
+++ b/core/src/main/java/org/springframework/security/authorization/method/Jsr250AuthorizationManager.java
@@ -22,9 +22,9 @@
import java.util.Set;
import java.util.function.Supplier;
-import javax.annotation.security.DenyAll;
-import javax.annotation.security.PermitAll;
-import javax.annotation.security.RolesAllowed;
+import jakarta.annotation.security.DenyAll;
+import jakarta.annotation.security.PermitAll;
+import jakarta.annotation.security.RolesAllowed;
import org.aopalliance.intercept.MethodInvocation;
diff --git a/core/src/main/java/org/springframework/security/core/SpringSecurityCoreVersion.java b/core/src/main/java/org/springframework/security/core/SpringSecurityCoreVersion.java
index 2b13e626773..682ae359130 100644
--- a/core/src/main/java/org/springframework/security/core/SpringSecurityCoreVersion.java
+++ b/core/src/main/java/org/springframework/security/core/SpringSecurityCoreVersion.java
@@ -43,7 +43,7 @@ public final class SpringSecurityCoreVersion {
* N.B. Classes are not intended to be serializable between different versions. See
* SEC-1709 for why we still need a serial version.
*/
- public static final long SERIAL_VERSION_UID = 560L;
+ public static final long SERIAL_VERSION_UID = 600L;
static final String MIN_SPRING_VERSION = getSpringVersion();
diff --git a/core/src/main/java/org/springframework/security/core/userdetails/cache/EhCacheBasedUserCache.java b/core/src/main/java/org/springframework/security/core/userdetails/cache/EhCacheBasedUserCache.java
deleted file mode 100644
index 1aba15b2186..00000000000
--- a/core/src/main/java/org/springframework/security/core/userdetails/cache/EhCacheBasedUserCache.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Copyright 2004, 2005, 2006 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.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.security.core.userdetails.cache;
-
-import net.sf.ehcache.Ehcache;
-import net.sf.ehcache.Element;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import org.springframework.beans.factory.InitializingBean;
-import org.springframework.core.log.LogMessage;
-import org.springframework.security.core.userdetails.UserCache;
-import org.springframework.security.core.userdetails.UserDetails;
-import org.springframework.util.Assert;
-
-/**
- * Caches User objects using a Spring IoC defined
- * EHCACHE.
- *
- * @author Ben Alex
- * @deprecated since 5.6. In favor of JCache based implementations
- */
-@Deprecated
-public class EhCacheBasedUserCache implements UserCache, InitializingBean {
-
- private static final Log logger = LogFactory.getLog(EhCacheBasedUserCache.class);
-
- private Ehcache cache;
-
- @Override
- public void afterPropertiesSet() {
- Assert.notNull(this.cache, "cache mandatory");
- }
-
- public Ehcache getCache() {
- return this.cache;
- }
-
- @Override
- public UserDetails getUserFromCache(String username) {
- Element element = this.cache.get(username);
- logger.debug(LogMessage.of(() -> "Cache hit: " + (element != null) + "; username: " + username));
- return (element != null) ? (UserDetails) element.getValue() : null;
- }
-
- @Override
- public void putUserInCache(UserDetails user) {
- Element element = new Element(user.getUsername(), user);
- logger.debug(LogMessage.of(() -> "Cache put: " + element.getKey()));
- this.cache.put(element);
- }
-
- public void removeUserFromCache(UserDetails user) {
- logger.debug(LogMessage.of(() -> "Cache remove: " + user.getUsername()));
- this.removeUserFromCache(user.getUsername());
- }
-
- @Override
- public void removeUserFromCache(String username) {
- this.cache.remove(username);
- }
-
- public void setCache(Ehcache cache) {
- this.cache = cache;
- }
-
-}
diff --git a/core/src/main/java/org/springframework/security/jackson2/SecurityJackson2Modules.java b/core/src/main/java/org/springframework/security/jackson2/SecurityJackson2Modules.java
index febd2b755cc..cc625e84a85 100644
--- a/core/src/main/java/org/springframework/security/jackson2/SecurityJackson2Modules.java
+++ b/core/src/main/java/org/springframework/security/jackson2/SecurityJackson2Modules.java
@@ -120,7 +120,7 @@ public static List getModules(ClassLoader loader) {
for (String className : securityJackson2ModuleClasses) {
addToModulesList(loader, modules, className);
}
- if (ClassUtils.isPresent("javax.servlet.http.Cookie", loader)) {
+ if (ClassUtils.isPresent("jakarta.servlet.http.Cookie", loader)) {
addToModulesList(loader, modules, webServletJackson2ModuleClass);
}
if (ClassUtils.isPresent("org.springframework.security.oauth2.client.OAuth2AuthorizedClient", loader)) {
diff --git a/core/src/test/java/org/springframework/security/access/annotation/BusinessService.java b/core/src/test/java/org/springframework/security/access/annotation/BusinessService.java
index 7d42e18f3c0..cafb805b1c9 100644
--- a/core/src/test/java/org/springframework/security/access/annotation/BusinessService.java
+++ b/core/src/test/java/org/springframework/security/access/annotation/BusinessService.java
@@ -19,8 +19,8 @@
import java.io.Serializable;
import java.util.List;
-import javax.annotation.security.PermitAll;
-import javax.annotation.security.RolesAllowed;
+import jakarta.annotation.security.PermitAll;
+import jakarta.annotation.security.RolesAllowed;
import org.springframework.security.access.prepost.PreAuthorize;
diff --git a/core/src/test/java/org/springframework/security/access/annotation/Jsr250BusinessServiceImpl.java b/core/src/test/java/org/springframework/security/access/annotation/Jsr250BusinessServiceImpl.java
index 09aa5ae48c3..b19b19bfcfa 100644
--- a/core/src/test/java/org/springframework/security/access/annotation/Jsr250BusinessServiceImpl.java
+++ b/core/src/test/java/org/springframework/security/access/annotation/Jsr250BusinessServiceImpl.java
@@ -19,8 +19,8 @@
import java.util.ArrayList;
import java.util.List;
-import javax.annotation.security.PermitAll;
-import javax.annotation.security.RolesAllowed;
+import jakarta.annotation.security.PermitAll;
+import jakarta.annotation.security.RolesAllowed;
/**
* @author Luke Taylor
diff --git a/core/src/test/java/org/springframework/security/access/annotation/Jsr250MethodSecurityMetadataSourceTests.java b/core/src/test/java/org/springframework/security/access/annotation/Jsr250MethodSecurityMetadataSourceTests.java
index 4c6697d6a6e..2ee09b82be5 100644
--- a/core/src/test/java/org/springframework/security/access/annotation/Jsr250MethodSecurityMetadataSourceTests.java
+++ b/core/src/test/java/org/springframework/security/access/annotation/Jsr250MethodSecurityMetadataSourceTests.java
@@ -18,8 +18,8 @@
import java.util.Collection;
-import javax.annotation.security.PermitAll;
-import javax.annotation.security.RolesAllowed;
+import jakarta.annotation.security.PermitAll;
+import jakarta.annotation.security.RolesAllowed;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
@@ -63,7 +63,7 @@ public void methodWithRolesAllowedHasCorrectAttribute() throws Exception {
public void permitAllMethodHasPermitAllAttribute() throws Exception {
ConfigAttribute[] accessAttributes = findAttributes("permitAllMethod");
assertThat(accessAttributes).hasSize(1);
- assertThat(accessAttributes[0].toString()).isEqualTo("javax.annotation.security.PermitAll");
+ assertThat(accessAttributes[0].toString()).isEqualTo("jakarta.annotation.security.PermitAll");
}
@Test
diff --git a/core/src/test/java/org/springframework/security/access/annotation/RequireAdminRole.java b/core/src/test/java/org/springframework/security/access/annotation/RequireAdminRole.java
index 70e68eda6ea..71d4dbf4f07 100644
--- a/core/src/test/java/org/springframework/security/access/annotation/RequireAdminRole.java
+++ b/core/src/test/java/org/springframework/security/access/annotation/RequireAdminRole.java
@@ -19,7 +19,7 @@
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
-import javax.annotation.security.RolesAllowed;
+import jakarta.annotation.security.RolesAllowed;
import org.springframework.security.access.prepost.PreAuthorize;
diff --git a/core/src/test/java/org/springframework/security/access/annotation/RequireUserRole.java b/core/src/test/java/org/springframework/security/access/annotation/RequireUserRole.java
index a11b7fc6def..575a326f01b 100644
--- a/core/src/test/java/org/springframework/security/access/annotation/RequireUserRole.java
+++ b/core/src/test/java/org/springframework/security/access/annotation/RequireUserRole.java
@@ -19,7 +19,7 @@
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
-import javax.annotation.security.RolesAllowed;
+import jakarta.annotation.security.RolesAllowed;
import org.springframework.security.access.prepost.PreAuthorize;
diff --git a/core/src/test/java/org/springframework/security/authentication/dao/DaoAuthenticationProviderTests.java b/core/src/test/java/org/springframework/security/authentication/dao/DaoAuthenticationProviderTests.java
index 73056c57fcc..52490153d71 100644
--- a/core/src/test/java/org/springframework/security/authentication/dao/DaoAuthenticationProviderTests.java
+++ b/core/src/test/java/org/springframework/security/authentication/dao/DaoAuthenticationProviderTests.java
@@ -22,6 +22,7 @@
import org.junit.jupiter.api.Test;
+import org.springframework.cache.Cache;
import org.springframework.dao.DataRetrievalFailureException;
import org.springframework.security.authentication.AccountExpiredException;
import org.springframework.security.authentication.AuthenticationServiceException;
@@ -41,8 +42,8 @@
import org.springframework.security.core.userdetails.UserDetailsPasswordService;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
-import org.springframework.security.core.userdetails.cache.EhCacheBasedUserCache;
import org.springframework.security.core.userdetails.cache.NullUserCache;
+import org.springframework.security.core.userdetails.cache.SpringCacheBasedUserCache;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.crypto.factory.PasswordEncoderFactories;
import org.springframework.security.crypto.password.NoOpPasswordEncoder;
@@ -326,8 +327,8 @@ public void testGettersSetters() {
DaoAuthenticationProvider provider = new DaoAuthenticationProvider();
provider.setPasswordEncoder(new BCryptPasswordEncoder());
assertThat(provider.getPasswordEncoder().getClass()).isEqualTo(BCryptPasswordEncoder.class);
- provider.setUserCache(new EhCacheBasedUserCache());
- assertThat(provider.getUserCache().getClass()).isEqualTo(EhCacheBasedUserCache.class);
+ provider.setUserCache(new SpringCacheBasedUserCache(mock(Cache.class)));
+ assertThat(provider.getUserCache().getClass()).isEqualTo(SpringCacheBasedUserCache.class);
assertThat(provider.isForcePrincipalAsString()).isFalse();
provider.setForcePrincipalAsString(true);
assertThat(provider.isForcePrincipalAsString()).isTrue();
diff --git a/core/src/test/java/org/springframework/security/authentication/rcp/RemoteAuthenticationManagerImplTests.java b/core/src/test/java/org/springframework/security/authentication/rcp/RemoteAuthenticationManagerImplTests.java
deleted file mode 100644
index 51e89c29ce0..00000000000
--- a/core/src/test/java/org/springframework/security/authentication/rcp/RemoteAuthenticationManagerImplTests.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Copyright 2004, 2005, 2006 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.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.security.authentication.rcp;
-
-import org.junit.jupiter.api.Test;
-
-import org.springframework.security.authentication.AuthenticationManager;
-import org.springframework.security.authentication.BadCredentialsException;
-import org.springframework.security.authentication.TestingAuthenticationToken;
-import org.springframework.security.core.Authentication;
-
-import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
-import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException;
-import static org.mockito.ArgumentMatchers.any;
-import static org.mockito.BDDMockito.given;
-import static org.mockito.Mockito.mock;
-
-/**
- * Tests {@link RemoteAuthenticationManagerImpl}.
- *
- * @author Ben Alex
- */
-public class RemoteAuthenticationManagerImplTests {
-
- @Test
- public void testFailedAuthenticationReturnsRemoteAuthenticationException() {
- RemoteAuthenticationManagerImpl manager = new RemoteAuthenticationManagerImpl();
- AuthenticationManager am = mock(AuthenticationManager.class);
- given(am.authenticate(any(Authentication.class))).willThrow(new BadCredentialsException(""));
- manager.setAuthenticationManager(am);
- assertThatExceptionOfType(RemoteAuthenticationException.class)
- .isThrownBy(() -> manager.attemptAuthentication("rod", "password"));
- }
-
- @Test
- public void testStartupChecksAuthenticationManagerSet() throws Exception {
- RemoteAuthenticationManagerImpl manager = new RemoteAuthenticationManagerImpl();
- assertThatIllegalArgumentException().isThrownBy(manager::afterPropertiesSet);
- manager.setAuthenticationManager(mock(AuthenticationManager.class));
- manager.afterPropertiesSet();
- }
-
- @Test
- public void testSuccessfulAuthentication() {
- RemoteAuthenticationManagerImpl manager = new RemoteAuthenticationManagerImpl();
- AuthenticationManager am = mock(AuthenticationManager.class);
- given(am.authenticate(any(Authentication.class))).willReturn(new TestingAuthenticationToken("u", "p", "A"));
- manager.setAuthenticationManager(am);
- manager.attemptAuthentication("rod", "password");
- }
-
-}
diff --git a/core/src/test/java/org/springframework/security/authentication/rcp/RemoteAuthenticationProviderTests.java b/core/src/test/java/org/springframework/security/authentication/rcp/RemoteAuthenticationProviderTests.java
deleted file mode 100644
index e2276352949..00000000000
--- a/core/src/test/java/org/springframework/security/authentication/rcp/RemoteAuthenticationProviderTests.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * Copyright 2004, 2005, 2006 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.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.security.authentication.rcp;
-
-import java.util.Collection;
-
-import org.junit.jupiter.api.Test;
-
-import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
-import org.springframework.security.core.Authentication;
-import org.springframework.security.core.GrantedAuthority;
-import org.springframework.security.core.authority.AuthorityUtils;
-
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
-import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException;
-
-/**
- * Tests {@link RemoteAuthenticationProvider}.
- *
- * @author Ben Alex
- */
-public class RemoteAuthenticationProviderTests {
-
- @Test
- public void testExceptionsGetPassedBackToCaller() {
- RemoteAuthenticationProvider provider = new RemoteAuthenticationProvider();
- provider.setRemoteAuthenticationManager(new MockRemoteAuthenticationManager(false));
- assertThatExceptionOfType(RemoteAuthenticationException.class)
- .isThrownBy(() -> provider.authenticate(new UsernamePasswordAuthenticationToken("rod", "password")));
- }
-
- @Test
- public void testGettersSetters() {
- RemoteAuthenticationProvider provider = new RemoteAuthenticationProvider();
- provider.setRemoteAuthenticationManager(new MockRemoteAuthenticationManager(true));
- assertThat(provider.getRemoteAuthenticationManager()).isNotNull();
- }
-
- @Test
- public void testStartupChecksAuthenticationManagerSet() throws Exception {
- RemoteAuthenticationProvider provider = new RemoteAuthenticationProvider();
- assertThatIllegalArgumentException().isThrownBy(provider::afterPropertiesSet);
- provider.setRemoteAuthenticationManager(new MockRemoteAuthenticationManager(true));
- provider.afterPropertiesSet();
- }
-
- @Test
- public void testSuccessfulAuthenticationCreatesObject() {
- RemoteAuthenticationProvider provider = new RemoteAuthenticationProvider();
- provider.setRemoteAuthenticationManager(new MockRemoteAuthenticationManager(true));
- Authentication result = provider.authenticate(new UsernamePasswordAuthenticationToken("rod", "password"));
- assertThat(result.getPrincipal()).isEqualTo("rod");
- assertThat(result.getCredentials()).isEqualTo("password");
- assertThat(AuthorityUtils.authorityListToSet(result.getAuthorities())).contains("foo");
- }
-
- @Test
- public void testNullCredentialsDoesNotCauseNullPointerException() {
- RemoteAuthenticationProvider provider = new RemoteAuthenticationProvider();
- provider.setRemoteAuthenticationManager(new MockRemoteAuthenticationManager(false));
- assertThatExceptionOfType(RemoteAuthenticationException.class)
- .isThrownBy(() -> provider.authenticate(new UsernamePasswordAuthenticationToken("rod", null)));
- }
-
- @Test
- public void testSupports() {
- RemoteAuthenticationProvider provider = new RemoteAuthenticationProvider();
- assertThat(provider.supports(UsernamePasswordAuthenticationToken.class)).isTrue();
- }
-
- private class MockRemoteAuthenticationManager implements RemoteAuthenticationManager {
-
- private boolean grantAccess;
-
- MockRemoteAuthenticationManager(boolean grantAccess) {
- this.grantAccess = grantAccess;
- }
-
- @Override
- public Collection extends GrantedAuthority> attemptAuthentication(String username, String password)
- throws RemoteAuthenticationException {
- if (this.grantAccess) {
- return AuthorityUtils.createAuthorityList("foo");
- }
- else {
- throw new RemoteAuthenticationException("as requested");
- }
- }
-
- }
-
-}
diff --git a/core/src/test/java/org/springframework/security/authorization/method/Jsr250AuthorizationManagerTests.java b/core/src/test/java/org/springframework/security/authorization/method/Jsr250AuthorizationManagerTests.java
index 504effbab83..8e8db58b51c 100644
--- a/core/src/test/java/org/springframework/security/authorization/method/Jsr250AuthorizationManagerTests.java
+++ b/core/src/test/java/org/springframework/security/authorization/method/Jsr250AuthorizationManagerTests.java
@@ -20,9 +20,9 @@
import java.lang.annotation.RetentionPolicy;
import java.util.function.Supplier;
-import javax.annotation.security.DenyAll;
-import javax.annotation.security.PermitAll;
-import javax.annotation.security.RolesAllowed;
+import jakarta.annotation.security.DenyAll;
+import jakarta.annotation.security.PermitAll;
+import jakarta.annotation.security.RolesAllowed;
import org.junit.jupiter.api.Test;
diff --git a/core/src/test/java/org/springframework/security/core/JavaVersionTests.java b/core/src/test/java/org/springframework/security/core/JavaVersionTests.java
index 80a8e2ef388..f36cb6f7180 100644
--- a/core/src/test/java/org/springframework/security/core/JavaVersionTests.java
+++ b/core/src/test/java/org/springframework/security/core/JavaVersionTests.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2016 the original author or authors.
+ * Copyright 2002-2021 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.
@@ -29,7 +29,7 @@
*/
public class JavaVersionTests {
- private static final int JDK8_CLASS_VERSION = 52;
+ private static final int JDK17_CLASS_VERSION = 61;
@Test
public void authenticationCorrectJdkCompatibility() throws Exception {
@@ -44,7 +44,7 @@ private void assertClassVersion(Class> clazz) throws Exception {
data.readInt();
data.readShort(); // minor
int major = data.readShort();
- assertThat(major).isEqualTo(JDK8_CLASS_VERSION);
+ assertThat(major).isEqualTo(JDK17_CLASS_VERSION);
}
}
diff --git a/core/src/test/java/org/springframework/security/core/userdetails/cache/EhCacheBasedUserCacheTests.java b/core/src/test/java/org/springframework/security/core/userdetails/cache/EhCacheBasedUserCacheTests.java
deleted file mode 100644
index 907290dd63c..00000000000
--- a/core/src/test/java/org/springframework/security/core/userdetails/cache/EhCacheBasedUserCacheTests.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Copyright 2004, 2005, 2006 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.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.security.core.userdetails.cache;
-
-import net.sf.ehcache.Cache;
-import net.sf.ehcache.CacheManager;
-import net.sf.ehcache.Ehcache;
-import org.junit.jupiter.api.AfterAll;
-import org.junit.jupiter.api.BeforeAll;
-import org.junit.jupiter.api.Test;
-
-import org.springframework.security.core.authority.AuthorityUtils;
-import org.springframework.security.core.userdetails.User;
-
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException;
-
-/**
- * Tests {@link EhCacheBasedUserCache}.
- *
- * @author Ben Alex
- */
-public class EhCacheBasedUserCacheTests {
-
- private static CacheManager cacheManager;
-
- @BeforeAll
- public static void initCacheManaer() {
- cacheManager = CacheManager.create();
- cacheManager.addCache(new Cache("ehcacheusercachetests", 500, false, false, 30, 30));
- }
-
- @AfterAll
- public static void shutdownCacheManager() {
- cacheManager.removalAll();
- cacheManager.shutdown();
- }
-
- private Ehcache getCache() {
- Ehcache cache = cacheManager.getCache("ehcacheusercachetests");
- cache.removeAll();
- return cache;
- }
-
- private User getUser() {
- return new User("john", "password", true, true, true, true,
- AuthorityUtils.createAuthorityList("ROLE_ONE", "ROLE_TWO"));
- }
-
- @Test
- public void cacheOperationsAreSuccessful() throws Exception {
- EhCacheBasedUserCache cache = new EhCacheBasedUserCache();
- cache.setCache(getCache());
- cache.afterPropertiesSet();
- // Check it gets stored in the cache
- cache.putUserInCache(getUser());
- assertThat(getUser().getPassword()).isEqualTo(cache.getUserFromCache(getUser().getUsername()).getPassword());
- // Check it gets removed from the cache
- cache.removeUserFromCache(getUser());
- assertThat(cache.getUserFromCache(getUser().getUsername())).isNull();
- // Check it doesn't return values for null or unknown users
- assertThat(cache.getUserFromCache(null)).isNull();
- assertThat(cache.getUserFromCache("UNKNOWN_USER")).isNull();
- }
-
- @Test
- public void startupDetectsMissingCache() throws Exception {
- EhCacheBasedUserCache cache = new EhCacheBasedUserCache();
- assertThatIllegalArgumentException().isThrownBy(cache::afterPropertiesSet);
- Ehcache myCache = getCache();
- cache.setCache(myCache);
- assertThat(cache.getCache()).isEqualTo(myCache);
- }
-
-}
diff --git a/data/spring-security-data.gradle b/data/spring-security-data.gradle
index e0c9f14dab7..3e915ef871d 100644
--- a/data/spring-security-data.gradle
+++ b/data/spring-security-data.gradle
@@ -3,7 +3,7 @@ apply plugin: 'io.spring.convention.spring-module'
dependencies {
management platform(project(":spring-security-dependencies"))
api project(':spring-security-core')
- api 'javax.xml.bind:jaxb-api'
+ api 'jakarta.xml.bind:jakarta.xml.bind-api'
api 'org.springframework.data:spring-data-commons'
api 'org.springframework:spring-core'
diff --git a/dependencies/spring-security-dependencies.gradle b/dependencies/spring-security-dependencies.gradle
index b2cc1be458d..fd7f082982c 100644
--- a/dependencies/spring-security-dependencies.gradle
+++ b/dependencies/spring-security-dependencies.gradle
@@ -11,7 +11,7 @@ dependencies {
api platform("io.projectreactor:reactor-bom:2020.0.12")
api platform("io.rsocket:rsocket-bom:1.1.1")
api platform("org.junit:junit-bom:5.8.1")
- api platform("org.springframework.data:spring-data-bom:2021.1.0-M1")
+ api platform("org.springframework.data:spring-data-bom:2022.1.0-SNAPSHOT")
api platform("org.jetbrains.kotlin:kotlin-bom:$kotlinVersion")
api platform("org.jetbrains.kotlinx:kotlinx-coroutines-bom:1.5.2")
api platform("com.fasterxml.jackson:jackson-bom:2.13.0")
@@ -27,14 +27,13 @@ dependencies {
api "commons-collections:commons-collections:3.2.2"
api "commons-logging:commons-logging:1.2"
api "io.mockk:mockk:1.12.0"
- api "io.projectreactor.tools:blockhound:1.0.6.RELEASE"
- api "javax.annotation:jsr250-api:1.0"
- api "javax.servlet.jsp.jstl:javax.servlet.jsp.jstl-api:1.2.2"
- api "javax.servlet.jsp:javax.servlet.jsp-api:2.3.3"
- api "javax.servlet:javax.servlet-api:4.0.1"
- api "javax.xml.bind:jaxb-api:2.3.1"
+ api "jakarta.annotation:jakarta.annotation-api:2.0.0"
+ api "jakarta.servlet.jsp.jstl:jakarta.servlet.jsp.jstl-api:2.0.0"
+ api "jakarta.servlet.jsp:jakarta.servlet.jsp-api:3.0.0"
+ api "jakarta.servlet:jakarta.servlet-api:5.0.0"
+ api "jakarta.xml.bind:jakarta.xml.bind-api:3.0.1"
+ api "jakarta.persistence:jakarta.persistence-api:3.0.0"
api "ldapsdk:ldapsdk:4.1"
- api "net.sf.ehcache:ehcache:2.10.9.2"
api "net.sourceforge.htmlunit:htmlunit:2.54.0"
api "net.sourceforge.nekohtml:nekohtml:1.9.22"
api "org.apache.directory.server:apacheds-core-entry:1.5.5"
@@ -49,11 +48,11 @@ dependencies {
api "org.assertj:assertj-core:3.21.0"
api "org.bouncycastle:bcpkix-jdk15on:1.69"
api "org.bouncycastle:bcprov-jdk15on:1.69"
- api "org.eclipse.jetty:jetty-server:9.4.44.v20210927"
- api "org.eclipse.jetty:jetty-servlet:9.4.44.v20210927"
- api "org.eclipse.persistence:javax.persistence:2.2.1"
+ api "org.eclipse.jetty:jetty-server:11.0.6"
+ api "org.eclipse.jetty:jetty-servlet:11.0.6"
+ api "jakarta.persistence:jakarta.persistence-api:3.0.0"
api "org.hamcrest:hamcrest:2.2"
- api "org.hibernate:hibernate-entitymanager:5.6.0.Final"
+ api "org.hibernate:hibernate-core-jakarta:5.6.0.Final"
api "org.hsqldb:hsqldb:2.6.0"
api "org.jasig.cas.client:cas-client-core:3.6.2"
api "org.mockito:mockito-core:3.12.4"
@@ -64,7 +63,7 @@ dependencies {
api "org.opensaml:opensaml-saml-api:$openSamlVersion"
api "org.opensaml:opensaml-saml-impl:$openSamlVersion"
api "org.python:jython:2.5.3"
- api "org.seleniumhq.selenium:htmlunit-driver:2.54.0"
+ api "org.seleniumhq.selenium:htmlunit-driver:2.52.0"
api "org.seleniumhq.selenium:selenium-java:3.141.59"
api "org.seleniumhq.selenium:selenium-support:3.141.59"
api "org.skyscreamer:jsonassert:1.5.0"
diff --git a/docs/modules/ROOT/pages/modules.adoc b/docs/modules/ROOT/pages/modules.adoc
index 3503fea601b..accef8b430e 100644
--- a/docs/modules/ROOT/pages/modules.adoc
+++ b/docs/modules/ROOT/pages/modules.adoc
@@ -21,7 +21,7 @@ Where a module depends on another Spring Security module, the non-optional depen
[[spring-security-core]]
== Core -- `spring-security-core.jar`
-This module contains core authentication and access-contol classes and interfaces, remoting support, and basic provisioning APIs.
+This module contains core authentication and access-contol classes and interfaces, and basic provisioning APIs.
It is required by any application that uses Spring Security.
It supports standalone applications, remote clients, method (service layer) security, and JDBC user provisioning.
It contains the following top-level packages:
@@ -69,25 +69,6 @@ It contains the following top-level packages:
|===
-[[spring-security-remoting]]
-== Remoting -- `spring-security-remoting.jar`
-This module provides integration with Spring Remoting.
-You do not need this unless you are writing a remote client that uses Spring Remoting.
-The main package is `org.springframework.security.remoting`.
-
-.Remoting Dependencies
-|===
-| Dependency | Version | Description
-
-| spring-security-core
-|
-|
-
-| spring-web
-|
-| Required for clients which use HTTP remoting support.
-|===
-
[[spring-security-web]]
== Web -- `spring-security-web.jar`
This module contains filters and related web-security infrastructure code.
diff --git a/docs/modules/ROOT/pages/servlet/appendix/faq.adoc b/docs/modules/ROOT/pages/servlet/appendix/faq.adoc
index 87dcff45642..4eda4df8ef0 100644
--- a/docs/modules/ROOT/pages/servlet/appendix/faq.adoc
+++ b/docs/modules/ROOT/pages/servlet/appendix/faq.adoc
@@ -305,7 +305,7 @@ This usually means that the user's application is creating a session somewhere,
The most common culprit is a JSP. Many people aren't aware that JSPs create sessions by default.
To prevent a JSP from creating a session, add the directive `<%@ page session="false" %>` to the top of the page.
-If you are having trouble working out where a session is being created, you can add some debugging code to track down the location(s). One way to do this would be to add a `javax.servlet.http.HttpSessionListener` to your application, which calls `Thread.dumpStack()` in the `sessionCreated` method.
+If you are having trouble working out where a session is being created, you can add some debugging code to track down the location(s). One way to do this would be to add a `jakarta.servlet.http.HttpSessionListener` to your application, which calls `Thread.dumpStack()` in the `sessionCreated` method.
[[appendix-faq-forbidden-csrf]]
=== I get a 403 Forbidden when performing a POST
diff --git a/docs/modules/ROOT/pages/servlet/appendix/namespace.adoc b/docs/modules/ROOT/pages/servlet/appendix/namespace.adoc
index a6518b4ed13..d67429fc9e1 100644
--- a/docs/modules/ROOT/pages/servlet/appendix/namespace.adoc
+++ b/docs/modules/ROOT/pages/servlet/appendix/namespace.adoc
@@ -709,7 +709,7 @@ Default is any HTTP method except "GET", "TRACE", "HEAD", "OPTIONS".
[[nsa-custom-filter]]
===
This element is used to add a filter to the filter chain.
-It doesn't create any additional beans but is used to select a bean of type `javax.servlet.Filter` which is already defined in the application context and add that at a particular position in the filter chain maintained by Spring Security.
+It doesn't create any additional beans but is used to select a bean of type `jakarta.servlet.Filter` which is already defined in the application context and add that at a particular position in the filter chain maintained by Spring Security.
Full details can be found in the xref:servlet/configuration/xml-namespace.adoc#ns-custom-filters[ namespace chapter].
diff --git a/docs/modules/ROOT/pages/servlet/authentication/session-management.adoc b/docs/modules/ROOT/pages/servlet/authentication/session-management.adoc
index 6024d34a1bd..d677336f019 100644
--- a/docs/modules/ROOT/pages/servlet/authentication/session-management.adoc
+++ b/docs/modules/ROOT/pages/servlet/authentication/session-management.adoc
@@ -186,7 +186,7 @@ This is the default in Servlet 3.1 and newer containers.
When session fixation protection occurs, it results in a `SessionFixationProtectionEvent` being published in the application context.
-If you use `changeSessionId`, this protection will __also__ result in any ``javax.servlet.http.HttpSessionIdListener``s being notified, so use caution if your code listens for both events.
+If you use `changeSessionId`, this protection will __also__ result in any ``jakarta.servlet.http.HttpSessionIdListener``s being notified, so use caution if your code listens for both events.
See the <> chapter for additional information.
== SessionManagementFilter
diff --git a/docs/modules/ROOT/pages/servlet/integrations/servlet-api.adoc b/docs/modules/ROOT/pages/servlet/integrations/servlet-api.adoc
index 741a0629f73..b3b0267ac54 100644
--- a/docs/modules/ROOT/pages/servlet/integrations/servlet-api.adoc
+++ b/docs/modules/ROOT/pages/servlet/integrations/servlet-api.adoc
@@ -84,7 +84,7 @@ The following section describes the Servlet 3 methods that Spring Security integ
[[servletapi-authenticate]]
=== HttpServletRequest.authenticate(HttpServletRequest,HttpServletResponse)
-The https://docs.oracle.com/javaee/6/api/javax/servlet/http/HttpServletRequest.html#authenticate%28javax.servlet.http.HttpServletResponse%29[HttpServletRequest.authenticate(HttpServletRequest,HttpServletResponse)] method can be used to ensure that a user is authenticated.
+The https://docs.oracle.com/javaee/6/api/javax/servlet/http/HttpServletRequest.html#authenticate%28jakarta.servlet.http.HttpServletResponse%29[HttpServletRequest.authenticate(HttpServletRequest,HttpServletResponse)] method can be used to ensure that a user is authenticated.
If they are not authenticated, the configured AuthenticationEntryPoint will be used to request the user to authenticate (i.e. redirect to the login page).
diff --git a/etc/checkstyle/checkstyle-suppressions.xml b/etc/checkstyle/checkstyle-suppressions.xml
index e42d8124ea5..b7f5427cb63 100644
--- a/etc/checkstyle/checkstyle-suppressions.xml
+++ b/etc/checkstyle/checkstyle-suppressions.xml
@@ -13,6 +13,7 @@
+
diff --git a/gradle.properties b/gradle.properties
index 7b3f61fcec0..0f86c7d74cf 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -1,12 +1,12 @@
-aspectjVersion=1.9.7
+aspectjVersion=1.9.8.RC1
springJavaformatVersion=0.0.29
springBootVersion=2.4.2
-springFrameworkVersion=5.3.11
+springFrameworkVersion=6.0.0-SNAPSHOT
openSamlVersion=3.4.6
-version=5.6.0-RC1
+version=6.0.0-SNAPSHOT
kotlinVersion=1.5.31
-samplesBranch=main
-org.gradle.jvmargs=-Xmx3g -XX:MaxPermSize=2048m -XX:+HeapDumpOnOutOfMemoryError
+samplesBranch=6.0.x
+org.gradle.jvmargs=-Xmx3g -XX:+HeapDumpOnOutOfMemoryError
org.gradle.parallel=true
org.gradle.caching=true
kotlin.stdlib.default.dependency=false
diff --git a/itest/context/spring-security-itest-context.gradle b/itest/context/spring-security-itest-context.gradle
index 9e3334454ab..15d323cc9f2 100644
--- a/itest/context/spring-security-itest-context.gradle
+++ b/itest/context/spring-security-itest-context.gradle
@@ -10,7 +10,7 @@ dependencies {
implementation 'org.springframework:spring-tx'
testImplementation project(':spring-security-web')
- testImplementation 'javax.servlet:javax.servlet-api'
+ testImplementation 'jakarta.servlet:jakarta.servlet-api'
testImplementation 'org.springframework:spring-web'
testImplementation "org.assertj:assertj-core"
testImplementation "org.junit.jupiter:junit-jupiter-api"
diff --git a/itest/context/src/integration-test/java/org/springframework/security/integration/HttpNamespaceWithMultipleInterceptorsTests.java b/itest/context/src/integration-test/java/org/springframework/security/integration/HttpNamespaceWithMultipleInterceptorsTests.java
index 8f52555cdbc..ea9a91c155a 100644
--- a/itest/context/src/integration-test/java/org/springframework/security/integration/HttpNamespaceWithMultipleInterceptorsTests.java
+++ b/itest/context/src/integration-test/java/org/springframework/security/integration/HttpNamespaceWithMultipleInterceptorsTests.java
@@ -16,7 +16,7 @@
package org.springframework.security.integration;
-import javax.servlet.http.HttpSession;
+import jakarta.servlet.http.HttpSession;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
diff --git a/itest/context/src/integration-test/java/org/springframework/security/integration/HttpPathParameterStrippingTests.java b/itest/context/src/integration-test/java/org/springframework/security/integration/HttpPathParameterStrippingTests.java
index 7ddef561722..44af9454501 100644
--- a/itest/context/src/integration-test/java/org/springframework/security/integration/HttpPathParameterStrippingTests.java
+++ b/itest/context/src/integration-test/java/org/springframework/security/integration/HttpPathParameterStrippingTests.java
@@ -16,7 +16,7 @@
package org.springframework.security.integration;
-import javax.servlet.http.HttpSession;
+import jakarta.servlet.http.HttpSession;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
diff --git a/itest/context/src/integration-test/java/org/springframework/security/integration/SEC936ApplicationContextTests.java b/itest/context/src/integration-test/java/org/springframework/security/integration/SEC936ApplicationContextTests.java
deleted file mode 100644
index cc49be6d4e0..00000000000
--- a/itest/context/src/integration-test/java/org/springframework/security/integration/SEC936ApplicationContextTests.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright 2002-2016 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.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.security.integration;
-
-import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.ExtendWith;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.security.access.AccessDeniedException;
-import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
-import org.springframework.security.core.context.SecurityContextHolder;
-import org.springframework.security.core.session.SessionRegistry;
-import org.springframework.test.context.ContextConfiguration;
-import org.springframework.test.context.junit.jupiter.SpringExtension;
-
-import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
-
-/**
- * @author Luke Taylor
- * @since 2.0
- */
-@ContextConfiguration(locations = { "/sec-936-app-context.xml" })
-@ExtendWith(SpringExtension.class)
-public class SEC936ApplicationContextTests {
-
- /**
- * SessionRegistry is used as the test service interface (nothing to do with the test)
- */
- @Autowired
- private SessionRegistry sessionRegistry;
-
- @Test
- public void securityInterceptorHandlesCallWithNoTargetObject() {
- SecurityContextHolder.getContext()
- .setAuthentication(new UsernamePasswordAuthenticationToken("bob", "bobspassword"));
- assertThatExceptionOfType(AccessDeniedException.class).isThrownBy(this.sessionRegistry::getAllPrincipals);
- }
-
-}
diff --git a/itest/context/src/integration-test/java/org/springframework/security/performance/FilterChainPerformanceTests.java b/itest/context/src/integration-test/java/org/springframework/security/performance/FilterChainPerformanceTests.java
index e53d4f839e6..a450851c4f0 100644
--- a/itest/context/src/integration-test/java/org/springframework/security/performance/FilterChainPerformanceTests.java
+++ b/itest/context/src/integration-test/java/org/springframework/security/performance/FilterChainPerformanceTests.java
@@ -19,7 +19,7 @@
import java.util.Arrays;
import java.util.List;
-import javax.servlet.http.HttpSession;
+import jakarta.servlet.http.HttpSession;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.AfterEach;
diff --git a/itest/web/spring-security-itest-web.gradle b/itest/web/spring-security-itest-web.gradle
index 26feb48b14e..4a82c48b079 100644
--- a/itest/web/spring-security-itest-web.gradle
+++ b/itest/web/spring-security-itest-web.gradle
@@ -5,7 +5,7 @@ dependencies {
implementation 'org.springframework:spring-context'
implementation 'org.springframework:spring-web'
- compileOnly 'javax.servlet:javax.servlet-api'
+ compileOnly 'jakarta.servlet:jakarta.servlet-api'
testImplementation project(':spring-security-core')
testImplementation project(':spring-security-test')
@@ -21,7 +21,7 @@ dependencies {
testImplementation "org.mockito:mockito-core"
testImplementation "org.mockito:mockito-junit-jupiter"
testImplementation "org.springframework:spring-test"
- testImplementation 'javax.servlet:javax.servlet-api'
+ testImplementation 'jakarta.servlet:jakarta.servlet-api'
testRuntimeOnly project(':spring-security-config')
testRuntimeOnly project(':spring-security-ldap')
diff --git a/messaging/spring-security-messaging.gradle b/messaging/spring-security-messaging.gradle
index 6556c0e6b00..b5a8e03ec7a 100644
--- a/messaging/spring-security-messaging.gradle
+++ b/messaging/spring-security-messaging.gradle
@@ -12,7 +12,7 @@ dependencies {
optional project(':spring-security-web')
optional 'org.springframework:spring-websocket'
optional 'io.projectreactor:reactor-core'
- optional 'javax.servlet:javax.servlet-api'
+ optional 'jakarta.servlet:jakarta.servlet-api'
testImplementation project(path: ':spring-security-core', configuration: 'tests')
testImplementation 'commons-codec:commons-codec'
diff --git a/messaging/src/main/java/org/springframework/security/messaging/context/SecurityContextChannelInterceptor.java b/messaging/src/main/java/org/springframework/security/messaging/context/SecurityContextChannelInterceptor.java
index 594cfcacba8..b7f959c499d 100644
--- a/messaging/src/main/java/org/springframework/security/messaging/context/SecurityContextChannelInterceptor.java
+++ b/messaging/src/main/java/org/springframework/security/messaging/context/SecurityContextChannelInterceptor.java
@@ -22,7 +22,7 @@
import org.springframework.messaging.MessageChannel;
import org.springframework.messaging.MessageHandler;
import org.springframework.messaging.simp.SimpMessageHeaderAccessor;
-import org.springframework.messaging.support.ChannelInterceptorAdapter;
+import org.springframework.messaging.support.ChannelInterceptor;
import org.springframework.messaging.support.ExecutorChannelInterceptor;
import org.springframework.security.authentication.AnonymousAuthenticationToken;
import org.springframework.security.core.Authentication;
@@ -40,8 +40,7 @@
* @author Rob Winch
* @since 4.0
*/
-public final class SecurityContextChannelInterceptor extends ChannelInterceptorAdapter
- implements ExecutorChannelInterceptor {
+public final class SecurityContextChannelInterceptor implements ExecutorChannelInterceptor, ChannelInterceptor {
private static final SecurityContext EMPTY_CONTEXT = SecurityContextHolder.createEmptyContext();
diff --git a/messaging/src/main/java/org/springframework/security/messaging/web/csrf/CsrfChannelInterceptor.java b/messaging/src/main/java/org/springframework/security/messaging/web/csrf/CsrfChannelInterceptor.java
index 059b34bddba..cc2a696662c 100644
--- a/messaging/src/main/java/org/springframework/security/messaging/web/csrf/CsrfChannelInterceptor.java
+++ b/messaging/src/main/java/org/springframework/security/messaging/web/csrf/CsrfChannelInterceptor.java
@@ -22,7 +22,7 @@
import org.springframework.messaging.MessageChannel;
import org.springframework.messaging.simp.SimpMessageHeaderAccessor;
import org.springframework.messaging.simp.SimpMessageType;
-import org.springframework.messaging.support.ChannelInterceptorAdapter;
+import org.springframework.messaging.support.ChannelInterceptor;
import org.springframework.security.messaging.util.matcher.MessageMatcher;
import org.springframework.security.messaging.util.matcher.SimpMessageTypeMatcher;
import org.springframework.security.web.csrf.CsrfToken;
@@ -30,14 +30,14 @@
import org.springframework.security.web.csrf.MissingCsrfTokenException;
/**
- * {@link ChannelInterceptorAdapter} that validates that a valid CSRF is included in the
- * header of any {@link SimpMessageType#CONNECT} message. The expected {@link CsrfToken}
- * is populated by CsrfTokenHandshakeInterceptor.
+ * {@link ChannelInterceptor} that validates that a valid CSRF is included in the header
+ * of any {@link SimpMessageType#CONNECT} message. The expected {@link CsrfToken} is
+ * populated by CsrfTokenHandshakeInterceptor.
*
* @author Rob Winch
* @since 4.0
*/
-public final class CsrfChannelInterceptor extends ChannelInterceptorAdapter {
+public final class CsrfChannelInterceptor implements ChannelInterceptor {
private final MessageMatcher