Add ClientAuthenticationMethod#toString

Closes gh-13497
This commit is contained in:
Josh Cummings 2023-07-12 14:24:26 -06:00
parent 80a0ade3e3
commit a77ef9ecf4
No known key found for this signature in database
GPG Key ID: A306A51F43B8E5A5
3 changed files with 7 additions and 3 deletions

View File

@ -115,8 +115,7 @@ public abstract class AbstractWebClientReactiveOAuth2AccessTokenResponseClient<T
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.getValue(),
clientAuthenticationMethod.getValue()));
clientRegistration.getRegistrationId(), clientAuthenticationMethod, clientAuthenticationMethod));
}
}

View File

@ -41,7 +41,7 @@ class ClientAuthenticationMethodValidatingRequestEntityConverter<T extends Abstr
|| 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.getValue(), clientAuthenticationMethod.getValue()));
registrationId, clientAuthenticationMethod, clientAuthenticationMethod));
return this.delegate.convert(grantRequest);
}

View File

@ -98,4 +98,9 @@ public final class ClientAuthenticationMethod implements Serializable {
return getValue().hashCode();
}
@Override
public String toString() {
return this.value;
}
}