OpenAPI 规范 v3.1.0
OpenAPI 规范 v3.1.0
1. OpenAPI 规范
2. 简介
3. 定义
4. 规范
4.1 版本
4.2 格式
4.3 文档结构
4.4 数据类型
4.5 富文本格式化
4.6 URI 中的相对引用
4.7 URL 中的相对引用
4.8 模式
4.9 规范扩展
4.10 安全过滤
4.8.29 OAuth Flow 对象
创建时间: 2025-05-29 16:38

支持的OAuth流程的配置详细信息

4.8.29.1 固定字段
字段名称类型应用于描述
授权URL字符串oauth2 ("implicit""authorizationCode")必需。要用于此流程的授权URL。这必须采用URL的形式。OAuth2标准要求使用TLS。
令牌URL字符串oauth2 ("password""clientCredentials""authorizationCode")必需。要用于此流程的令牌URL。这必须采用URL的形式。OAuth2标准要求使用TLS。
刷新URL字符串oauth2用于获取刷新令牌的URL。这必须采用URL的形式。OAuth2标准要求使用TLS。
范围Map[stringstring]oauth2必需。OAuth2安全方案的可用范围。范围名称与其简短描述之间的映射。该映射可以为空。

此对象*可以使用 规范扩展 进行扩展。

4.8.29.2 OAuth Flow 对象示例
{
  "type": "oauth2",
  "flows": {
    "implicit": {
      "authorizationUrl": "https://example.com/api/oauth/dialog",
      "scopes": {
        "write:pets": "modify pets in your account",
        "read:pets": "read your pets"
      }
    },
    "authorizationCode": {
      "authorizationUrl": "https://example.com/api/oauth/dialog",
      "tokenUrl": "https://example.com/api/oauth/token",
      "scopes": {
        "write:pets": "modify pets in your account",
        "read:pets": "read your pets"
      }
    }
  }
}
type: oauth2
flows:
  implicit:
    authorizationUrl: https://example.com/api/oauth/dialog
    scopes:
      write:pets: modify pets in your account
      read:pets: read your pets
  authorizationCode:
    authorizationUrl: https://example.com/api/oauth/dialog
    tokenUrl: https://example.com/api/oauth/token
    scopes:
      write:pets: modify pets in your account
      read:pets: read your pets
最后更新: -