参数名 | 必选 | 类型 | 说明 |
---|---|---|---|
appid | 是 | string | 业务透传过来,应用appid |
secret | 是 | string | 应用秘钥 |
grant_type | 是 | string | 获权类型, 固定填 client_credential |
参数名 | 类型 | 说明 |
---|---|---|
access_token | string | access_token |
expires_in | int | access_token有效期 |
refresh_token | string | refresh_token 刷新access_token时使用 |
error_code | int | 错误码 |
error_msg | string | error_code非0时的错误消息 |
参数名 | 必选 | 类型 | 说明 |
---|---|---|---|
appid | 是 | string | 业务透传过来,应用appid |
secret | 是 | string | 应用秘钥 |
code | 是 | string | 授权码,authcode |
grant_type | 是 | string | 获权类型, 固定填 authorization_code |
参数名 | 类型 | 说明 |
---|---|---|
access_token | string | access token |
expires_in | int | access token有效期 |
refresh_token | string | refresh token 刷新access token时使用 |
openid | string | openid |
unionid | string | unionid |
scope | string | 本次授权范围 |
orig_acnt_type | int | (需要应用具备该权限才会返回)账号原始类型(1 QQ; 2 微信;) |
error_code | int | 错误码 |
error_msg | string | error_code非0时的错误消息 |
参数名 | 必选 | 类型 | 说明 |
---|---|---|---|
appid | 是 | string | 业务透传过来,应用appid |
openid | 否 | string | 用户openid。仅刷新用户级token需要 |
refresh_token | 是 | string | 用户的refresh_token |
sign | 是 | string | 应用接口请求签名,计算规则如下 |
ts | 是 | int | 时间戳(单位s) |
fun sign(ts: Long): String {
val str = "KG_" + TmeRuntime.get().appId + "_" + ts + "_" + TmeRuntime.get().appKey
return MD5Util.md5(str)
}
参数名 | 类型 | 说明 |
---|---|---|
access_token | string | 刷新获得的AccessToken |
expires_in | int | AccessToken有效期 |
error_code | int | 错误码 |
error_msg | string | error_code非0时的错误消息 |
正式环境:https://api.kg.qq.com/oauth/v2/light_qr_code
测试环境:https://api.kg.qq.com/test/oauth/v2/light_qr_code
参数名 | 必选 | 类型 | 说明 |
---|---|---|---|
appid | 是 | string | 业务透传过来,应用appid |
response_type | 是 | string | 固定填 code |
scope | 是 | string | 固定填snsapi_login |
sign | 是 | string | 应用接口请求签名,参考refresh_token生成方式 |
ts | 是 | int | 当前时间戳(单位s) |
business_data | 否 | string | 二码合一支付透传数据 |
scan_side_redirect_uri | 否 | string | 扫码端登录成功后跳转地址 |
参数名 | 类型 | 说明 |
---|---|---|
qr_code | string | 二维码 |
expires_in | int | 二维码有效期 |
qr_sig | string | 二维码签名 |
error_code | int | 错误码 |
error_msg | string | error_code非0时的错误消息 |