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 SummaryFields Modifier and Type Field Description protected ClientModelclientprotected RealmModelrealmprotected UserModelserviceAccount
 - 
Constructor SummaryConstructors Constructor Description ClientModelIdentity(KeycloakSession session, ClientModel client)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description AttributesgetAttributes()Returns the attributes or claims associated with this identity.StringgetId()Returns the unique identifier of this identity.booleanhasClientRole(String clientId, String roleName)Indicates if this identity is granted with a client role with the givenroleName.booleanhasOneClientRole(String clientId, String... roleNames)Indicates if this identity is granted with a client role of one of the givenroleNames.booleanhasRealmRole(String roleName)Indicates if this identity is granted with a realm role with the givenroleName.
 
- 
- 
- 
Field Detail- 
realmprotected RealmModel realm 
 - 
clientprotected ClientModel client 
 - 
serviceAccountprotected UserModel serviceAccount 
 
- 
 - 
Constructor Detail- 
ClientModelIdentitypublic ClientModelIdentity(KeycloakSession session, ClientModel client) 
 
- 
 - 
Method Detail- 
getIdpublic String getId() Description copied from interface:IdentityReturns the unique identifier of this identity.
 - 
getAttributespublic Attributes getAttributes() Description copied from interface:IdentityReturns the attributes or claims associated with this identity.- Specified by:
- getAttributesin interface- Identity
- Returns:
- the attributes or claims associated with this identity
 
 - 
hasRealmRolepublic boolean hasRealmRole(String roleName) Description copied from interface:IdentityIndicates if this identity is granted with a realm role with the givenroleName.- Specified by:
- hasRealmRolein interface- Identity
- Parameters:
- roleName- the name of the role
- Returns:
- true if the identity has the given role. Otherwise, it returns false.
 
 - 
hasClientRolepublic boolean hasClientRole(String clientId, String roleName) Description copied from interface:IdentityIndicates if this identity is granted with a client role with the givenroleName.- Specified by:
- hasClientRolein 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.
 
 - 
hasOneClientRolepublic boolean hasOneClientRole(String clientId, String... roleNames) Description copied from interface:IdentityIndicates if this identity is granted with a client role of one of the givenroleNames.- Specified by:
- hasOneClientRolein interface- Identity
- Parameters:
- clientId- the client id
- roleNames- list
- Returns:
- true if the identity has any of the given roles. Otherwise, it returns false.
 
 
- 
 
-