diff --git a/servlet/spring-boot/java/oauth2/authorization-server/build.gradle b/servlet/spring-boot/java/oauth2/authorization-server/build.gradle index e328993..1698179 100644 --- a/servlet/spring-boot/java/oauth2/authorization-server/build.gradle +++ b/servlet/spring-boot/java/oauth2/authorization-server/build.gradle @@ -12,7 +12,7 @@ repositories { dependencies { implementation 'org.springframework.boot:spring-boot-starter-web' - implementation 'org.springframework.security.experimental:spring-security-oauth2-authorization-server:0.1.2' + implementation 'org.springframework.security:spring-security-oauth2-authorization-server:0.2.0' testImplementation 'org.springframework.boot:spring-boot-starter-test' testImplementation 'org.springframework.security:spring-security-test' diff --git a/servlet/spring-boot/java/oauth2/authorization-server/src/integTest/java/example/OAuth2AuthorizationServerApplicationITests.java b/servlet/spring-boot/java/oauth2/authorization-server/src/integTest/java/example/OAuth2AuthorizationServerApplicationITests.java index eef6e93..431976b 100644 --- a/servlet/spring-boot/java/oauth2/authorization-server/src/integTest/java/example/OAuth2AuthorizationServerApplicationITests.java +++ b/servlet/spring-boot/java/oauth2/authorization-server/src/integTest/java/example/OAuth2AuthorizationServerApplicationITests.java @@ -119,7 +119,6 @@ public class OAuth2AuthorizationServerApplicationITests { .andExpect(jsonPath("$.exp").isNumber()) .andExpect(jsonPath("$.iat").isNumber()) .andExpect(jsonPath("$.iss").value("http://localhost:9000")) - .andExpect(jsonPath("$.jti").isString()) .andExpect(jsonPath("$.nbf").isNumber()) .andExpect(jsonPath("$.scope").value("message:read")) .andExpect(jsonPath("$.sub").value(CLIENT_ID)) diff --git a/servlet/spring-boot/java/oauth2/authorization-server/src/main/java/example/OAuth2AuthorizationServerSecurityConfiguration.java b/servlet/spring-boot/java/oauth2/authorization-server/src/main/java/example/OAuth2AuthorizationServerSecurityConfiguration.java index 7959bd2..e965972 100644 --- a/servlet/spring-boot/java/oauth2/authorization-server/src/main/java/example/OAuth2AuthorizationServerSecurityConfiguration.java +++ b/servlet/spring-boot/java/oauth2/authorization-server/src/main/java/example/OAuth2AuthorizationServerSecurityConfiguration.java @@ -43,6 +43,7 @@ import org.springframework.security.oauth2.jwt.NimbusJwtDecoder; 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.RegisteredClientRepository; +import org.springframework.security.oauth2.server.authorization.config.ClientSettings; import org.springframework.security.oauth2.server.authorization.config.ProviderSettings; import org.springframework.security.web.SecurityFilterChain; @@ -75,11 +76,11 @@ public class OAuth2AuthorizationServerSecurityConfiguration { RegisteredClient registeredClient = RegisteredClient.withId(UUID.randomUUID().toString()) .clientId("messaging-client") .clientSecret("{noop}secret") - .clientAuthenticationMethod(ClientAuthenticationMethod.BASIC) + .clientAuthenticationMethod(ClientAuthenticationMethod.CLIENT_SECRET_BASIC) .authorizationGrantType(AuthorizationGrantType.CLIENT_CREDENTIALS) .scope("message:read") .scope("message:write") - .clientSettings((clientSettings) -> clientSettings.requireUserConsent(true)) + .clientSettings(ClientSettings.builder().requireAuthorizationConsent(true).build()) .build(); // @formatter:on @@ -111,7 +112,7 @@ public class OAuth2AuthorizationServerSecurityConfiguration { @Bean public ProviderSettings providerSettings() { - return new ProviderSettings().issuer("http://localhost:9000"); + return ProviderSettings.builder().issuer("http://localhost:9000").build(); } }