公司动态

身份实名认证API:“身份真实性过滤器“→大幅降低虚假账号的注册量

📅 2026/8/18 11:21:05
身份实名认证API:“身份真实性过滤器“→大幅降低虚假账号的注册量
一、为什么需要身份证核验二、身份证二要素核验的原理身份证二要素核验接口的核心逻辑是接口通常还会附带一些脱敏的辅助信息例如校验出的性别、出生日期、归属地等便于业务侧根据核验结果做分层处理。三、适用场景注册风控新用户注册时在提交资料后立即调用接口校验姓名与身份证是否一致从源头拦截冒用身份和批量注册行为。这是目前用得最多的场景。金融开户在证券开户、贷款申请、支付实名认证等场景中二要素核验是监管合规要求的基础环节用于确认开户人身份真实性。医疗与政务在线问诊、医保电子凭证、政务服务等强实名场景中需要确保用户身份与真实世界对应。存量数据清洗对于已经积累的大量用户数据可以定期调用接口进行批量核验标记出身份信息异常的账号为后续的数据治理提供依据。四、接口请求方式接口通常采用 HTTP GET 请求参数说明如下接口返回的结果中一般包含isok核验结果1 表示一致0 表示不一致脱敏的辅助信息性别、出生日期、归属地等五、C# 接入实战下面以 C# 为例演示如何在服务端调用身份证二要素核验接口。5.1 代码实现接口地址https://market.aliyun.com/detail/cmapi00067376 //using System.IO; //using System.Text; //using System.Net; //using System.Net.Security; //using System.Security.Cryptography.X509Certificates; private const String host https://market.aliyun.com/detail/cmapi00067376;#地址 private const String path /idcard; private const String method GET; private const String appcode 你自己的AppCode; static void Main(string[] args) { String querys name%E5%BC%A0%E4%B8%89idcard330333333333333333; String bodys ; String url host path; HttpWebRequest httpRequest null; HttpWebResponse httpResponse null; if (0 querys.Length) { url url ? querys; } if (host.Contains(https://)) { ServicePointManager.ServerCertificateValidationCallback new RemoteCertificateValidationCallback(CheckValidationResult); httpRequest (HttpWebRequest)WebRequest.CreateDefault(new Uri(url)); } else { httpRequest (HttpWebRequest)WebRequest.Create(url); } httpRequest.Method method; httpRequest.Headers.Add(Authorization, APPCODE appcode); if (0 bodys.Length) { byte[] data Encoding.UTF8.GetBytes(bodys); using (Stream stream httpRequest.GetRequestStream()) { stream.Write(data, 0, data.Length); } } try { httpResponse (HttpWebResponse)httpRequest.GetResponse(); } catch (WebException ex) { httpResponse (HttpWebResponse)ex.Response; } Console.WriteLine(httpResponse.StatusCode); Console.WriteLine(httpResponse.Method); Console.WriteLine(httpResponse.Headers); Stream st httpResponse.GetResponseStream(); StreamReader reader new StreamReader(st, Encoding.GetEncoding(utf-8)); Console.WriteLine(reader.ReadToEnd()); Console.WriteLine(\n); } public static bool CheckValidationResult(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors errors) { return true; }六、返回结果示例{ code: 1, msg: 核验通过, data: { isok: 1, sex: 男, birthday: 1990-03-07, address: 北京市朝阳区 } }字段说明code接口调用状态码1 表示请求成功msg状态描述data.isok核验结果1 一致0 不一致data.sex性别脱敏字段data.birthday出生日期data.address归属地精确到区县