开源中国 API
复制页面
开源中国 API
OSCHINA 开放平台Beta
认证接口
oauth2_authorize
GET
oauth2_token
POST
个人信息
openapi_user
POST
user_information
POST
my_information
POST
portrait_update
POST
friends_list
POST
active_list
POST
update_user_relation
POST
新闻
news_list
POST
/action/openapi/news_detail
POST
帖子
post_list
POST
post_pub
POST
post_detail
POST
动弹
tweet_list
POST
tweet_detail
POST
tweet_pub
POST
tweet_delete
POST
博客
blog_pub
POST
blog_list
POST
blog_recommend_list
POST
blog_detail
POST
user_blog_list
POST
blog_catalog_list
POST
评论
blog_comment_list
blog_comment_pub
blog_comment_reply
user_blog_delete
comment_list
comment_pub
comment_reply
comment_delete
收藏
favorite_list
favorite_add
favorite_remove
软件
project_detail
project_catalog_list
project_list
project_tag_list
私信
message_list
message_delete
搜索
search_list
通知
user_notice
clear_notice
OSCHINA 开放平台Beta
复制页面
一、采用
OAuth2 协议
认证
二、开放
osc 移动 app
版本所有接口
1、认证接口
2、个人信息
3、新闻
4、帖子
5、动弹
6、博客
7、评论
8、收藏
9、软件
10、私信
11、搜索
12、通知
API 使用条款
#
1、OSCHINA 用户是资源的拥有者,需尊重和保护用户的权益。
2、不能在应用中使用 OSCHINA 的名称。
3、未经用户允许,不准爬取或存储用户的资源。
4、禁止滥用 API,请求频率过快将导致请求终止。
最终解释权归 OSCHINA 所有
OAuth2 认证基本流程
#
图(2) OAuth2 获取 AccessToken 步骤说明:
(A)
:应用通过 浏览器 或 Webview 将用户引导到 OSChina
三方认证页面
上
https://www.oschina.net/action/oauth2/authorize?response_type=code&client_id=*{client_id}①*&redirect_uri=*{redirect_uri}②
*
(B)
:用户对应用进行授权
(C)
:OSChina 认证服务器 通过 回调地址(redirect_uri)将 用户授权码 传递给 应用服务器 或者直接在 Webview 中跳转到携带 用户授权码的回调地址上,Webview 直接获取code即可(
redirect_uri
?code=abc&state=xyz)
(D)
:应用服务器 或 Webview 使用
oauth2_token
API 向 OSChina 认证服务器发送 用户授权码 以及 回调地址
(E)
: OSChina 认证服务器返回 AccessToken
标注说明:
① client_id
:
应用管理
应用列表中的
应用ID
② redirect_uri
:
应用管理
应用列表中的
回调地址
应用通过 AccessToken 访问 OpenApi 使用用户数据。
Demo 应用
#
下面将介绍使用 OpenAPI 开发的两个示例应用:
开源软件信息预览 ProjectTips
OSChina.Net 博客搬家
修改于
2022-08-22 03:46:37
下一页
oauth2_authorize