Annotation Type SecurityRequirement
-
@Target({METHOD,TYPE,ANNOTATION_TYPE}) @Retention(RUNTIME) @Repeatable(SecurityRequirements.class) @Inherited public @interface SecurityRequirement
The annotation may be applied at class or method level, or inOperation.security()to define security requirements for the single operation (when applied at method level) or for all operations of a class (when applied at class level).It can also be used in
OpenAPIDefinition.security()to define spec level security.combine()can be used to define multiple security requirements at the same time, requiring each one of them. If only one of multiple security schemes is required, use multipleSecurityRequirementannotations.
-
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description SecurityRequirementEntry[]combineStringnameThis name must correspond to a declared SecurityRequirement.String[]scopesIf the security scheme is of type "oauth2" or "openIdConnect", then the value is a list of scope names required for the execution.
-
-
-
-
scopes
String[] scopes
If the security scheme is of type "oauth2" or "openIdConnect", then the value is a list of scope names required for the execution. For other security scheme types, the array must be empty.- Returns:
- String array of scopes
- Default:
- {}
-
-
-
combine
SecurityRequirementEntry[] combine
If multiple requirements apply at the same time, use this value instead ofname()andscopes(). If any one of multiple security schemes is required, use multipleSecurityRequirementannotations instead.Exactly one of this and
name()must be set.- Returns:
- SecurityRequirementEntry array of requirements
- Default:
- {}
-
-