请求用户授权

接口地址

/api/index.php/Oauth2/authorize


返回格式

JSON/HTML


http请求方式

GET/POST


请求参数
参数名称 必须 类型及范围 描述
access_token string Oauth2授权成功后获得的access_token
client_id string

申请应用时分配的AppKey。

response_type string

请填写 "code"。

redirect_uri string

授权回调地址,地址的顶级域名需与设置的网站域名一致。

state string

用于保持请求和回调的状态,在回调时,会在Query Parameter中回传该参数。开发者可以用这个参数验证请求有效性,也可以记录用户请求授权页前的位置。这个参数可用于防止跨站请求伪造(CSRF)攻击。


返回结果
请求
/api/index.php?s=Oauth2/authorize?client_id=123050457758183&redirect_uri=http://www.example.com/response&response_type=code
同意授权后会重定向
http://www.example.com/response&code=CODE