OAuth2 是一种授权框架,允许第三方应用代表用户获取对特定资源的访问权限。以下是我们提供的 OAuth2 接口文档。
接口说明
- 接口路径:
/api/oauth2/token
- 请求方法:
POST
- 参数说明:
grant_type
:授权类型,例如 "authorization_code"、"client_credentials" 等。client_id
:客户端 ID。client_secret
:客户端密钥。redirect_uri
:重定向 URI。code
:授权码(当grant_type
为 "authorization_code" 时必填)。
使用示例
POST /api/oauth2/token
Content-Type: application/x-www-form-urlencoded
grant_type=authorization_code
&client_id=your_client_id
&client_secret=your_client_secret
&redirect_uri=http://your-redirect-uri.com
&code=your_authorization_code
返回示例
{
"access_token": "your_access_token",
"token_type": "Bearer",
"expires_in": 3600,
"refresh_token": "your_refresh_token"
}
其他资源
如果您需要更多关于 OAuth2 的信息,请访问我们的 OAuth2 教程。