当前位置:网站首页>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


边栏推荐
- Storage principle inside mongodb
- Simple and easy-to-use code specification
- High end for 8 years, how is Yadi now?
- Summary of import, export, backup and recovery of mongodb
- Fast development board pinctrl and GPIO subsystem experiment for itop-imx6ull - modify the device tree file
- [1] ROS2基础知识-操作命令总结版
- cmake 学习使用笔记(一)
- QQ的药,腾讯的票
- 简单好用的代码规范
- LeetCode_ Binary search_ Medium_ 153. Find the minimum value in the rotation sort array
猜你喜欢

Sliding rail stepping motor commissioning (national ocean vehicle competition) (STM32 master control)

单片机学习笔记之点亮led 灯

Scrapy教程经典实战【新概念英语】

Fast development board pinctrl and GPIO subsystem experiment for itop-imx6ull - modify the device tree file

高等数学---第八章多元函数微分学1

flask session伪造之hctf admin

2022-7-7 Leetcode 34. Find the first and last positions of elements in a sorted array

Write it down once Net a new energy system thread surge analysis

Ogre introduction

High end for 8 years, how is Yadi now?
随机推荐
简单好用的代码规范
MongoDB优化的几点原则
Learning breakout 2 - about effective learning methods
信号强度(RSSI)知识整理
作战图鉴:12大场景详述容器安全建设要求
实现IP地址归属地显示功能、号码归属地查询
Centso7 OpenSSL error Verify return code: 20 (unable to get local issuer certificate)
"New red flag Cup" desktop application creativity competition 2022
Introduce six open source protocols in detail (instructions for programmers)
Split screen bug notes
Esp32 ① compilation environment
【日常训练】648. 单词替换
Oracle advanced (V) schema solution
Navicat run SQL file import data incomplete or import failed
JNA learning notes 1: Concepts
OSI seven layer model
Flink | 多流转换
[learning notes] zkw segment tree
Data refresh of recyclerview
Some principles of mongodb optimization