Firebase身份验证安全性方案的Swagger OpenAPI 3文档

xytpbqjk  于 2022-11-06  发布在  其他
关注(0)|答案(1)|浏览(105)

使用oauth 2.0和OpenAPI 3.0格式化Firebase安全方案的正确方法是什么?
https://cloud.google.com/endpoints/docs/openapi/authenticating-users-firebase上的当前文档适用于OpenAPI 2.0,而不是OpenAPI 3.0。
我在https://swagger.io/docs/specification/authentication/上查看了OpenAPI 3.0的swagger文档,在Swagger definition for firebase authentication上也遇到了类似的问题,但同样,建议的答案指向OpenAPI 2.0,而不是3.0

siv3szwd

siv3szwd1#

components:
  securitySchemes:
    firebase:
      type: "oauth2"
      flows:
        implicit:
          authorizationUrl: ""
          scopes:
            read: Grants read access
            write: Grants write access
            admin: Grants access to admin operations
      # Replace YOUR-PROJECT-ID with your project ID
      x-google-issuer: "https://securetoken.google.com/YOUR-PROJECT-ID"
      x-google-jwks_uri: "https://www.googleapis.com/service_accounts/v1/metadata/x509/securetoken@system.gserviceaccount.com"
      x-google-audiences: "YOUR-PROJECT-ID"

security:
  - firebase: [ ]

相关问题