Class SecurityService

java.lang.Object
org.damap.base.security.SecurityService

@ApplicationScoped public class SecurityService extends Object
SecurityService class.
  • Constructor Details

    • SecurityService

      public SecurityService()
  • Method Details

    • getUserId

      public String getUserId()
      getUserId.
      Returns:
      a String object
    • getUserName

      public String getUserName()
      getUserName.
      Returns:
      a String object
    • getDisplayName

      public String getDisplayName()
    • isAdmin

      public boolean isAdmin()
      isAdmin.
      Returns:
      a boolean
    • validateAuthHeader

      public org.eclipse.microprofile.jwt.JsonWebToken validateAuthHeader(jakarta.ws.rs.core.HttpHeaders headers)
      Validates a JWT token from the X-Auth header.
      Parameters:
      headers - HttpHeaders containing the Authorization token.
      Returns:
      JsonWebToken if valid, null otherwise.
    • checkIfUserIsAuthorized

      public org.eclipse.microprofile.jwt.JsonWebToken checkIfUserIsAuthorized(jakarta.ws.rs.core.HttpHeaders headers)
      Checks if the user is authorized based on the JWT token.
      Parameters:
      headers - HttpHeaders containing the Authorization token.
      Returns:
      JsonWebToken if the user is authorized.