Interface Identity
- 
- All Known Implementing Classes:
- ClientModelIdentity,- KeycloakIdentity,- UserModelIdentity
 
 public interface IdentityRepresents a security identity, which can be a person or non-person entity that was previously authenticated. An Identityplays an important role during the evaluation of policies as they represent the entity to which one or more permissions should be granted or not, providing additional information and attributes that can be relevant to the different access control methods involved during the evaluation of policies.- Author:
- Pedro Igor
 
- 
- 
Method SummaryAll Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description AttributesgetAttributes()Returns the attributes or claims associated with this identity.StringgetId()Returns the unique identifier of this identity.default booleanhasClientRole(String clientId, String roleName)Indicates if this identity is granted with a client role with the givenroleName.default booleanhasOneClientRole(String clientId, String... roleNames)Indicates if this identity is granted with a client role of one of the givenroleNames.default booleanhasRealmRole(String roleName)Indicates if this identity is granted with a realm role with the givenroleName.
 
- 
- 
- 
Method Detail- 
getIdString getId() Returns the unique identifier of this identity.- Returns:
- the unique identifier of this identity
 
 - 
getAttributesAttributes getAttributes() Returns the attributes or claims associated with this identity.- Returns:
- the attributes or claims associated with this identity
 
 - 
hasRealmRoledefault boolean hasRealmRole(String roleName) Indicates if this identity is granted with a realm role with the givenroleName.- Parameters:
- roleName- the name of the role
- Returns:
- true if the identity has the given role. Otherwise, it returns false.
 
 - 
hasClientRoledefault boolean hasClientRole(String clientId, String roleName) Indicates if this identity is granted with a client role with the givenroleName.- Parameters:
- clientId- the client id
- roleName- the name of the role
- Returns:
- true if the identity has the given role. Otherwise, it returns false.
 
 - 
hasOneClientRoledefault boolean hasOneClientRole(String clientId, String... roleNames) Indicates if this identity is granted with a client role of one of the givenroleNames.- Parameters:
- clientId- the client id
- roleNames- list
- Returns:
- true if the identity has any of the given roles. Otherwise, it returns false.
 
 
- 
 
-