Class ClientModelIdentity

java.lang.Object
org.keycloak.authorization.common.ClientModelIdentity
All Implemented Interfaces:
Identity

public class ClientModelIdentity extends Object implements Identity
Version:
$Revision: 1 $
Author:
Bill Burke
  • Field Details

  • Constructor Details

  • Method Details

    • getId

      public String getId()
      Description copied from interface: Identity
      Returns the unique identifier of this identity.
      Specified by:
      getId in interface Identity
      Returns:
      the unique identifier of this identity
    • getAttributes

      public Attributes getAttributes()
      Description copied from interface: Identity
      Returns the attributes or claims associated with this identity.
      Specified by:
      getAttributes in interface Identity
      Returns:
      the attributes or claims associated with this identity
    • hasRealmRole

      public boolean hasRealmRole(String roleName)
      Description copied from interface: Identity
      Indicates if this identity is granted with a realm role with the given roleName.
      Specified by:
      hasRealmRole in interface Identity
      Parameters:
      roleName - the name of the role
      Returns:
      true if the identity has the given role. Otherwise, it returns false.
    • hasClientRole

      public boolean hasClientRole(String clientId, String roleName)
      Description copied from interface: Identity
      Indicates if this identity is granted with a client role with the given roleName.
      Specified by:
      hasClientRole in interface Identity
      Parameters:
      clientId - the client id
      roleName - the name of the role
      Returns:
      true if the identity has the given role. Otherwise, it returns false.
    • hasOneClientRole

      public boolean hasOneClientRole(String clientId, String... roleNames)
      Description copied from interface: Identity
      Indicates if this identity is granted with a client role of one of the given roleNames.
      Specified by:
      hasOneClientRole in interface Identity
      Parameters:
      clientId - the client id
      roleNames - list
      Returns:
      true if the identity has any of the given roles. Otherwise, it returns false.