Forum Discussion

NadChel's avatar
New Member
6 months ago

Enabling "Authorize" button

How do I enable the "Authorize" button in Swagger UI? I got it all set up, but if the endpoints require authentication, it's not going to work straight from the UI. I need to be able to pass tokens as `Authorization` header values

Do I need to pass some yml property? I have a Java app

Should I write something here?


@OpenAPIDefinition(info = info(version = "1.0", title = "Hello World API"), security = @SecurityRequirement(name = "/* here */"))
public class HelloworldMreApplication {

public static void main(String[] args) {, args);



I tried this:


@Tag(name = "Message Controller")
@SecurityScheme(type = SecuritySchemeType.HTTP, name = "basicAuth")
public class MessageController {


// ...


I got the button, but it's not useful. Once I click on it, I get a popup that says "Available authorizations" and that's it

A more verbose variation produced the same result

@SecurityScheme(type = SecuritySchemeType.HTTP, name = "basicAuth",
description = "authorization with JWT token", scheme = "token",
bearerFormat = "bearer")


No RepliesBe the first to reply