diff --git a/src/main/java/com/eactive/eai/authoutbound/client/impl/HttpClientAccessTokenServiceWithBase64NiceOn.java b/src/main/java/com/eactive/eai/authoutbound/client/impl/HttpClientAccessTokenServiceWithBase64NiceOn.java index 51d0382..d960c82 100644 --- a/src/main/java/com/eactive/eai/authoutbound/client/impl/HttpClientAccessTokenServiceWithBase64NiceOn.java +++ b/src/main/java/com/eactive/eai/authoutbound/client/impl/HttpClientAccessTokenServiceWithBase64NiceOn.java @@ -120,6 +120,9 @@ public class HttpClientAccessTokenServiceWithBase64NiceOn implements HttpClientA formParams.add(new BasicNameValuePair("scope", oAuthCredentialVo.getScope())); formParams.add(new BasicNameValuePair("grant_type", oAuthCredentialVo.getGrantType())); + String postParameters = "client_id=" + oAuthCredentialVo.getClientId() + "&client_secret=" + oAuthCredentialVo.getClientSecret() + "&scope=" + oAuthCredentialVo.getScope() + "&grant_type=" + oAuthCredentialVo.getGrantType(); + + // mTLS config with default connection parameters boolean useMtls = StringUtils.equalsIgnoreCase(adapterProp.getProperty(HttpClientAdapterServiceKey.USE_MTLS), "Y"); @@ -195,7 +198,8 @@ public class HttpClientAccessTokenServiceWithBase64NiceOn implements HttpClientA try (CloseableHttpClient httpClient = HttpClients.custom().setConnectionManager(connectionManager).build();) { HttpPost httpPost = new HttpPost(uri); - httpPost.setEntity(new UrlEncodedFormEntity(formParams, charset)); + //httpPost.setEntity(new UrlEncodedFormEntity(formParams, charset)); + httpPost.setEntity(new StringEntity(postParameters, StandardCharsets.UTF_8)); httpPost.setHeader("Content-Type", contentType+" charset=" + encode); //HTTP HEADER에 client id, client secret를 base64Encode 한 후 추가