@Override
  public void setClientCredentials(
      KeycloakDeployment deployment,
      Map<String, String> requestHeaders,
      Map<String, String> formParams) {
    String clientId = deployment.getResourceName();

    if (!deployment.isPublicClient()) {
      if (clientSecret != null) {
        String authorization = BasicAuthHelper.createHeader(clientId, clientSecret);
        requestHeaders.put("Authorization", authorization);
      } else {
        logger.warnf("Client '%s' doesn't have secret available", clientId);
      }
    } else {
      formParams.put(OAuth2Constants.CLIENT_ID, clientId);
    }
  }
示例#2
0
 @Override
 public boolean isPublicClient() {
   return delegate.isPublicClient();
 }