2/oauth2/authorize/en
(→Response) |
|||
第60行: | 第60行: | ||
==Response== | ==Response== | ||
− | |||
{| border="1" cellspacing="0" cellpadding="0" width="100%" class="parameters" style="border-color: #CCCCCC;" | {| border="1" cellspacing="0" cellpadding="0" width="100%" class="parameters" style="border-color: #CCCCCC;" | ||
|- | |- | ||
第71行: | 第70行: | ||
− | ;'''response_type is token''' | + | <!--;'''response_type is token''' |
{| border="1" cellspacing="0" cellpadding="0" width="100%" class="parameters" style="border-color: #CCCCCC;" | {| border="1" cellspacing="0" cellpadding="0" width="100%" class="parameters" style="border-color: #CCCCCC;" | ||
|- | |- | ||
第81行: | 第80行: | ||
{{rdes_args|refresh_token|string|Refresh token.It will be returned if the application is allowed}} | {{rdes_args|refresh_token|string|Refresh token.It will be returned if the application is allowed}} | ||
{{rdes_args|state|string|It will be returned if parameter 'state' is provided}} | {{rdes_args|state|string|It will be returned if parameter 'state' is provided}} | ||
− | |} | + | |}--> |
==Example== | ==Example== |
2013年4月1日 (一) 20:07的版本
oauth2/authorize
Authorize interface of OAuth2.
URL
https://api.weibo.com/oauth2/authorize
HTTP Request Method
GET/POST
Request Parameters
Requires | Type and Range | Description | |
---|---|---|---|
client_id | true | string | AppKey created when an application is created. |
redirect_uri | true | string | Authorization callback address.Application outside the website need to be the same with the setted callback address,and application inside the website need to be the canvas page URL. |
scope | false | string | It need to be passed when applies for scope authorization.More than one scope can be applied at one time, and should be separated by simeangle comma.document |
state | false | string | State for keeping request and callback.It will be returned in Query Parameter when callback. |
display | false | string | Terminal type of the authorization page.The value is as follows. |
forcelogin | false | boolean | Whether the user need login again or not. true:Yes,false:No.Default is 'No'. |
language | false | string | The language type of authorization page. Default is Chinese. 'en' means English. |
- display description:
Parameter value | Type Description |
---|---|
default | Default authorization page.Apply to the web browser. |
mobile | Mobile termination authorization page.Apply to the mobile phone that supports html5. |
wap | Wap type authorization page. Apply to dumbphone. |
client | Client type authorization page.Apply to PC desktop application. |
apponweibo | Default authorization page of the application inside the website.Access_token is not returned after authorization.Only refresh the parent frame. |
Response
Returned Field | Field Type | Field Description |
---|---|---|
code | string | It is used for getting the access_token |
state | string | It will be returned if parameter 'state' is provided |
Example
- response_type is token
//Request https://api.t.sina.com.cn/oauth2/authorize?client_id=123050457758183&redirect_uri=http://www.example.com/response&response_type=token //Will redirect after authorization http://www.example.com/response#access_token=ACCESS_TOKEN&expires_in=250327040&refresh_token=REFRESH_TOKEN
- response_type is code
//Request https://api.t.sina.com.cn/oauth2/authorize?client_id=123050457758183&redirect_uri=http://www.example.com/response&response_type=code //Will redirect after authorization http://www.example.com/response&code=CODE