It is not able to get those header parameter which microservice-B is trying to fetch.
Swagger
on its own can't call the authenticator service and add the obtained token to another request's header.
You can modify the Docket
object to accept additional parameter in header as below:
docket.globalOperationParameters(
Collections.singletonList(new ParameterBuilder()
.name("Authorization")
.description("Bearer [token]")
.modelRef(new ModelRef("string"))
.parameterType("string")
.required(true)
.build()
)
);
This will allow Swagger UI to show additional field to accept token (see image below). You need to obtain the token by yourself and can put in this field.
Hope this helps.