|
|
|
|
|
|
65
|
IdentityAuthentication identityAuthentication = new IdentityAuthentication();
|
65
|
IdentityAuthentication identityAuthentication = new IdentityAuthentication();
|
|
66
|
try{
|
66
|
try{
|
|
67
|
// Credential credIdenAuth = new Credential(SECRET_ID, SECRET_KEY);
|
67
|
// Credential credIdenAuth = new Credential(SECRET_ID, SECRET_KEY);
|
|
68
|
- Credential credIdenAuth = new Credential(credentialSecretId, credentialSecretKey);
|
|
|
|
|
|
68
|
+ Credential authenti = new Credential(credentialSecretId, credentialSecretKey);
|
|
69
|
HttpProfile httpProfileIdenAuth = new HttpProfile();
|
69
|
HttpProfile httpProfileIdenAuth = new HttpProfile();
|
|
70
|
httpProfileIdenAuth.setEndpoint("faceid.tencentcloudapi.com");
|
70
|
httpProfileIdenAuth.setEndpoint("faceid.tencentcloudapi.com");
|
|
71
|
- ClientProfile clientProfileIdenAuth = new ClientProfile();
|
|
|
|
72
|
- clientProfileIdenAuth.setHttpProfile(httpProfileIdenAuth);
|
|
|
|
73
|
- FaceidClient clientIdenAuth = new FaceidClient(credIdenAuth, "", clientProfileIdenAuth);
|
|
|
|
|
|
71
|
+ ClientProfile clientInv= new ClientProfile();
|
|
|
|
72
|
+ clientInv.setHttpProfile(httpProfileIdenAuth);
|
|
|
|
73
|
+ FaceidClient clientIdenAuth = new FaceidClient(authenti, "", clientInv);
|
|
74
|
// 实例化一个请求对象
|
74
|
// 实例化一个请求对象
|
|
75
|
- GetEidTokenRequest reqIdenAuth = new GetEidTokenRequest();
|
|
|
|
|
|
75
|
+ GetEidTokenRequest reqest = new GetEidTokenRequest();
|
|
76
|
//设置请求参数
|
76
|
//设置请求参数
|
|
77
|
- reqIdenAuth.setMerchantId(merchantId);
|
|
|
|
78
|
- GetEidTokenResponse respIdenAuth = clientIdenAuth.GetEidToken(reqIdenAuth);
|
|
|
|
|
|
77
|
+ reqest.setMerchantId(merchantId);
|
|
|
|
78
|
+ GetEidTokenResponse respIdenAuth = clientIdenAuth.GetEidToken(reqest);
|
|
79
|
String respJSON = GetEidTokenResponse.toJsonString(respIdenAuth);
|
79
|
String respJSON = GetEidTokenResponse.toJsonString(respIdenAuth);
|
|
80
|
JSONObject objJSON = JSON.parseObject(respJSON);
|
80
|
JSONObject objJSON = JSON.parseObject(respJSON);
|
|
81
|
JSONObject objJSONRes = (JSONObject) objJSON.get("Response");
|
81
|
JSONObject objJSONRes = (JSONObject) objJSON.get("Response");
|