Skip to content

authorization header didn't exist in requests #49

Closed
@okosiuta

Description

@okosiuta

Hi,
I tried to add the bearer token to all my swagger's UI requests in the next way:

@Bean
    public OpenAPI customOpenAPI() {
        return new OpenAPI().components(new Components()
                .addSecuritySchemes("BEARER KEY", new SecurityScheme().type(SecurityScheme.Type.HTTP)
                        .scheme("bearer").in(SecurityScheme.In.HEADER)));
    }

Then after my application started I pass the bearer token into an authentication form with swagger UI:

Bearer

Actual result:

curl -X GET "http://localhost:8080/api/v1/contacts/employees?query=name" -H "accept: */*"

Bearer token didn't exist in the request.

Expected result:

curl -X GET "http://localhost:8080/api/v1/contacts/employees?query=name" -H "accept: */*" -H "Authorization: Bearer ***********"

Bearer token exists in the request.

Could you please clarify, what I'm doing wrong?
Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions