Interface AccessControlService


public interface AccessControlService
Service for pluggable authentication and authorization.
  • Method Details

    • authenticate

      @Nonnull String[] authenticate(@Nonnull AuthenticationContext ctx) throws LoginException
      Authenticates user described by given AuthenticationContext and returns role names assigned.
      Parameters:
      ctx - authentication context
      Returns:
      array of role names assigned to authenticated user
      Throws:
      LoginException - authentication fails
    • isAccessGranted

      boolean isAccessGranted(@Nonnull AuthorizationContext ctx, @Nonnull String... assignedRoles)
      Returns true when access to resource described in the AuthorizationContext should be granted to assigned roles. The role names are typically the ones returned by the authenticate(AuthenticationContext) method call.
      Parameters:
      ctx - authorization context
      assignedRoles - role names to be checked for access to the resource
      Returns:
      true when the access is granted