2/oauth2/authorize/en

跳转到: 导航, 搜索
(Created page with '==oauth2/authorize== Authorize interface of OAuth2. ==URL== https://api.weibo.com/oauth2/authorize ==HTTP Request Method== GET/POST ==Request Parameters== {| border="1" cellsp…')
 
(Example)
 
(未显示1个用户的7个中间版本)
第15行: 第15行:
 
!width="10%" style="text-align:center;font-weight:bolder;border:1px solid #cccccc"|Type and Range
 
!width="10%" style="text-align:center;font-weight:bolder;border:1px solid #cccccc"|Type and Range
 
!width="75%" style="text-align:center;font-weight:bolder;border:1px solid #cccccc"|Description
 
!width="75%" style="text-align:center;font-weight:bolder;border:1px solid #cccccc"|Description
{{api_args|client_id|true|string|AppKey created when a application is created. }}
+
{{api_args|client_id|true|string|AppKey created when an application is created. }}
 
{{api_args|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.}}
 
{{api_args|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.}}
{{api_args|response_type|false|string|Returned type.Supports code,token.Default is code.}}
+
{{api_args|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.[[Scope|document]] }}
 
{{api_args|state|false|string|State for keeping request and callback.It will be returned in Query Parameter when callback.}}
 
{{api_args|state|false|string|State for keeping request and callback.It will be returned in Query Parameter when callback.}}
 
{{api_args|display|false|string|Terminal type of the authorization page.The value is as follows.}}
 
{{api_args|display|false|string|Terminal type of the authorization page.The value is as follows.}}
 +
{{api_args|forcelogin|false|boolean|Whether the user need login again or not. true:Yes,false:No.Default is 'No'.}}
 +
{{api_args|language|false|string|The language type of authorization page. Default is Chinese. 'en' means English.}}
 
|}
 
|}
  
第33行: 第35行:
 
|-
 
|-
 
|style="text-align:left;padding-left:5px;font-weight:bolder;border:1px solid #cccccc"|mobile
 
|style="text-align:left;padding-left:5px;font-weight:bolder;border:1px solid #cccccc"|mobile
|style="text-align:left;padding-left:5px;border:1px solid #cccccc"|Mobile termination authorization page.Apply to the mobile phone
+
|style="text-align:left;padding-left:5px;border:1px solid #cccccc"|Mobile termination authorization page.Apply to the mobile phone that supports html5.
that supports html5.
+
 
|-
 
|-
 +
|style="text-align:left;padding-left:5px;font-weight:bolder;border:1px solid #cccccc"|wap
 +
|style="text-align:left;padding-left:5px;border:1px solid #cccccc"|Wap type authorization page. Apply to dumbphone.
 +
|-
 +
|style="text-align:left;padding-left:5px;font-weight:bolder;border:1px solid #cccccc"|client
 +
|style="text-align:left;padding-left:5px;border:1px solid #cccccc"|Client type authorization page.Apply to PC desktop application.
 +
<!--|-
 
|style="text-align:left;padding-left:5px;font-weight:bolder;border:1px solid #cccccc"|popup
 
|style="text-align:left;padding-left:5px;font-weight:bolder;border:1px solid #cccccc"|popup
 
|style="text-align:left;padding-left:5px;border:1px solid #cccccc"|Popup window type authorization page.Apply to the small window web browser.
 
|style="text-align:left;padding-left:5px;border:1px solid #cccccc"|Popup window type authorization page.Apply to the small window web browser.
第46行: 第53行:
 
|-
 
|-
 
|style="text-align:left;padding-left:5px;font-weight:bolder;border:1px solid #cccccc"|js
 
|style="text-align:left;padding-left:5px;font-weight:bolder;border:1px solid #cccccc"|js
|style="text-align:left;padding-left:5px;border:1px solid #cccccc"|Weibo JS-SDK special authorization page.Popup window type.The returned data is JSONP callback function.
+
|style="text-align:left;padding-left:5px;border:1px solid #cccccc"|Weibo JS-SDK special authorization page.Popup window type.The returned data is JSONP callback function.-->
 
|-
 
|-
 
|style="text-align:left;padding-left:5px;font-weight:bolder;border:1px solid #cccccc"|apponweibo
 
|style="text-align:left;padding-left:5px;font-weight:bolder;border:1px solid #cccccc"|apponweibo
|style="text-align:left;padding-left:5px;border:1px solid #cccccc"|Default authorization page of the application inside the website.授权后不返回access_token,只刷新站内应用父框架。
+
|style="text-align:left;padding-left:5px;border:1px solid #cccccc"|Default authorization page of the application inside the website.Access_token is not returned after authorization.Only refresh the parent frame.
 
|}
 
|}
  
==返回数据==
+
==Response==
;'''response_type为code'''
+
 
{| 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;"
 
|-
 
|-
!width="25%" style="text-align:left;padding-left:5px;font-weight:bolder;border:1px solid #cccccc"|返回值字段
+
!width="25%" style="text-align:left;padding-left:5px;font-weight:bolder;border:1px solid #cccccc"|Returned Field
!width="15%" style="text-align:left;padding-left:5px;font-weight:bolder;border:1px solid #cccccc"|字段类型
+
!width="15%" style="text-align:left;padding-left:5px;font-weight:bolder;border:1px solid #cccccc"|Field Type
!width="60%" style="text-align:left;padding-left:5px;font-weight:bolder;border:1px solid #cccccc"|字段说明
+
!width="60%" style="text-align:left;padding-left:5px;font-weight:bolder;border:1px solid #cccccc"|Field Description
{{rdes_args|code|string|用于调用access_token,接口获取授权后的access token。}}
+
{{rdes_args|code|string|It is used for getting the access_token}}
{{rdes_args|state|string|如果传递参数,会回传该参数。}}
+
{{rdes_args|state|string|It will be returned if parameter 'state' is provided}}
 
|}
 
|}
  
  
;'''response_type为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;"
 
|-
 
|-
!width="25%" style="text-align:left;padding-left:5px;font-weight:bolder;border:1px solid #cccccc"|返回值字段
+
!width="25%" style="text-align:left;padding-left:5px;font-weight:bolder;border:1px solid #cccccc"|Returned Field
!width="15%" style="text-align:left;padding-left:5px;font-weight:bolder;border:1px solid #cccccc"|字段类型
+
!width="15%" style="text-align:left;padding-left:5px;font-weight:bolder;border:1px solid #cccccc"|Field Type
!width="60%" style="text-align:left;padding-left:5px;font-weight:bolder;border:1px solid #cccccc"|字段说明
+
!width="60%" style="text-align:left;padding-left:5px;font-weight:bolder;border:1px solid #cccccc"|Field Description
{{rdes_args|access_token|string|用来调用其它接口的授权过的accesstoken。}}
+
{{rdes_args|access_token|string|Authorized access token.For calling other interfaces}}
{{rdes_args|expires_in|string|accesstoken有效期时间,unix的timestamp格式。}}
+
{{rdes_args|expires_in|string|Valid time of access token.Timestamp format of unix}}
{{rdes_args|refresh_token|string|刷新token,如果有获取权限则返回。}}
+
{{rdes_args|refresh_token|string|Refresh token.It will be returned if the application is allowed}}
{{rdes_args|state|string|如果传递参数,会回传该参数。}}
+
{{rdes_args|state|string|It will be returned if parameter 'state' is provided}}
|}
+
|}-->
  
==示例==
+
==Example==
;'''response_type为token'''
+
 
<pre>
 
<pre>
 
//请求
 
//请求
https://api.t.sina.com.cn/oauth2/authorize?client_id=123050457758183&redirect_uri=http://www.example.com/response&response_type=token
+
https://api.weibo.com/oauth2/authorize?client_id=123050457758183&redirect_uri=http://www.example.com/response&response_type=code
 
+
//同意授权后会重定向
+
http://www.example.com/response#access_token=ACCESS_TOKEN&expires_in=250327040&refresh_token=REFRESH_TOKEN
+
</pre>
+
 
+
 
+
;'''response_type为code'''
+
<pre>
+
//请求
+
https://api.t.sina.com.cn/oauth2/authorize?client_id=123050457758183&redirect_uri=http://www.example.com/response&response_type=code
+
  
 
//同意授权后会重定向
 
//同意授权后会重定向
 
http://www.example.com/response&code=CODE
 
http://www.example.com/response&code=CODE
 
</pre>
 
</pre>
 
  
  
 
__NOTOC__
 
__NOTOC__

2013年4月1日 (一) 20:08的最后版本

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

//请求
https://api.weibo.com/oauth2/authorize?client_id=123050457758183&redirect_uri=http://www.example.com/response&response_type=code

//同意授权后会重定向
http://www.example.com/response&code=CODE


文档更新时间: 2013-04-01