Add provision to mention Authorization Header using `SwaggerResourcesProvider`
See original GitHub issueWhat version of the library are you using? Is it the latest version?
Maven SpringFox 2.6.1
What kind of issue is this?
- Question.
- Bug
- Feature Request
Question details
I’ve created a Gateway Proxy using Zuul. Gateway passes these requests to other microservices. I’ve aggregated swagger documents from all microservices on gateway proxy.
@Component
@Primary
@EnableAutoConfiguration
public class SwaggerAggregatorController implements SwaggerResourcesProvider {
@Override
public List<SwaggerResource> get() {
List<SwaggerResource> resources= new ArrayList<>();
SwaggerResource cstSwagger = new SwaggerResource();
cstSwagger.setName("cust-service");
cstSwagger.setLocation("/cust/cust-service/v2/api-docs");
cstSwagger.setSwaggerVersion("2.0");
resources.add(cstSwagger);
return resources;
}
}
Now this works but on Swagger UI there’s no way I can specify authorization header in format bearer: <token>
.
How can I add provision to specify authorization header for all the requests?
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Add an authorization header to your swagger-ui with ...
Just over a year ago I blogged a simple way to add an authorization header to your swagger-ui with Swashbuckle. Although that works,...
Read more >Springfox Reference Documentation - GitHub Pages
For OpenAPI add the springfox-oas library dependency (for swagger 2.0 use ... This prefixes paths with the provided path mapping.
Read more >HTTP authentication - MDN Web Docs - Mozilla
A client that wants to authenticate itself with the server can then do so by including an Authorization request header with the credentials....
Read more >Custom Headers for Credentials - Salesforce Help
You can add custom headers to named credentials and external credentials. Custom headers are a way for a remote system to define parameters...
Read more >Solved: 'Authorization' header is not allowed. Use 'API Ke...
Use 'API Key' authentication type in the Security tab to set this header. ... HTTP header", where the Header Name = Authorization and...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
The login form puts the token in the cookies that is later used to protect the swagger ui page
It should use the credentials from the browser. Thats how jhipster does it. Take a look at that project.