Update to Spring Authorization Server 1.0.0-M1
This commit is contained in:
parent
f27c00cbfa
commit
e6c04b8f0e
|
@ -1,5 +1,5 @@
|
||||||
plugins {
|
plugins {
|
||||||
id 'org.springframework.boot' version '2.7.2'
|
id 'org.springframework.boot' version '3.0.0-SNAPSHOT'
|
||||||
id 'io.spring.dependency-management' version '1.0.11.RELEASE'
|
id 'io.spring.dependency-management' version '1.0.11.RELEASE'
|
||||||
id "nebula.integtest" version "8.2.0"
|
id "nebula.integtest" version "8.2.0"
|
||||||
id 'java'
|
id 'java'
|
||||||
|
@ -13,7 +13,7 @@ repositories {
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation 'org.springframework.boot:spring-boot-starter-web'
|
implementation 'org.springframework.boot:spring-boot-starter-web'
|
||||||
implementation 'org.springframework.security:spring-security-oauth2-authorization-server:0.3.1'
|
implementation 'org.springframework.security:spring-security-oauth2-authorization-server:1.0.0-M1'
|
||||||
|
|
||||||
testImplementation 'org.springframework.boot:spring-boot-starter-test'
|
testImplementation 'org.springframework.boot:spring-boot-starter-test'
|
||||||
testImplementation 'org.springframework.security:spring-security-test'
|
testImplementation 'org.springframework.security:spring-security-test'
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
version=5.7.0-SNAPSHOT
|
version=6.0.0-SNAPSHOT
|
||||||
spring-security.version=5.7.0-SNAPSHOT
|
spring-security.version=6.0.0-SNAPSHOT
|
||||||
|
|
|
@ -75,6 +75,7 @@ public class OAuth2AuthorizationServerApplicationITests {
|
||||||
// @formatter:off
|
// @formatter:off
|
||||||
this.mockMvc.perform(post("/oauth2/token")
|
this.mockMvc.perform(post("/oauth2/token")
|
||||||
.param("grant_type", "client_credentials")
|
.param("grant_type", "client_credentials")
|
||||||
|
.param("scope", "message:read message:write")
|
||||||
.with(basicAuth(CLIENT_ID, CLIENT_SECRET)))
|
.with(basicAuth(CLIENT_ID, CLIENT_SECRET)))
|
||||||
.andExpect(status().isOk())
|
.andExpect(status().isOk())
|
||||||
.andExpect(jsonPath("$.access_token").isString())
|
.andExpect(jsonPath("$.access_token").isString())
|
||||||
|
|
|
@ -35,7 +35,7 @@ import org.springframework.context.annotation.Role;
|
||||||
import org.springframework.core.annotation.Order;
|
import org.springframework.core.annotation.Order;
|
||||||
import org.springframework.security.config.Customizer;
|
import org.springframework.security.config.Customizer;
|
||||||
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
|
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
|
||||||
import org.springframework.security.config.annotation.web.configuration.OAuth2AuthorizationServerConfiguration;
|
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
|
||||||
import org.springframework.security.core.userdetails.User;
|
import org.springframework.security.core.userdetails.User;
|
||||||
import org.springframework.security.core.userdetails.UserDetails;
|
import org.springframework.security.core.userdetails.UserDetails;
|
||||||
import org.springframework.security.core.userdetails.UserDetailsService;
|
import org.springframework.security.core.userdetails.UserDetailsService;
|
||||||
|
@ -47,8 +47,9 @@ import org.springframework.security.oauth2.jwt.NimbusJwtDecoder;
|
||||||
import org.springframework.security.oauth2.server.authorization.client.InMemoryRegisteredClientRepository;
|
import org.springframework.security.oauth2.server.authorization.client.InMemoryRegisteredClientRepository;
|
||||||
import org.springframework.security.oauth2.server.authorization.client.RegisteredClient;
|
import org.springframework.security.oauth2.server.authorization.client.RegisteredClient;
|
||||||
import org.springframework.security.oauth2.server.authorization.client.RegisteredClientRepository;
|
import org.springframework.security.oauth2.server.authorization.client.RegisteredClientRepository;
|
||||||
import org.springframework.security.oauth2.server.authorization.config.ClientSettings;
|
import org.springframework.security.oauth2.server.authorization.config.annotation.web.configuration.OAuth2AuthorizationServerConfiguration;
|
||||||
import org.springframework.security.oauth2.server.authorization.config.ProviderSettings;
|
import org.springframework.security.oauth2.server.authorization.settings.ClientSettings;
|
||||||
|
import org.springframework.security.oauth2.server.authorization.settings.ProviderSettings;
|
||||||
import org.springframework.security.provisioning.InMemoryUserDetailsManager;
|
import org.springframework.security.provisioning.InMemoryUserDetailsManager;
|
||||||
import org.springframework.security.web.SecurityFilterChain;
|
import org.springframework.security.web.SecurityFilterChain;
|
||||||
|
|
||||||
|
@ -58,6 +59,7 @@ import org.springframework.security.web.SecurityFilterChain;
|
||||||
* @author Steve Riesenberg
|
* @author Steve Riesenberg
|
||||||
*/
|
*/
|
||||||
@Configuration
|
@Configuration
|
||||||
|
@EnableWebSecurity
|
||||||
public class OAuth2AuthorizationServerSecurityConfiguration {
|
public class OAuth2AuthorizationServerSecurityConfiguration {
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
|
|
Loading…
Reference in New Issue