Class SecurityIdentity

java.lang.Object
dev.relism.flash.ext.security.SecurityIdentity

public final class SecurityIdentity extends Object
The authenticated caller of the current request: the Principal a mechanism produced, the application user it resolves to, and the roles and scopes it holds.
  • Method Details

    • current

      public static SecurityIdentity current()
      The caller of the request this thread is handling; null when it is anonymous.
    • principal

      public Principal principal()
    • request

      public dev.relism.flash.models.Request request()
      The request being authorized. Target carries what RolesAllowed.on() names, read from path and query parameters; a RoleResolver whose scope is somewhere else — a tenant header, say — reads it from here.
    • principal

      public <P extends Principal> P principal(Class<P> type)
      The principal as type, or null when another mechanism authenticated the caller.
    • user

      public <U> U user(Class<U> type)
      The application user, resolved once per request by the configured UserResolver.
    • hasScope

      public boolean hasScope(String scope)
    • hasRole

      public boolean hasRole(String role)
    • hasRole

      public boolean hasRole(String role, Target on)