Class JerseySecurityContext

java.lang.Object
io.bdeploy.jersey.JerseySecurityContext
All Implemented Interfaces:
jakarta.ws.rs.core.SecurityContext

public class JerseySecurityContext extends Object implements jakarta.ws.rs.core.SecurityContext
A simple SecurityContext which provides information based on the authentication token used to authenticate a service call.
  • Constructor Details

  • Method Details

    • getUserPrincipal

      public Principal getUserPrincipal()
      Specified by:
      getUserPrincipal in interface jakarta.ws.rs.core.SecurityContext
    • isUserInRole

      public boolean isUserInRole(String role)
      Specified by:
      isUserInRole in interface jakarta.ws.rs.core.SecurityContext
    • isSecure

      public boolean isSecure()
      Specified by:
      isSecure in interface jakarta.ws.rs.core.SecurityContext
    • getAuthenticationScheme

      public String getAuthenticationScheme()
      Specified by:
      getAuthenticationScheme in interface jakarta.ws.rs.core.SecurityContext
    • isAuthorized

      public boolean isAuthorized(ScopedPermission scopedPermission)
      Returns a boolean indicating whether the security token grants the requested permission. Please note that the token only contains the GLOBAL permissions. When false is returned then the LOCAL permissions must also be evaluated before denying access to a given resource.
      Parameters:
      scopedPermission - the required permission
      Returns:
      true if authorized or false otherwise