Skip to content

Instantly share code, notes, and snippets.

@dmi3coder
Created June 3, 2020 20:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dmi3coder/5294639129f955d0486db33f035acc04 to your computer and use it in GitHub Desktop.
Save dmi3coder/5294639129f955d0486db33f035acc04 to your computer and use it in GitHub Desktop.
Example of Swagger jwt auth Application class
package net.quarkify;
import org.eclipse.microprofile.openapi.annotations.Components;
import org.eclipse.microprofile.openapi.annotations.OpenAPIDefinition;
import org.eclipse.microprofile.openapi.annotations.enums.SecuritySchemeType;
import org.eclipse.microprofile.openapi.annotations.info.Info;
import org.eclipse.microprofile.openapi.annotations.security.SecurityRequirement;
import org.eclipse.microprofile.openapi.annotations.security.SecurityScheme;
import javax.ws.rs.core.Application;
@OpenAPIDefinition(
info = @Info(
title = "Downwork API",
version = "1.0.0"
),
components = @Components(
securitySchemes = {
@SecurityScheme(
securitySchemeName = "bearerAuth",
type = SecuritySchemeType.HTTP,
scheme = "bearer",
bearerFormat = "JWT"
)
}
),
security = {
@SecurityRequirement(
name = "bearerAuth"
)
}
)
public class DownworkApplication extends Application {
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment