microservices-single-swagger
microservices-single-swagger copied to clipboard
How to add authorization header
I want to add authorization header to all microservices. Which will be intercepted at Gateway Proxy level.
I can do this using following piece of code without aggregation.
@Bean
public Docket api() {
return new Docket(DocumentationType.SWAGGER_2)
.select()
.apis(RequestHandlerSelectors.any())
.paths(PathSelectors.any()).build().pathMapping("")
.securitySchemes(Arrays.asList(apiKey()));
}
private ApiKey apiKey() {
return new ApiKey("authkey", "Authorization", "header");
}
But when I use public class SwaggerAggregatorController implements SwaggerResourcesProvider {
the authorization button does not show up on the UI.