-
Notifications
You must be signed in to change notification settings - Fork 228
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Authorization on Swagger UI #2911
Comments
I believe this is covered in the docs here: https://elide.io/pages/guide/v4/13-swagger.html#supporting-oauth |
Thanks. Now after adding the code as per the docs, the Authorize button is now enabled but all my JSON api endpoints disappear. See the "No operations in Spec!" part in the screenshot. My code: @Bean
public SwaggerController.SwaggerRegistrations buildSwagger2(EntityDictionary dictionary, ElideConfigProperties settings) {
Info info = new Info()
.title(settings.getSwagger().getName())
.version(settings.getSwagger().getVersion());
SwaggerBuilder builder = new SwaggerBuilder(dictionary, info);
Swagger swagger = builder.build()
.basePath(settings.getJsonApi().getPath())
.securityDefinition("JWT Token", new ApiKeyAuthDefinition("Authorization", In.HEADER))
.scheme(Scheme.HTTP);
return new SwaggerController.SwaggerRegistrations(swagger);
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The bundled Swagger UI does not give an option to authorize requests. Usually, Swagger presents an
Authorize
button when any request is sequred (as shown in the screenshot below).When I use Elide Spring Boot starter, and I secure my endpoints, the Swagger UI doesn't present any option to add JWT token.
I've also tried adding the 'Authorization' header for every path as follows:
Nothing works.
The text was updated successfully, but these errors were encountered: