应用申请使用oauth2协议授权第一步:申请授权码应用申请使用oauth2协议授权第一步:申请授权码
签名:
签名信息 | 签名类型 |
---|---|
是否签名 | 否 |
GET请求地址:
环境 | https请求地址 |
---|---|
正式环境 | https://openauth.duolabao.com/oauth/authorize |
公共请求参数:
参数名称 | 参数类型 | 是否必填 | 最大长度 | 参数说明 | 示例值 |
---|---|---|---|---|---|
redirectUrl | String | 是 | 32 | 应用地址 | https://yourdomain.com/callback |
appNum | String | 是 | 32 | 应用id | 11103984930302 |
state | String | 是 | 32 | 防csrf攻击 | 123456 |
responseType | String | 是 | 32 | 授权类型,固定值为code | code |
scope | String | 是 | 32 | 申请访问的资源权限描述,固定值read | read |
type | String | 是 | 32 |
说明授权渠道 APP(手机端), PC(PC端), WEIXIN(微信端), WEB(WEB端) |
APP |
1 | https://openauth.duolabao.com/oauth/authorize?redirectUrl={redirectUrl}&appNum={appNum}&state= |
2 | {state}&responseType={code}&scope={scope}&type={type} |
1 | https://openauth.duolabao.com/oauth/authorize?redirectUrl=https://xxx.cn/xx&appNum= |
2 | 12345&state=xyz&responseType=code&scope=read&type=APP |
1 | https://yourdomain.com/callback?code=123dkeo&state=123456 |
1 | https://yourdomain.com/callback?error=invalid_scope&error_description=error |