Package io.bdeploy.jersey
Class JerseySecurityContext
java.lang.Object
io.bdeploy.jersey.JerseySecurityContext
- All Implemented Interfaces:
jakarta.ws.rs.core.SecurityContext
A simple
SecurityContext which provides information based on the
authentication token used to authenticate a service call.-
Field Summary
Fields inherited from interface jakarta.ws.rs.core.SecurityContext
BASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanisAuthorized(ScopedPermission scopedPermission) Returns a boolean indicating whether the security token grants the requested permission.booleanisSecure()booleanisUserInRole(String role)
-
Constructor Details
-
JerseySecurityContext
-
-
Method Details
-
getUserPrincipal
- Specified by:
getUserPrincipalin interfacejakarta.ws.rs.core.SecurityContext
-
isUserInRole
- Specified by:
isUserInRolein interfacejakarta.ws.rs.core.SecurityContext
-
isSecure
public boolean isSecure()- Specified by:
isSecurein interfacejakarta.ws.rs.core.SecurityContext
-
getAuthenticationScheme
- Specified by:
getAuthenticationSchemein interfacejakarta.ws.rs.core.SecurityContext
-
isAuthorized
Returns a boolean indicating whether the security token grants the requested permission. Please note that the token only contains the GLOBAL permissions. Whenfalseis returned then the LOCAL permissions must also be evaluated before denying access to a given resource.- Parameters:
scopedPermission- the required permission- Returns:
trueif authorized orfalseotherwise
-