Commit 3c0972e7 authored by Andy Wilkinson's avatar Andy Wilkinson

Upgrade to Spring Security 5.5.0-M2

Closes gh-25255
parent dadd6241
/* /*
* Copyright 2012-2020 the original author or authors. * Copyright 2012-2021 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -86,7 +86,7 @@ class OAuth2ClientPropertiesRegistrationAdapterTests { ...@@ -86,7 +86,7 @@ class OAuth2ClientPropertiesRegistrationAdapterTests {
assertThat(adapted.getClientId()).isEqualTo("clientId"); assertThat(adapted.getClientId()).isEqualTo("clientId");
assertThat(adapted.getClientSecret()).isEqualTo("clientSecret"); assertThat(adapted.getClientSecret()).isEqualTo("clientSecret");
assertThat(adapted.getClientAuthenticationMethod()) assertThat(adapted.getClientAuthenticationMethod())
.isEqualTo(org.springframework.security.oauth2.core.ClientAuthenticationMethod.POST); .isEqualTo(org.springframework.security.oauth2.core.ClientAuthenticationMethod.CLIENT_SECRET_POST);
assertThat(adapted.getAuthorizationGrantType()) assertThat(adapted.getAuthorizationGrantType())
.isEqualTo(org.springframework.security.oauth2.core.AuthorizationGrantType.AUTHORIZATION_CODE); .isEqualTo(org.springframework.security.oauth2.core.AuthorizationGrantType.AUTHORIZATION_CODE);
assertThat(adapted.getRedirectUri()).isEqualTo("https://example.com/redirect"); assertThat(adapted.getRedirectUri()).isEqualTo("https://example.com/redirect");
...@@ -116,7 +116,7 @@ class OAuth2ClientPropertiesRegistrationAdapterTests { ...@@ -116,7 +116,7 @@ class OAuth2ClientPropertiesRegistrationAdapterTests {
assertThat(adapted.getClientId()).isEqualTo("clientId"); assertThat(adapted.getClientId()).isEqualTo("clientId");
assertThat(adapted.getClientSecret()).isEqualTo("clientSecret"); assertThat(adapted.getClientSecret()).isEqualTo("clientSecret");
assertThat(adapted.getClientAuthenticationMethod()) assertThat(adapted.getClientAuthenticationMethod())
.isEqualTo(org.springframework.security.oauth2.core.ClientAuthenticationMethod.BASIC); .isEqualTo(org.springframework.security.oauth2.core.ClientAuthenticationMethod.CLIENT_SECRET_BASIC);
assertThat(adapted.getAuthorizationGrantType()) assertThat(adapted.getAuthorizationGrantType())
.isEqualTo(org.springframework.security.oauth2.core.AuthorizationGrantType.AUTHORIZATION_CODE); .isEqualTo(org.springframework.security.oauth2.core.AuthorizationGrantType.AUTHORIZATION_CODE);
assertThat(adapted.getRedirectUri()).isEqualTo("{baseUrl}/{action}/oauth2/code/{registrationId}"); assertThat(adapted.getRedirectUri()).isEqualTo("{baseUrl}/{action}/oauth2/code/{registrationId}");
...@@ -146,7 +146,7 @@ class OAuth2ClientPropertiesRegistrationAdapterTests { ...@@ -146,7 +146,7 @@ class OAuth2ClientPropertiesRegistrationAdapterTests {
assertThat(adapted.getClientId()).isEqualTo("clientId"); assertThat(adapted.getClientId()).isEqualTo("clientId");
assertThat(adapted.getClientSecret()).isEqualTo("clientSecret"); assertThat(adapted.getClientSecret()).isEqualTo("clientSecret");
assertThat(adapted.getClientAuthenticationMethod()) assertThat(adapted.getClientAuthenticationMethod())
.isEqualTo(org.springframework.security.oauth2.core.ClientAuthenticationMethod.POST); .isEqualTo(org.springframework.security.oauth2.core.ClientAuthenticationMethod.CLIENT_SECRET_POST);
assertThat(adapted.getAuthorizationGrantType()) assertThat(adapted.getAuthorizationGrantType())
.isEqualTo(org.springframework.security.oauth2.core.AuthorizationGrantType.AUTHORIZATION_CODE); .isEqualTo(org.springframework.security.oauth2.core.AuthorizationGrantType.AUTHORIZATION_CODE);
assertThat(adapted.getRedirectUri()).isEqualTo("https://example.com/redirect"); assertThat(adapted.getRedirectUri()).isEqualTo("https://example.com/redirect");
...@@ -187,7 +187,7 @@ class OAuth2ClientPropertiesRegistrationAdapterTests { ...@@ -187,7 +187,7 @@ class OAuth2ClientPropertiesRegistrationAdapterTests {
assertThat(adapted.getClientId()).isEqualTo("clientId"); assertThat(adapted.getClientId()).isEqualTo("clientId");
assertThat(adapted.getClientSecret()).isEqualTo("clientSecret"); assertThat(adapted.getClientSecret()).isEqualTo("clientSecret");
assertThat(adapted.getClientAuthenticationMethod()) assertThat(adapted.getClientAuthenticationMethod())
.isEqualTo(org.springframework.security.oauth2.core.ClientAuthenticationMethod.BASIC); .isEqualTo(org.springframework.security.oauth2.core.ClientAuthenticationMethod.CLIENT_SECRET_BASIC);
assertThat(adapted.getAuthorizationGrantType()) assertThat(adapted.getAuthorizationGrantType())
.isEqualTo(org.springframework.security.oauth2.core.AuthorizationGrantType.AUTHORIZATION_CODE); .isEqualTo(org.springframework.security.oauth2.core.AuthorizationGrantType.AUTHORIZATION_CODE);
assertThat(adapted.getRedirectUri()).isEqualTo("{baseUrl}/{action}/oauth2/code/{registrationId}"); assertThat(adapted.getRedirectUri()).isEqualTo("{baseUrl}/{action}/oauth2/code/{registrationId}");
...@@ -254,7 +254,7 @@ class OAuth2ClientPropertiesRegistrationAdapterTests { ...@@ -254,7 +254,7 @@ class OAuth2ClientPropertiesRegistrationAdapterTests {
.getClientRegistrations(properties); .getClientRegistrations(properties);
ClientRegistration adapted = registrations.get("okta"); ClientRegistration adapted = registrations.get("okta");
ProviderDetails providerDetails = adapted.getProviderDetails(); ProviderDetails providerDetails = adapted.getProviderDetails();
assertThat(adapted.getClientAuthenticationMethod()).isEqualTo(ClientAuthenticationMethod.POST); assertThat(adapted.getClientAuthenticationMethod()).isEqualTo(ClientAuthenticationMethod.CLIENT_SECRET_POST);
assertThat(adapted.getAuthorizationGrantType()).isEqualTo(AuthorizationGrantType.AUTHORIZATION_CODE); assertThat(adapted.getAuthorizationGrantType()).isEqualTo(AuthorizationGrantType.AUTHORIZATION_CODE);
assertThat(adapted.getRegistrationId()).isEqualTo("okta"); assertThat(adapted.getRegistrationId()).isEqualTo("okta");
assertThat(adapted.getClientName()).isEqualTo(issuer); assertThat(adapted.getClientName()).isEqualTo(issuer);
...@@ -283,7 +283,7 @@ class OAuth2ClientPropertiesRegistrationAdapterTests { ...@@ -283,7 +283,7 @@ class OAuth2ClientPropertiesRegistrationAdapterTests {
registration.setProvider(provider); registration.setProvider(provider);
registration.setClientId("clientId"); registration.setClientId("clientId");
registration.setClientSecret("clientSecret"); registration.setClientSecret("clientSecret");
registration.setClientAuthenticationMethod("post"); registration.setClientAuthenticationMethod("client_secret_post");
registration.setRedirectUri("https://example.com/redirect"); registration.setRedirectUri("https://example.com/redirect");
registration.setScope(Collections.singleton("user")); registration.setScope(Collections.singleton("user"));
registration.setAuthorizationGrantType("authorization_code"); registration.setAuthorizationGrantType("authorization_code");
...@@ -305,7 +305,7 @@ class OAuth2ClientPropertiesRegistrationAdapterTests { ...@@ -305,7 +305,7 @@ class OAuth2ClientPropertiesRegistrationAdapterTests {
.getClientRegistrations(properties); .getClientRegistrations(properties);
ClientRegistration adapted = registrations.get("okta"); ClientRegistration adapted = registrations.get("okta");
ProviderDetails providerDetails = adapted.getProviderDetails(); ProviderDetails providerDetails = adapted.getProviderDetails();
assertThat(adapted.getClientAuthenticationMethod()).isEqualTo(ClientAuthenticationMethod.BASIC); assertThat(adapted.getClientAuthenticationMethod()).isEqualTo(ClientAuthenticationMethod.CLIENT_SECRET_BASIC);
assertThat(adapted.getAuthorizationGrantType()).isEqualTo(AuthorizationGrantType.AUTHORIZATION_CODE); assertThat(adapted.getAuthorizationGrantType()).isEqualTo(AuthorizationGrantType.AUTHORIZATION_CODE);
assertThat(adapted.getRegistrationId()).isEqualTo("okta"); assertThat(adapted.getRegistrationId()).isEqualTo("okta");
assertThat(adapted.getClientName()).isEqualTo(issuer); assertThat(adapted.getClientName()).isEqualTo(issuer);
......
/* /*
* Copyright 2012-2020 the original author or authors. * Copyright 2012-2021 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -207,7 +207,7 @@ class ReactiveOAuth2ClientAutoConfigurationTests { ...@@ -207,7 +207,7 @@ class ReactiveOAuth2ClientAutoConfigurationTests {
ClientRegistration.Builder builder = ClientRegistration.withRegistrationId(id); ClientRegistration.Builder builder = ClientRegistration.withRegistrationId(id);
builder.clientName("foo").clientId("foo") builder.clientName("foo").clientId("foo")
.clientAuthenticationMethod( .clientAuthenticationMethod(
org.springframework.security.oauth2.core.ClientAuthenticationMethod.BASIC) org.springframework.security.oauth2.core.ClientAuthenticationMethod.CLIENT_SECRET_BASIC)
.authorizationGrantType(AuthorizationGrantType.AUTHORIZATION_CODE).scope("read") .authorizationGrantType(AuthorizationGrantType.AUTHORIZATION_CODE).scope("read")
.clientSecret("secret").redirectUri("https://redirect-uri.com") .clientSecret("secret").redirectUri("https://redirect-uri.com")
.authorizationUri("https://authorization-uri.com").tokenUri("https://token-uri.com") .authorizationUri("https://authorization-uri.com").tokenUri("https://token-uri.com")
......
/* /*
* Copyright 2012-2020 the original author or authors. * Copyright 2012-2021 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -219,7 +219,7 @@ class OAuth2WebSecurityConfigurationTests { ...@@ -219,7 +219,7 @@ class OAuth2WebSecurityConfigurationTests {
ClientRegistration.Builder builder = ClientRegistration.withRegistrationId(id); ClientRegistration.Builder builder = ClientRegistration.withRegistrationId(id);
builder.clientName("foo").clientId("foo") builder.clientName("foo").clientId("foo")
.clientAuthenticationMethod( .clientAuthenticationMethod(
org.springframework.security.oauth2.core.ClientAuthenticationMethod.BASIC) org.springframework.security.oauth2.core.ClientAuthenticationMethod.CLIENT_SECRET_BASIC)
.authorizationGrantType(AuthorizationGrantType.AUTHORIZATION_CODE).scope("read") .authorizationGrantType(AuthorizationGrantType.AUTHORIZATION_CODE).scope("read")
.clientSecret("secret").redirectUri("https://redirect-uri.com") .clientSecret("secret").redirectUri("https://redirect-uri.com")
.authorizationUri("https://authorization-uri.com").tokenUri("https://token-uri.com") .authorizationUri("https://authorization-uri.com").tokenUri("https://token-uri.com")
......
...@@ -1687,7 +1687,7 @@ bom { ...@@ -1687,7 +1687,7 @@ bom {
] ]
} }
} }
library("Spring Security", "5.5.0-M1") { library("Spring Security", "5.5.0-M2") {
group("org.springframework.security") { group("org.springframework.security") {
imports = [ imports = [
"spring-security-bom" "spring-security-bom"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment