当前位置:网站首页>Best practice | using Tencent cloud AI willingness to audit as the escort of telephone compliance
Best practice | using Tencent cloud AI willingness to audit as the escort of telephone compliance
2022-07-07 13:45:00 【InfoQ】
One 、 preparation
First step : Open face core service
The second step : Business application
The third step : Learn about Tencent cloud AI Intention core
Step four : Will core configuration
Step five : Get the cloud of account API secret key
Two 、 Access intention core
First step : To Tencent cloud AI Willingness to verify authorization
The second step : To Tencent cloud AI Intend to endow the body with real-time playback / Permission to record audio and video streams
The third step : To Tencent cloud AI Wish to add a whitelist to the core domain name
- The following domain names need to be added to request Legitimate domain name :https://events.tim.qq.com;https://faceid.qq.com;https://grouptalk.c2c.qq.com;https://pingtas.qq.com;https://web.sdk.qcloud.com;https://webim.tim.qq.com;https://yun.tim.qq.com;
Step four : Initialize Tencent cloud AI Intention core SDK
//app.js
App({
onLaunch: function () {
// Initialize the intention core component
const Verify = require('/verify_mpsdk/main');
Verify.init();
}
})
// app.json
{
"pages":[
"verify_mpsdk/index/index"
]
}
Step five : Back end access to Tencent cloud AI Intention core Real name authentication interface
import com.tencentcloudapi.common.Credential;
import com.tencentcloudapi.common.profile.ClientProfile;
import com.tencentcloudapi.common.profile.HttpProfile;
import com.tencentcloudapi.common.exception.TencentCloudSDKException;
import com.tencentcloudapi.faceid.v20180301.FaceidClient;
import com.tencentcloudapi.faceid.v20180301.models.*;
public class DetectAuth
{
public static void main(String [] args) {
try{
// Instantiate an authentication object , To join, you need to transfer it to Tencent cloud account secretId,secretKey, Here, you should also pay attention to the confidentiality of the key pair
// The key can go to https://console.cloud.tencent.com/cam/capi Website to get
Credential cred = new Credential("SecretId", "SecretKey");
// Instantiate a http Options , Optional , There are no special requirements to skip
HttpProfile httpProfile = new HttpProfile();
httpProfile.setEndpoint("faceid.tencentcloudapi.com");
// Instantiate a client Options , Optional , There are no special requirements to skip
ClientProfile clientProfile = new ClientProfile();
clientProfile.setHttpProfile(httpProfile);
// Instantiate the product to request client object ,clientProfile It's optional
FaceidClient client = new FaceidClient(cred, "", clientProfile);
// Instantiate a request object , Each interface will correspond to a request object
DetectAuthRequest req = new DetectAuthRequest();
// Back to resp It's a DetectAuthResponse Example , Corresponding to the request object
DetectAuthResponse resp = client.DetectAuth(req);
// Output json Format string package
System.out.println(DetectAuthResponse.toJsonString(resp));
} catch (TencentCloudSDKException e) {
System.out.println(e.toString());
}
}
}
Step six : Enter the intention verification process
// When you click a button , Trigger the function
gotoVerify: function () {
// Go to the server of the access party to call DetectAuth Interface acquisition BizToken, The server of the access party needs to realize it by itself
let BizToken = getBizToken();
// Call the real name kernel function
wx.startVerify({
data: {
token: BizToken // BizToken
},
success: (res) => { // Triggered after successful verification
// res Including those that have been verified successfully token
},
fail: (err) => { // Triggered when validation fails
// err Contains error code , error message
}
});
}
Step seven : Back end access to Tencent cloud AI Get the intention verification result interface
import com.tencentcloudapi.common.Credential;
import com.tencentcloudapi.common.profile.ClientProfile;
import com.tencentcloudapi.common.profile.HttpProfile;
import com.tencentcloudapi.common.exception.TencentCloudSDKException;
import com.tencentcloudapi.faceid.v20180301.FaceidClient;
import com.tencentcloudapi.faceid.v20180301.models.*;
public class GetDetectInfoEnhanced
{
public static void main(String [] args) {
try{
// Instantiate an authentication object , To join, you need to transfer it to Tencent cloud account secretId,secretKey, Here, you should also pay attention to the confidentiality of the key pair
// The key can go to https://console.cloud.tencent.com/cam/capi Website to get
Credential cred = new Credential("SecretId", "SecretKey");
// Instantiate a http Options , Optional , There are no special requirements to skip
HttpProfile httpProfile = new HttpProfile();
httpProfile.setEndpoint("faceid.tencentcloudapi.com");
// Instantiate a client Options , Optional , There are no special requirements to skip
ClientProfile clientProfile = new ClientProfile();
clientProfile.setHttpProfile(httpProfile);
// Instantiate the product to request client object ,clientProfile It's optional
FaceidClient client = new FaceidClient(cred, "", clientProfile);
// Instantiate a request object , Each interface will correspond to a request object
GetDetectInfoEnhancedRequest req = new GetDetectInfoEnhancedRequest();
// Back to resp It's a GetDetectInfoEnhancedResponse Example , Corresponding to the request object
GetDetectInfoEnhancedResponse resp = client.GetDetectInfoEnhanced(req);
// Output json Format string package
System.out.println(GetDetectInfoEnhancedResponse.toJsonString(resp));
} catch (TencentCloudSDKException e) {
System.out.println(e.toString());
}
}
}
3、 Will core effect display
4、 Query the transferred quantity
边栏推荐
- Indoor ROS robot navigation commissioning record (experience in selecting expansion radius)
- How to make join run faster?
- Drawerlayout suppress sideslip display
- 云计算安全扩展要求关注的安全目标和实现方式区分原则有哪些?
- Detr introduction
- LED light of single chip microcomputer learning notes
- 【黑马早报】华为辟谣“军师”陈春花;恒驰5预售价17.9万元;周杰伦新专辑MV 3小时播放量破亿;法华寺回应万元月薪招人...
- 2022-7-6 Leetcode 977.有序数组的平方
- Enregistrement de la navigation et de la mise en service du robot ROS intérieur (expérience de sélection du rayon de dilatation)
- Getting started with cinnamon applet
猜你喜欢
Flink | 多流转换
2022-7-7 Leetcode 34. Find the first and last positions of elements in a sorted array
My "troublesome" subordinates after 00: not bad for money, against leaders, and resist overtime
High end for 8 years, how is Yadi now?
Getting started with MySQL
得物客服热线的演进之路
"Song of ice and fire" in the eleventh issue of "open source Roundtable" -- how to balance the natural contradiction between open source and security?
Milkdown control icon
2022-7-6 初学redis(一)在 Linux 下下载安装并运行 redis
室內ROS機器人導航調試記錄(膨脹半徑的選取經驗)
随机推荐
postgresql array类型,每一项拼接
Enregistrement de la navigation et de la mise en service du robot ROS intérieur (expérience de sélection du rayon de dilatation)
DID登陆-MetaMask
How to make join run faster?
Oracle advanced (V) schema solution
Show the mathematical formula in El table
Simple and easy-to-use code specification
干货|总结那些漏洞工具的联动使用
Distributed transaction solution
一文读懂数仓中的pg_stat
单片机学习笔记之点亮led 灯
Ikvm of toolbox Net project new progress
MongoDB的导入导出、备份恢复总结
How far can it go to adopt a cow by selling the concept to the market?
Final review notes of single chip microcomputer principle
Ways to improve the performance of raspberry pie
118. Yanghui triangle
Clion mingw64 Chinese garbled code
1. Deep copy 2. Call apply bind 3. For of in differences
SSRF漏洞file伪协议之[网鼎杯 2018]Fakebook1