diff --git a/oauth2/oauth2-client/src/main/java/org/springframework/security/oauth2/client/endpoint/AbstractWebClientReactiveOAuth2AccessTokenResponseClient.java b/oauth2/oauth2-client/src/main/java/org/springframework/security/oauth2/client/endpoint/AbstractWebClientReactiveOAuth2AccessTokenResponseClient.java index fff6222bb6f..0b2403e8975 100644 --- a/oauth2/oauth2-client/src/main/java/org/springframework/security/oauth2/client/endpoint/AbstractWebClientReactiveOAuth2AccessTokenResponseClient.java +++ b/oauth2/oauth2-client/src/main/java/org/springframework/security/oauth2/client/endpoint/AbstractWebClientReactiveOAuth2AccessTokenResponseClient.java @@ -115,7 +115,8 @@ private void validateClientAuthenticationMethod(T grantRequest) { if (!supportedClientAuthenticationMethod) { throw new IllegalArgumentException(String.format( "This class supports `client_secret_basic`, `client_secret_post`, and `none` by default. Client [%s] is using [%s] instead. Please use a supported client authentication method, or use `set/addParametersConverter` or `set/addHeadersConverter` to supply an instance that supports [%s].", - clientRegistration.getRegistrationId(), clientAuthenticationMethod, clientAuthenticationMethod)); + clientRegistration.getRegistrationId(), clientAuthenticationMethod.getValue(), + clientAuthenticationMethod.getValue())); } } diff --git a/oauth2/oauth2-client/src/main/java/org/springframework/security/oauth2/client/endpoint/ClientAuthenticationMethodValidatingRequestEntityConverter.java b/oauth2/oauth2-client/src/main/java/org/springframework/security/oauth2/client/endpoint/ClientAuthenticationMethodValidatingRequestEntityConverter.java index 1c6068b08bb..0c2537d896e 100644 --- a/oauth2/oauth2-client/src/main/java/org/springframework/security/oauth2/client/endpoint/ClientAuthenticationMethodValidatingRequestEntityConverter.java +++ b/oauth2/oauth2-client/src/main/java/org/springframework/security/oauth2/client/endpoint/ClientAuthenticationMethodValidatingRequestEntityConverter.java @@ -41,7 +41,7 @@ public RequestEntity convert(T grantRequest) { || clientAuthenticationMethod.equals(ClientAuthenticationMethod.CLIENT_SECRET_POST); Assert.isTrue(supportedClientAuthenticationMethod, () -> String.format( "This class supports `client_secret_basic`, `client_secret_post`, and `none` by default. Client [%s] is using [%s] instead. Please use a supported client authentication method, or use `setRequestEntityConverter` to supply an instance that supports [%s].", - registrationId, clientAuthenticationMethod, clientAuthenticationMethod)); + registrationId, clientAuthenticationMethod.getValue(), clientAuthenticationMethod.getValue())); return this.delegate.convert(grantRequest); }