return client;
}
// Get the Client and check the id and secret
private Client getAndValidateClient(String clientId, String clientSecret) {
Client client = getClient(clientId);
if (canSupportPublicClients
&& !client.isConfidential()
&& client.getClientSecret() == null
&& clientSecret == null) {
return client;
}
if (clientSecret == null || client.getClientSecret() == null
|| !client.getClientId().equals(clientId)
|| !client.getClientSecret().equals(clientSecret)) {
throw ExceptionUtils.toNotAuthorizedException(null, null);
}
return client;
}