소스 검색

第三方添加江宁大数据局

release_hzx
蚂蚁哥 5 달 전
부모
커밋
e2463a88a7
1개의 변경된 파일11개의 추가작업 그리고 2개의 파일을 삭제
  1. +11
    -2
      tuoheng_oidc_server/src/main/java/com/tuoheng/service/impl/ThirdServiceImpl.java

+ 11
- 2
tuoheng_oidc_server/src/main/java/com/tuoheng/service/impl/ThirdServiceImpl.java 파일 보기

@@ -62,11 +62,13 @@ public class ThirdServiceImpl implements ThirdService {
log.info("clientId is {}, userName is {}",clientId,userName);

if(ThirdConstant.TUOHENG_AIRPORT_ADMIN.equals(clientId) && StringUtils.isEmpty(userName) && userName.equals("jnbigdata")){
log.info("enterjnbigdata");
username = "jnbigdata";
password = "thjs2023";
}else if(ThirdConstant.TUOHENG_AIRPORT_ADMIN.equals(clientId)){
// username = "jnbigdata";
// password = "thjs2023";
log.info("enterclientId");
username = "jnbigdata";
password = "thjs2023";
username = ThirdConstant.GZJJ_USERNAME;
password = ThirdConstant.GZJJ_PASSWORD;
}else if(ThirdConstant.TUOHENG_TELECOMUMALE_ADMIN.equals(clientId)){
@@ -76,6 +78,7 @@ public class ThirdServiceImpl implements ThirdService {
return JsonResult.error("clientId error");
}

log.info("userName is {},password is {}" , username,password);
//通过oidc的密码模式获取授权token 等相关信息数据
TokenResult tokenResult = getToken(clientId,username,password);
tokenResult.setUserName(username);
@@ -116,7 +119,13 @@ public class ThirdServiceImpl implements ThirdService {
headers.add("Authorization", "Basic " + authorization);
HttpEntity<MultiValueMap<String, String>> httpEntity = new HttpEntity(params, headers);

String jsonString = JSONObject.toJSONString(params);
String jsonString1 = JSONObject.toJSONString(headers);
log.info("sign json is " + jsonString);
log.info("sign json1 is " + jsonString1);

ResponseEntity<TokenResult> response = restTemplate.exchange(url, HttpMethod.POST, httpEntity, parameterizedTypeReference);
log.info("sign result is " + JSONObject.toJSONString(response));
return response.getBody();
}


Loading…
취소
저장