Forum Discussion

KF4UYC's avatar
KF4UYC
New Contributor
9 months ago

Authorization Tag For Basic BASE64 Encoding

According to the 3.x documentation, I should be able to set global security authentication using the Authorization Object: Basic authentication is a simple authentication scheme built into the HTTP...
  • frankkilcommins's avatar
    9 months ago

    Hi KF4UYC

    You can indeed configure an OpenAPI description to mandate BASE64 auth.

    First, add a `basic` security scheme to the components object

    components:
      securitySchemes:
        basicAuth:
          type: http
          scheme: basic

    Next, add a security section to apply the scheme to all API paths

    security:
      - basicAuth: []

    Once done, if you you can 'authorize' (enter username / pw) via Swagger UI

    I've put together a very simple API to showcase at: Simple API with Basic Auth

    If possible, I'd move onto something more robust that basic auth, but I'm assuming your constrained by the vendor in this case.