Skip to content

Add bearer auth scheme as the default security scheme #4386

@jannyHou

Description

@jannyHou

Suggestion

After story #4380 finished, we can add a security spec enhancer to have the bearer auth scheme as the default(or built-in) security scheme. So that explorer has the authorization dialog for people to inject the token per request.

Use Cases

Add an OAI enhancer that add the following spec into OpenAPI spec generated in the rest server:

"components": {
    "securitySchemes": {
      "jwt": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      }
    },

Examples

See the screenshot in https://loopback.io/doc/en/lb4/Authentication-Tutorial.html#specifying-the-security-settings-in-the-openapi-specification

Acceptance criteria

  • add a security spec enhancer to have the bearer auth scheme as the default(or built-in) security scheme

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions