NICEON Token 획득 수정
This commit is contained in:
+5
-1
@@ -120,6 +120,9 @@ public class HttpClientAccessTokenServiceWithBase64NiceOn implements HttpClientA
|
|||||||
formParams.add(new BasicNameValuePair("scope", oAuthCredentialVo.getScope()));
|
formParams.add(new BasicNameValuePair("scope", oAuthCredentialVo.getScope()));
|
||||||
formParams.add(new BasicNameValuePair("grant_type", oAuthCredentialVo.getGrantType()));
|
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
|
// mTLS config with default connection parameters
|
||||||
boolean useMtls = StringUtils.equalsIgnoreCase(adapterProp.getProperty(HttpClientAdapterServiceKey.USE_MTLS),
|
boolean useMtls = StringUtils.equalsIgnoreCase(adapterProp.getProperty(HttpClientAdapterServiceKey.USE_MTLS),
|
||||||
"Y");
|
"Y");
|
||||||
@@ -195,7 +198,8 @@ public class HttpClientAccessTokenServiceWithBase64NiceOn implements HttpClientA
|
|||||||
|
|
||||||
try (CloseableHttpClient httpClient = HttpClients.custom().setConnectionManager(connectionManager).build();) {
|
try (CloseableHttpClient httpClient = HttpClients.custom().setConnectionManager(connectionManager).build();) {
|
||||||
HttpPost httpPost = new HttpPost(uri);
|
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);
|
httpPost.setHeader("Content-Type", contentType+" charset=" + encode);
|
||||||
|
|
||||||
//HTTP HEADER에 client id, client secret를 base64Encode 한 후 추가
|
//HTTP HEADER에 client id, client secret를 base64Encode 한 후 추가
|
||||||
|
|||||||
Reference in New Issue
Block a user