Top Description Methods
org.eclipse.microprofile.openapi.annotations.security

public @Interface SecurityScheme

extends Annotation
Annotations
@Target:METHOD, TYPE
@Retention:RUNTIME
@Repeatable:SecuritySchemes
@Inherited
Imports
java.lang.annotation.ElementType, .Inherited, .Repeatable, .Retention, .RetentionPolicy, .Target, org.eclipse.microprofile.openapi.annotations.enums.SecuritySchemeIn, .SecuritySchemeType, org.eclipse.microprofile.openapi.annotations.extensions.Extension

Defines a security scheme that can be used by the operations. Supported schemes are HTTP authentication, an API key (either as a header or as a query parameter), OAuth2's common flows (implicit, password, application and access code) as defined in RFC6749, and OpenID Connect Discovery.
See Also
OpenAPI Specification Security Scheme Object

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

the name of this apiKey type SecurityScheme instance
apiKeyName
()

Applies to and is REQUIRED for SecurityScheme of apiKey type.

public String

Returns:

the format of the bearer token
bearerFormat
()

Applies to http ("bearer") type.

public String

Returns:

description of this SecurityScheme instance
description
()

A short description for security scheme.

public Extension[]

Returns:

array of extensions
extensions
()

List of extensions to be added to the SecurityScheme model corresponding to the containing annotation.

public OAuthFlows

Returns:

flow types supported by this SecurityScheme instance
flows
()

Applies to and is REQUIRED for SecurityScheme of oauth2 type.

public SecuritySchemeIn

Returns:

the location of the API key
in
()

Applies to and is REQUIRED for SecurityScheme of apiKey type.

public String

Returns:

URL where OAuth2 configuration values are stored
openIdConnectUrl
()

Applies to and is REQUIRED for SecurityScheme of openIdConnect type.

public String

Returns:

reference to a security scheme
ref
()

Reference value to a SecurityScheme object.

public String

Returns:

the name of the HTTP Authorization scheme
scheme
()

Applies to and is REQUIRED for SecurityScheme of http type.

public String

Returns:

the name of this SecurityScheme instance
securitySchemeName
()

The name of this SecurityScheme.

public SecuritySchemeType

Returns:

the type of this SecuirtyScheme instance
type
()

The type of the security scheme.

Inherited from java.lang.annotation.Annotation:
annotationTypeequalshashCodetoString

Method Detail

apiKeyNameback to summary
public String apiKeyName()

Applies to and is REQUIRED for SecurityScheme of apiKey type.

The name of the header, query or cookie parameter to be used.

Returns:String

the name of this apiKey type SecurityScheme instance

bearerFormatback to summary
public String bearerFormat()

Applies to http ("bearer") type.

A hint to the client to identify how the bearer token is formatted. Bearer tokens are usually generated by an authorization server, so this information is primarily for documentation purposes.

Returns:String

the format of the bearer token

descriptionback to summary
public String description()

A short description for security scheme. CommonMark syntax can be used for rich text representation.

Returns:String

description of this SecurityScheme instance

extensionsback to summary
public Extension[] extensions()

List of extensions to be added to the SecurityScheme model corresponding to the containing annotation.

Returns:Extension[]

array of extensions

Since
3.1
flowsback to summary
public OAuthFlows flows()

Applies to and is REQUIRED for SecurityScheme of oauth2 type.

An object containing configuration information for the flow types supported.

Returns:OAuthFlows

flow types supported by this SecurityScheme instance

inback to summary
public SecuritySchemeIn in()

Applies to and is REQUIRED for SecurityScheme of apiKey type.

The location of the API key. Valid values are defined by SecuritySchemeIn enum. Ignored when empty string.

Returns:SecuritySchemeIn

the location of the API key

openIdConnectUrlback to summary
public String openIdConnectUrl()

Applies to and is REQUIRED for SecurityScheme of openIdConnect type.

OpenId Connect URL to discover OAuth2 configuration values. This MUST be in the form of a URL.

Returns:String

URL where OAuth2 configuration values are stored

refback to summary
public String ref()

Reference value to a SecurityScheme object.

This property provides a reference to an object defined elsewhere. This property may be used with description() but is mutually exclusive with all other properties. If properties other than description are defined in addition to the ref property then the result is undefined.

Returns:String

reference to a security scheme

schemeback to summary
public String scheme()

Applies to and is REQUIRED for SecurityScheme of http type.

The name of the HTTP Authorization scheme to be used in the Authorization header as defined in RFC 7235.

Returns:String

the name of the HTTP Authorization scheme

securitySchemeNameback to summary
public String securitySchemeName()

The name of this SecurityScheme. Used as the key to add this security scheme to the 'securitySchemes' map under Components object.

It is a REQUIRED property unless this is only a reference to a security scheme instance.

Returns:String

the name of this SecurityScheme instance

typeback to summary
public SecuritySchemeType type()

The type of the security scheme. Valid values are defined by SecuritySchemeType enum. Ignored when empty string.

Type is a REQUIRED property unless this is only a reference to a SecuirtyScheme instance.

Returns:SecuritySchemeType

the type of this SecuirtyScheme instance