Interface IdentityProvider

All Known Implementing Classes:
TrustedIdentityProvider

public interface IdentityProvider
Delivers security information about given identity that includes name and assigned roles.
  • Field Details

  • Method Details

    • getName

      String getName()
      Returns name assigned to the current context, usually refers to user name
      Returns:
      assigned name taken from security context
    • getRoles

      List<String> getRoles()
      Returns roles assigned to the current context if any
      Returns:
      list of assigned roles or empty list
    • hasRole

      boolean hasRole(String role)
      Checks if given role is assigned to current context
      Parameters:
      role - role to be checked
      Returns:
      true if the role is found otherwise null
    • isAdmin

      default boolean isAdmin()
      Checks if given identity is an admin
      Returns:
      returns true if the identity has admin rights otherwise false
    • properties

      Map<String,Object> properties()
      Returns map of additional properties that can be consumed by AccessPolicy implementations
      Returns:
      non null map of properties
    • get

      static IdentityProvider get()
      Returns currently associated IdentityProvider
      Returns:
      current identity provider
    • set

      static void set(IdentityProvider identityProvider)
    • isSet

      static boolean isSet()