NICEON Token 획득 수정

This commit is contained in:
jaewohong
2025-12-17 10:20:38 +09:00
parent 9890f889a4
commit 02b9717890
@@ -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 한 후 추가