Create spring-boot-security-oauth2-authorization-server
This commit is contained in:
committed by
Phillip Webb
parent
0c0af48fea
commit
4d8b558b9b
@@ -101,6 +101,7 @@ include "spring-boot-project:spring-boot-r2dbc"
|
||||
include "spring-boot-project:spring-boot-reactor-netty"
|
||||
include "spring-boot-project:spring-boot-rsocket"
|
||||
include "spring-boot-project:spring-boot-security"
|
||||
include "spring-boot-project:spring-boot-security-oauth2-authorization-server"
|
||||
include "spring-boot-project:spring-boot-security-oauth2-client"
|
||||
include "spring-boot-project:spring-boot-security-oauth2-resource-server"
|
||||
include "spring-boot-project:spring-boot-sendgrid"
|
||||
|
||||
@@ -18,8 +18,6 @@ org.springframework.boot.autoconfigure.http.client.reactive.service.ReactiveHttp
|
||||
org.springframework.boot.autoconfigure.http.codec.CodecsAutoConfiguration
|
||||
org.springframework.boot.autoconfigure.netty.NettyAutoConfiguration
|
||||
org.springframework.boot.autoconfigure.reactor.ReactorAutoConfiguration
|
||||
org.springframework.boot.autoconfigure.security.oauth2.server.servlet.OAuth2AuthorizationServerAutoConfiguration
|
||||
org.springframework.boot.autoconfigure.security.oauth2.server.servlet.OAuth2AuthorizationServerJwtAutoConfiguration
|
||||
org.springframework.boot.autoconfigure.session.SessionAutoConfiguration
|
||||
org.springframework.boot.autoconfigure.web.client.RestClientAutoConfiguration
|
||||
org.springframework.boot.autoconfigure.web.client.RestTemplateAutoConfiguration
|
||||
|
||||
@@ -2038,6 +2038,7 @@ bom {
|
||||
"spring-boot-reactor-netty",
|
||||
"spring-boot-rsocket",
|
||||
"spring-boot-security",
|
||||
"spring-boot-security-oauth2-authorization-server",
|
||||
"spring-boot-security-oauth2-client",
|
||||
"spring-boot-security-oauth2-resource-server",
|
||||
"spring-boot-sendgrid",
|
||||
|
||||
@@ -112,6 +112,7 @@ dependencies {
|
||||
autoConfiguration(project(path: ":spring-boot-project:spring-boot-reactor-netty", configuration: "autoConfigurationMetadata"))
|
||||
autoConfiguration(project(path: ":spring-boot-project:spring-boot-rsocket", configuration: "autoConfigurationMetadata"))
|
||||
autoConfiguration(project(path: ":spring-boot-project:spring-boot-security", configuration: "autoConfigurationMetadata"))
|
||||
autoConfiguration(project(path: ":spring-boot-project:spring-boot-security-oauth2-authorization-server", configuration: "autoConfigurationMetadata"))
|
||||
autoConfiguration(project(path: ":spring-boot-project:spring-boot-security-oauth2-client", configuration: "autoConfigurationMetadata"))
|
||||
autoConfiguration(project(path: ":spring-boot-project:spring-boot-security-oauth2-resource-server", configuration: "autoConfigurationMetadata"))
|
||||
autoConfiguration(project(path: ":spring-boot-project:spring-boot-sendgrid", configuration: "autoConfigurationMetadata"))
|
||||
@@ -178,6 +179,7 @@ dependencies {
|
||||
configurationProperties(project(path: ":spring-boot-project:spring-boot-reactor-netty", configuration: "configurationPropertiesMetadata"))
|
||||
configurationProperties(project(path: ":spring-boot-project:spring-boot-rsocket", configuration: "configurationPropertiesMetadata"))
|
||||
configurationProperties(project(path: ":spring-boot-project:spring-boot-security", configuration: "configurationPropertiesMetadata"))
|
||||
configurationProperties(project(path: ":spring-boot-project:spring-boot-security-oauth2-authorization-server", configuration: "configurationPropertiesMetadata"))
|
||||
configurationProperties(project(path: ":spring-boot-project:spring-boot-security-oauth2-client", configuration: "configurationPropertiesMetadata"))
|
||||
configurationProperties(project(path: ":spring-boot-project:spring-boot-security-oauth2-resource-server", configuration: "configurationPropertiesMetadata"))
|
||||
configurationProperties(project(path: ":spring-boot-project:spring-boot-sendgrid", configuration: "configurationPropertiesMetadata"))
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
plugins {
|
||||
id "java-library"
|
||||
id "org.springframework.boot.auto-configuration"
|
||||
id "org.springframework.boot.configuration-properties"
|
||||
id "org.springframework.boot.deployed"
|
||||
id "org.springframework.boot.optional-dependencies"
|
||||
}
|
||||
|
||||
description = "Spring Boot Security OAuth2 Authorization Server"
|
||||
|
||||
dependencies {
|
||||
api(project(":spring-boot-project:spring-boot"))
|
||||
api("org.springframework.security:spring-security-oauth2-authorization-server")
|
||||
|
||||
implementation(project(":spring-boot-project:spring-boot-security"))
|
||||
|
||||
optional(project(":spring-boot-project:spring-boot-autoconfigure"))
|
||||
optional(project(":spring-boot-project:spring-boot-security-oauth2-resource-server"))
|
||||
|
||||
testImplementation(project(":spring-boot-project:spring-boot-test"))
|
||||
testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support"))
|
||||
testImplementation("jakarta.servlet:jakarta.servlet-api")
|
||||
|
||||
testRuntimeOnly("ch.qos.logback:logback-classic")
|
||||
}
|
||||
@@ -14,12 +14,13 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.autoconfigure.security.oauth2.server.servlet;
|
||||
package org.springframework.boot.security.oauth2.server.authorization.autoconfigure.servlet;
|
||||
|
||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
|
||||
import org.springframework.boot.security.autoconfigure.servlet.SecurityAutoConfiguration;
|
||||
import org.springframework.boot.security.autoconfigure.servlet.UserDetailsServiceAutoConfiguration;
|
||||
import org.springframework.context.annotation.Import;
|
||||
import org.springframework.security.oauth2.server.authorization.OAuth2Authorization;
|
||||
@@ -37,11 +38,11 @@ import org.springframework.security.oauth2.server.authorization.OAuth2Authorizat
|
||||
* if necessary.
|
||||
*
|
||||
* @author Steve Riesenberg
|
||||
* @since 3.1.0
|
||||
* @since 4.0.0
|
||||
* @see OAuth2AuthorizationServerJwtAutoConfiguration
|
||||
*/
|
||||
@AutoConfiguration(beforeName = { "org.springframework.boot.security.autoconfigure.servlet.SecurityAutoConfiguration",
|
||||
"org.springframework.boot.autoconfigure.security.oauth2.resource.servlet.OAuth2ResourceServerAutoConfiguration" })
|
||||
@AutoConfiguration(before = SecurityAutoConfiguration.class,
|
||||
beforeName = "org.springframework.boot.security.oauth2.server.resource.autoconfigure.servlet.OAuth2ResourceServerAutoConfiguration")
|
||||
@ConditionalOnClass(OAuth2Authorization.class)
|
||||
@ConditionalOnWebApplication(type = ConditionalOnWebApplication.Type.SERVLET)
|
||||
@Import({ OAuth2AuthorizationServerConfiguration.class, OAuth2AuthorizationServerWebSecurityConfiguration.class })
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2023 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.autoconfigure.security.oauth2.server.servlet;
|
||||
package org.springframework.boot.security.oauth2.server.authorization.autoconfigure.servlet;
|
||||
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.autoconfigure.security.oauth2.server.servlet;
|
||||
package org.springframework.boot.security.oauth2.server.authorization.autoconfigure.servlet;
|
||||
|
||||
import java.security.KeyPair;
|
||||
import java.security.KeyPairGenerator;
|
||||
@@ -34,6 +34,7 @@ import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
|
||||
import org.springframework.boot.security.autoconfigure.servlet.UserDetailsServiceAutoConfiguration;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.Role;
|
||||
@@ -46,10 +47,9 @@ import org.springframework.security.oauth2.server.authorization.config.annotatio
|
||||
* OAuth2 authorization server that require it (e.g. User Info, Client Registration).
|
||||
*
|
||||
* @author Steve Riesenberg
|
||||
* @since 3.1.0
|
||||
* @since 4.0.0
|
||||
*/
|
||||
@AutoConfiguration(
|
||||
afterName = "org.springframework.boot.security.autoconfigure.servlet.UserDetailsServiceAutoConfiguration")
|
||||
@AutoConfiguration(after = UserDetailsServiceAutoConfiguration.class)
|
||||
@ConditionalOnClass({ OAuth2Authorization.class, JWKSource.class })
|
||||
@ConditionalOnWebApplication(type = ConditionalOnWebApplication.Type.SERVLET)
|
||||
public class OAuth2AuthorizationServerJwtAutoConfiguration {
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.autoconfigure.security.oauth2.server.servlet;
|
||||
package org.springframework.boot.security.oauth2.server.authorization.autoconfigure.servlet;
|
||||
|
||||
import java.time.Duration;
|
||||
import java.util.HashMap;
|
||||
@@ -32,7 +32,7 @@ import org.springframework.util.StringUtils;
|
||||
* OAuth 2.0 Authorization Server properties.
|
||||
*
|
||||
* @author Steve Riesenberg
|
||||
* @since 3.1.0
|
||||
* @since 4.0.0
|
||||
*/
|
||||
@ConfigurationProperties("spring.security.oauth2.authorizationserver")
|
||||
public class OAuth2AuthorizationServerProperties implements InitializingBean {
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2024 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@@ -14,15 +14,15 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.autoconfigure.security.oauth2.server.servlet;
|
||||
package org.springframework.boot.security.oauth2.server.authorization.autoconfigure.servlet;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
import org.springframework.boot.autoconfigure.security.oauth2.server.servlet.OAuth2AuthorizationServerProperties.Client;
|
||||
import org.springframework.boot.autoconfigure.security.oauth2.server.servlet.OAuth2AuthorizationServerProperties.Registration;
|
||||
import org.springframework.boot.context.properties.PropertyMapper;
|
||||
import org.springframework.boot.security.oauth2.server.authorization.autoconfigure.servlet.OAuth2AuthorizationServerProperties.Client;
|
||||
import org.springframework.boot.security.oauth2.server.authorization.autoconfigure.servlet.OAuth2AuthorizationServerProperties.Registration;
|
||||
import org.springframework.security.oauth2.core.AuthorizationGrantType;
|
||||
import org.springframework.security.oauth2.core.ClientAuthenticationMethod;
|
||||
import org.springframework.security.oauth2.jose.jws.JwsAlgorithm;
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.autoconfigure.security.oauth2.server.servlet;
|
||||
package org.springframework.boot.security.oauth2.server.authorization.autoconfigure.servlet;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2023 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.autoconfigure.security.oauth2.server.servlet;
|
||||
package org.springframework.boot.security.oauth2.server.authorization.autoconfigure.servlet;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.Map;
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2023 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@@ -17,4 +17,4 @@
|
||||
/**
|
||||
* Auto-configuration for Spring Security's OAuth2 authorization server.
|
||||
*/
|
||||
package org.springframework.boot.autoconfigure.security.oauth2.server.servlet;
|
||||
package org.springframework.boot.security.oauth2.server.authorization.autoconfigure.servlet;
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"groups": [],
|
||||
"properties": []
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
org.springframework.boot.security.oauth2.server.authorization.autoconfigure.servlet.OAuth2AuthorizationServerAutoConfiguration
|
||||
org.springframework.boot.security.oauth2.server.authorization.autoconfigure.servlet.OAuth2AuthorizationServerJwtAutoConfiguration
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.autoconfigure.security.oauth2.server.servlet;
|
||||
package org.springframework.boot.security.oauth2.server.authorization.autoconfigure.servlet;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.autoconfigure.security.oauth2.server.servlet;
|
||||
package org.springframework.boot.security.oauth2.server.authorization.autoconfigure.servlet;
|
||||
|
||||
import com.nimbusds.jose.jwk.source.ImmutableJWKSet;
|
||||
import com.nimbusds.jose.jwk.source.JWKSource;
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2024 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.autoconfigure.security.oauth2.server.servlet;
|
||||
package org.springframework.boot.security.oauth2.server.authorization.autoconfigure.servlet;
|
||||
|
||||
import java.time.Duration;
|
||||
import java.util.List;
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2023 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.autoconfigure.security.oauth2.server.servlet;
|
||||
package org.springframework.boot.security.oauth2.server.authorization.autoconfigure.servlet;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.autoconfigure.security.oauth2.server.servlet;
|
||||
package org.springframework.boot.security.oauth2.server.authorization.autoconfigure.servlet;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -7,5 +7,5 @@ description = "Starter for using Spring Authorization Server features"
|
||||
dependencies {
|
||||
api(project(":spring-boot-project:spring-boot-starters:spring-boot-starter-security"))
|
||||
api(project(":spring-boot-project:spring-boot-starters:spring-boot-starter-web"))
|
||||
api("org.springframework.security:spring-security-oauth2-authorization-server")
|
||||
api(project(":spring-boot-project:spring-boot-security-oauth2-authorization-server"))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user