core icon indicating copy to clipboard operation
core copied to clipboard

Feature: Add Support for HTTP Authentication (HTTP Basic, Bearer)

Open toitzi opened this issue 1 year ago • 0 comments

Description
As discussed in #6661 there is currently no support for Swaggers HTTP Auth Mechanism, more specifically for Basic Authentication and Bearer Authentication. Especially in Laravel (where the default goto for API Authentication usually is Laravel Scout), it can be useful to have the option to add a bearer token and authorize requests in the swagger ui.

Example
Possible configuration option:

'swagger_ui' => [
    'enabled' => true,
    'http_auth' => [
        'Personal Access Token' => [
            'scheme' => 'bearer', // or "basic"
            'bearerFormat' => 'JWT',
        ],
    ],
]

Here is what that would look like in the Swagger UI:

image

toitzi avatar Sep 23 '24 11:09 toitzi