Interface AuthorizationProvider
- All Superinterfaces:
SecurityProvider
- All Known Implementing Classes:
AbacProvider
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Authorization security provider. Validates the request and decides whether it
should continue processing.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionauthorize(ProviderRequest context) Authorize a request based on configuration.default booleanisUserInRole(Subject subject, String role) Return true if current user is in the specified role.Methods inherited from interface SecurityProvider
supportedAnnotations, supportedAttributes, supportedConfigKeys, supportedCustomObjectsModifier and TypeMethodDescriptiondefault Collection<Class<? extends Annotation>> Provide extension annotations supported by this provider (e.g.default Collection<String> A collection of attribute names expected by this provider to override endpoint configuration.default Collection<String> Keys expected in configuration.default Collection<Class<? extends ProviderConfig>> Class of the configuration type.
-
Method Details
-
authorize
Authorize a request based on configuration. Authorization cannot be optional. If this method is called, it should always attempt to authorize the current request. This method will be invoked for inbound requests ONLY.- Parameters:
context- context of this security enforcement/validation- Returns:
- response that either permits, denies or abstains from decision
- See Also:
-
isUserInRole
Return true if current user is in the specified role. Only providers that support role based access should implement this method. For others it checks the subject for the presence ofRolegrant of the specified name. This method is defined to conform with one of the most commonly used authorization concepts, as it is required for frameworks such as Servlet and HTTP endpoint integrations.- Parameters:
subject- current subjectrole- role name- Returns:
- true if current user is in this role
-