|
|
|
@ -1,5 +1,6 @@
|
|
|
|
|
package kr.xit.ens.kt.service;
|
|
|
|
|
|
|
|
|
|
import java.net.URLEncoder;
|
|
|
|
|
import java.util.HashMap;
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
import kr.xit.biz.ens.model.cmm.CmmEnsRlaybsnmDTO;
|
|
|
|
@ -162,18 +163,18 @@ public class KtMmsService extends EgovAbstractServiceImpl implements IKtMmsServi
|
|
|
|
|
public KtTokenResponse requestToken(final KtMnsRequest paramDTO) {
|
|
|
|
|
final CmmEnsRlaybsnmDTO ktMnsInfo = CmmKtMmsUtils.getRlaybsnmInfo(paramDTO.getSignguCode(), paramDTO.getFfnlgCode());
|
|
|
|
|
final KtTokenRequest reqDTO = KtTokenRequest.builder()
|
|
|
|
|
.clientId(ktMnsInfo.getKtClientId())
|
|
|
|
|
//.clientId(ktMnsInfo.getKtSvcClientId())
|
|
|
|
|
.clientSecret(ktMnsInfo.getKtSvcClientSecret())
|
|
|
|
|
.scope(ktMnsInfo.getKtScope())
|
|
|
|
|
//.clientId(ktMnsInfo.getKtClientId())
|
|
|
|
|
.clientId(URLEncoder.encode(ktMnsInfo.getKtSvcClientId()))
|
|
|
|
|
.clientSecret(URLEncoder.encode(ktMnsInfo.getKtSvcClientSecret()))
|
|
|
|
|
.scope(URLEncoder.encode(ktMnsInfo.getKtScope()))
|
|
|
|
|
.build();
|
|
|
|
|
CmmEnsUtils.validate(reqDTO);
|
|
|
|
|
|
|
|
|
|
final Map<String,String> headerMap = new HashMap<>();
|
|
|
|
|
headerMap.put(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON_VALUE);
|
|
|
|
|
// headerMap.put(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_FORM_URLENCODED_VALUE);
|
|
|
|
|
// headerMap.put("client-id", "client-id");
|
|
|
|
|
// headerMap.put("client-tp", "10");
|
|
|
|
|
headerMap.put("client-id", ktMnsInfo.getKtClientId());
|
|
|
|
|
headerMap.put("client-tp", ktMnsInfo.getKtClientTp());
|
|
|
|
|
// headerMap.put(HttpHeaders.AUTHORIZATION, String.format("%s %s", AUTH_TYPE_BEARER, "access-token"));
|
|
|
|
|
|
|
|
|
|
return webClient.exchange(
|
|
|
|
|