Closed
Description
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:
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!