既有登录用户ID上传
获取认证码
/**
* projectKeyId: 项目ID
* secretKey: 项目私钥
* keyArray: loginUserId用逗号拼接的字符串
*/
public String authToken(String projectKeyId, String secretKey, String keyArray) throws Exception {
String message = "projectId="+projectKeyId+"&loginUserId="+keyArray;
Mac hmac = Mac.getInstance("HmacSHA256");
hmac.init(new SecretKeySpec(secretKey.getBytes("UTF-8"), "HmacSHA256"));
byte[] signature = hmac.doFinal(message.getBytes("UTF-8"));
return Hex.encodeHexString(signature);
}接口定义
URL
请求类型
参数说明
Last updated
Was this helpful?