Exemplo n.º 1
0
        /// <summary>
        /// 每次调用人脸核身SaaS化服务前,需先调用本接口获取BizToken,用来串联核身流程,在验证完成后,用于获取验证结果信息。
        /// </summary>
        /// <param name="req"><see cref="DetectAuthRequest"/></param>
        /// <returns><see cref="DetectAuthResponse"/></returns>
        public DetectAuthResponse DetectAuthSync(DetectAuthRequest req)
        {
            JsonResponseModel <DetectAuthResponse> rsp = null;

            try
            {
                var strResp = this.InternalRequestSync(req, "DetectAuth");
                rsp = JsonConvert.DeserializeObject <JsonResponseModel <DetectAuthResponse> >(strResp);
            }
            catch (JsonSerializationException e)
            {
                throw new TencentCloudSDKException(e.Message);
            }
            return(rsp.Response);
        }
Exemplo n.º 2
0
        public DetectAuthResponse DetectAuthH5(string redirect, string ruleId = "")
        {
            if (string.IsNullOrEmpty(ruleId))
            {
                ruleId = Options.CurrentValue.RuleId;
            }

            ClientProfile clientProfile = new ClientProfile();
            HttpProfile   httpProfile   = new HttpProfile();

            httpProfile.Endpoint      = ("faceid.tencentcloudapi.com");
            clientProfile.HttpProfile = httpProfile;

            FaceidClient      client = new FaceidClient(GetCredential(), Options.CurrentValue.Region, clientProfile);
            DetectAuthRequest req = new DetectAuthRequest();
            string            strParams = new { RuleId = ruleId, RedirectUrl = redirect }.ToJson();

            req = DetectAuthRequest.FromJsonString <DetectAuthRequest>(strParams);
            return(client.DetectAuthSync(req));
        }