'Oauth Client id and Secret without Basic Authorization

I have a situation where I can find out the Client_id and Client_secret from the Principle/ Basic Auth coming inside the request with the below snippet.

if(authorization!=null && !authorization.isEmpty()) {
  String base64Credentials = authorization.substring("Basic".length()).trim();
  byte[] credDecoded = Base64.getDecoder().decode(base64Credentials);
  String credentials = new String(credDecoded, StandardCharsets.UTF_8);
  String[] values = credentials.split(":", 2);
  client_id=values[0];client_secret=values[1];
}

Can I provide the client_id and client_secret other than the basic auth format?

I saw we have password encoder to set as plain password encoder or bcrypt encoder to verify if the provided one and the one stored in DB are a match. But i don't see a method/ attribute so that I can control the input from a request.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source