Skip to content

Commit e0fd45e

Browse files
committed
Create spring-boot-security-oauth2-authorization-server
1 parent 0b612c5 commit e0fd45e

21 files changed

+66
-32
lines changed

settings.gradle

+1
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ include "spring-boot-project:spring-boot-r2dbc"
101101
include "spring-boot-project:spring-boot-reactor-netty"
102102
include "spring-boot-project:spring-boot-rsocket"
103103
include "spring-boot-project:spring-boot-security"
104+
include "spring-boot-project:spring-boot-security-oauth2-authorization-server"
104105
include "spring-boot-project:spring-boot-security-oauth2-client"
105106
include "spring-boot-project:spring-boot-security-oauth2-resource-server"
106107
include "spring-boot-project:spring-boot-sendgrid"

spring-boot-project/spring-boot-autoconfigure-all/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports

-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ org.springframework.boot.autoconfigure.http.client.HttpClientAutoConfiguration
1515
org.springframework.boot.autoconfigure.http.codec.CodecsAutoConfiguration
1616
org.springframework.boot.autoconfigure.netty.NettyAutoConfiguration
1717
org.springframework.boot.autoconfigure.reactor.ReactorAutoConfiguration
18-
org.springframework.boot.autoconfigure.security.oauth2.server.servlet.OAuth2AuthorizationServerAutoConfiguration
19-
org.springframework.boot.autoconfigure.security.oauth2.server.servlet.OAuth2AuthorizationServerJwtAutoConfiguration
2018
org.springframework.boot.autoconfigure.session.SessionAutoConfiguration
2119
org.springframework.boot.autoconfigure.web.client.RestClientAutoConfiguration
2220
org.springframework.boot.autoconfigure.web.client.RestTemplateAutoConfiguration

spring-boot-project/spring-boot-dependencies/build.gradle

+1
Original file line numberDiff line numberDiff line change
@@ -2048,6 +2048,7 @@ bom {
20482048
"spring-boot-reactor-netty",
20492049
"spring-boot-rsocket",
20502050
"spring-boot-security",
2051+
"spring-boot-security-oauth2-authorization-server",
20512052
"spring-boot-security-oauth2-client",
20522053
"spring-boot-security-oauth2-resource-server",
20532054
"spring-boot-sendgrid",

spring-boot-project/spring-boot-docs/build.gradle

+2
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ dependencies {
106106
autoConfiguration(project(path: ":spring-boot-project:spring-boot-reactor-netty", configuration: "autoConfigurationMetadata"))
107107
autoConfiguration(project(path: ":spring-boot-project:spring-boot-rsocket", configuration: "autoConfigurationMetadata"))
108108
autoConfiguration(project(path: ":spring-boot-project:spring-boot-security", configuration: "autoConfigurationMetadata"))
109+
autoConfiguration(project(path: ":spring-boot-project:spring-boot-security-oauth2-authorization-server", configuration: "autoConfigurationMetadata"))
109110
autoConfiguration(project(path: ":spring-boot-project:spring-boot-security-oauth2-client", configuration: "autoConfigurationMetadata"))
110111
autoConfiguration(project(path: ":spring-boot-project:spring-boot-security-oauth2-resource-server", configuration: "autoConfigurationMetadata"))
111112
autoConfiguration(project(path: ":spring-boot-project:spring-boot-sendgrid", configuration: "autoConfigurationMetadata"))
@@ -172,6 +173,7 @@ dependencies {
172173
configurationProperties(project(path: ":spring-boot-project:spring-boot-reactor-netty", configuration: "configurationPropertiesMetadata"))
173174
configurationProperties(project(path: ":spring-boot-project:spring-boot-rsocket", configuration: "configurationPropertiesMetadata"))
174175
configurationProperties(project(path: ":spring-boot-project:spring-boot-security", configuration: "configurationPropertiesMetadata"))
176+
configurationProperties(project(path: ":spring-boot-project:spring-boot-security-oauth2-authorization-server", configuration: "configurationPropertiesMetadata"))
175177
configurationProperties(project(path: ":spring-boot-project:spring-boot-security-oauth2-client", configuration: "configurationPropertiesMetadata"))
176178
configurationProperties(project(path: ":spring-boot-project:spring-boot-security-oauth2-resource-server", configuration: "configurationPropertiesMetadata"))
177179
configurationProperties(project(path: ":spring-boot-project:spring-boot-sendgrid", configuration: "configurationPropertiesMetadata"))
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
plugins {
2+
id "java-library"
3+
id "org.springframework.boot.auto-configuration"
4+
id "org.springframework.boot.configuration-properties"
5+
id "org.springframework.boot.deployed"
6+
id "org.springframework.boot.optional-dependencies"
7+
}
8+
9+
description = "Spring Boot Security OAuth2 Authorization Server"
10+
11+
dependencies {
12+
api(project(":spring-boot-project:spring-boot"))
13+
api("org.springframework.security:spring-security-oauth2-authorization-server")
14+
15+
implementation(project(":spring-boot-project:spring-boot-security"))
16+
17+
optional(project(":spring-boot-project:spring-boot-autoconfigure"))
18+
optional(project(":spring-boot-project:spring-boot-security-oauth2-resource-server"))
19+
20+
testImplementation(project(":spring-boot-project:spring-boot-test"))
21+
testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support"))
22+
testImplementation("jakarta.servlet:jakarta.servlet-api")
23+
24+
testRuntimeOnly("ch.qos.logback:logback-classic")
25+
}
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,13 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.boot.autoconfigure.security.oauth2.server.servlet;
17+
package org.springframework.boot.security.oauth2.server.authorization.autoconfigure.servlet;
1818

1919
import org.springframework.boot.autoconfigure.AutoConfiguration;
2020
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
2121
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
2222
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
23+
import org.springframework.boot.security.autoconfigure.servlet.SecurityAutoConfiguration;
2324
import org.springframework.boot.security.autoconfigure.servlet.UserDetailsServiceAutoConfiguration;
2425
import org.springframework.context.annotation.Import;
2526
import org.springframework.security.oauth2.server.authorization.OAuth2Authorization;
@@ -37,11 +38,11 @@
3738
* if necessary.
3839
*
3940
* @author Steve Riesenberg
40-
* @since 3.1.0
41+
* @since 4.0.0
4142
* @see OAuth2AuthorizationServerJwtAutoConfiguration
4243
*/
43-
@AutoConfiguration(beforeName = { "org.springframework.boot.security.autoconfigure.servlet.SecurityAutoConfiguration",
44-
"org.springframework.boot.autoconfigure.security.oauth2.resource.servlet.OAuth2ResourceServerAutoConfiguration" })
44+
@AutoConfiguration(before = SecurityAutoConfiguration.class,
45+
beforeName = "org.springframework.boot.security.oauth2.resource.autoconfigure.servlet.OAuth2ResourceServerAutoConfiguration")
4546
@ConditionalOnClass(OAuth2Authorization.class)
4647
@ConditionalOnWebApplication(type = ConditionalOnWebApplication.Type.SERVLET)
4748
@Import({ OAuth2AuthorizationServerConfiguration.class, OAuth2AuthorizationServerWebSecurityConfiguration.class })
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2023 the original author or authors.
2+
* Copyright 2012-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.boot.autoconfigure.security.oauth2.server.servlet;
17+
package org.springframework.boot.security.oauth2.server.authorization.autoconfigure.servlet;
1818

1919
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
2020
import org.springframework.boot.context.properties.EnableConfigurationProperties;
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.boot.autoconfigure.security.oauth2.server.servlet;
17+
package org.springframework.boot.security.oauth2.server.authorization.autoconfigure.servlet;
1818

1919
import java.security.KeyPair;
2020
import java.security.KeyPairGenerator;
@@ -34,6 +34,7 @@
3434
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
3535
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
3636
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
37+
import org.springframework.boot.security.autoconfigure.servlet.UserDetailsServiceAutoConfiguration;
3738
import org.springframework.context.annotation.Bean;
3839
import org.springframework.context.annotation.Role;
3940
import org.springframework.security.oauth2.jwt.JwtDecoder;
@@ -45,10 +46,9 @@
4546
* OAuth2 authorization server that require it (e.g. User Info, Client Registration).
4647
*
4748
* @author Steve Riesenberg
48-
* @since 3.1.0
49+
* @since 4.0.0
4950
*/
50-
@AutoConfiguration(
51-
afterName = "org.springframework.boot.security.autoconfigure.servlet.UserDetailsServiceAutoConfiguration")
51+
@AutoConfiguration(after = UserDetailsServiceAutoConfiguration.class)
5252
@ConditionalOnClass(OAuth2Authorization.class)
5353
@ConditionalOnWebApplication(type = ConditionalOnWebApplication.Type.SERVLET)
5454
public class OAuth2AuthorizationServerJwtAutoConfiguration {
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.boot.autoconfigure.security.oauth2.server.servlet;
17+
package org.springframework.boot.security.oauth2.server.authorization.autoconfigure.servlet;
1818

1919
import java.time.Duration;
2020
import java.util.HashMap;
@@ -32,7 +32,7 @@
3232
* OAuth 2.0 Authorization Server properties.
3333
*
3434
* @author Steve Riesenberg
35-
* @since 3.1.0
35+
* @since 4.0.0
3636
*/
3737
@ConfigurationProperties("spring.security.oauth2.authorizationserver")
3838
public class OAuth2AuthorizationServerProperties implements InitializingBean {
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2024 the original author or authors.
2+
* Copyright 2012-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -14,15 +14,15 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.boot.autoconfigure.security.oauth2.server.servlet;
17+
package org.springframework.boot.security.oauth2.server.authorization.autoconfigure.servlet;
1818

1919
import java.util.ArrayList;
2020
import java.util.List;
2121
import java.util.Locale;
2222

23-
import org.springframework.boot.autoconfigure.security.oauth2.server.servlet.OAuth2AuthorizationServerProperties.Client;
24-
import org.springframework.boot.autoconfigure.security.oauth2.server.servlet.OAuth2AuthorizationServerProperties.Registration;
2523
import org.springframework.boot.context.properties.PropertyMapper;
24+
import org.springframework.boot.security.oauth2.server.authorization.autoconfigure.servlet.OAuth2AuthorizationServerProperties.Client;
25+
import org.springframework.boot.security.oauth2.server.authorization.autoconfigure.servlet.OAuth2AuthorizationServerProperties.Registration;
2626
import org.springframework.security.oauth2.core.AuthorizationGrantType;
2727
import org.springframework.security.oauth2.core.ClientAuthenticationMethod;
2828
import org.springframework.security.oauth2.jose.jws.JwsAlgorithm;
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.boot.autoconfigure.security.oauth2.server.servlet;
17+
package org.springframework.boot.security.oauth2.server.authorization.autoconfigure.servlet;
1818

1919
import java.util.Set;
2020

Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2023 the original author or authors.
2+
* Copyright 2012-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.boot.autoconfigure.security.oauth2.server.servlet;
17+
package org.springframework.boot.security.oauth2.server.authorization.autoconfigure.servlet;
1818

1919
import java.util.Collections;
2020
import java.util.Map;
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2023 the original author or authors.
2+
* Copyright 2012-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -17,4 +17,4 @@
1717
/**
1818
* Auto-configuration for Spring Security's OAuth2 authorization server.
1919
*/
20-
package org.springframework.boot.autoconfigure.security.oauth2.server.servlet;
20+
package org.springframework.boot.security.oauth2.server.authorization.autoconfigure.servlet;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"groups": [],
3+
"properties": []
4+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
org.springframework.boot.security.oauth2.server.authorization.autoconfigure.servlet.OAuth2AuthorizationServerAutoConfiguration
2+
org.springframework.boot.security.oauth2.server.authorization.autoconfigure.servlet.OAuth2AuthorizationServerJwtAutoConfiguration
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.boot.autoconfigure.security.oauth2.server.servlet;
17+
package org.springframework.boot.security.oauth2.server.authorization.autoconfigure.servlet;
1818

1919
import org.junit.jupiter.api.Test;
2020

Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2023 the original author or authors.
2+
* Copyright 2012-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.boot.autoconfigure.security.oauth2.server.servlet;
17+
package org.springframework.boot.security.oauth2.server.authorization.autoconfigure.servlet;
1818

1919
import com.nimbusds.jose.jwk.source.ImmutableJWKSet;
2020
import com.nimbusds.jose.jwk.source.JWKSource;
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2024 the original author or authors.
2+
* Copyright 2012-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.boot.autoconfigure.security.oauth2.server.servlet;
17+
package org.springframework.boot.security.oauth2.server.authorization.autoconfigure.servlet;
1818

1919
import java.time.Duration;
2020
import java.util.List;
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2023 the original author or authors.
2+
* Copyright 2012-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.boot.autoconfigure.security.oauth2.server.servlet;
17+
package org.springframework.boot.security.oauth2.server.authorization.autoconfigure.servlet;
1818

1919
import org.junit.jupiter.api.Test;
2020

Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.boot.autoconfigure.security.oauth2.server.servlet;
17+
package org.springframework.boot.security.oauth2.server.authorization.autoconfigure.servlet;
1818

1919
import java.util.List;
2020

spring-boot-project/spring-boot-starters/spring-boot-starter-oauth2-authorization-server/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ description = "Starter for using Spring Authorization Server features"
77
dependencies {
88
api(project(":spring-boot-project:spring-boot-starters:spring-boot-starter-security"))
99
api(project(":spring-boot-project:spring-boot-starters:spring-boot-starter-web"))
10-
api("org.springframework.security:spring-security-oauth2-authorization-server")
10+
api(project(":spring-boot-project:spring-boot-security-oauth2-authorization-server"))
1111
}

0 commit comments

Comments
 (0)