Class ClientModelIdentity
java.lang.Object
org.keycloak.authorization.common.ClientModelIdentity
- All Implemented Interfaces:
Identity
- Version:
- $Revision: 1 $
- Author:
- Bill Burke
-
Field Summary
Modifier and TypeFieldDescriptionprotected final ClientModel
protected final RealmModel
protected final UserModel
protected final AccessToken
-
Constructor Summary
ConstructorDescriptionClientModelIdentity
(KeycloakSession session, ClientModel client) ClientModelIdentity
(KeycloakSession session, ClientModel client, AccessToken token) -
Method Summary
Modifier and TypeMethodDescriptionReturns the attributes or claims associated with this identity.getId()
Returns the unique identifier of this identity.boolean
hasClientRole
(String clientId, String roleName) Indicates if this identity is granted with a client role with the givenroleName
.boolean
hasOneClientRole
(String clientId, String... roleNames) Indicates if this identity is granted with a client role of one of the givenroleNames
.boolean
hasRealmRole
(String roleName) Indicates if this identity is granted with a realm role with the givenroleName
.
-
Field Details
-
realm
-
client
-
serviceAccount
-
token
-
-
Constructor Details
-
ClientModelIdentity
-
ClientModelIdentity
-
-
Method Details
-
getId
Description copied from interface:Identity
Returns the unique identifier of this identity. -
getAttributes
Description copied from interface:Identity
Returns the attributes or claims associated with this identity.- Specified by:
getAttributes
in interfaceIdentity
- Returns:
- the attributes or claims associated with this identity
-
hasRealmRole
Description copied from interface:Identity
Indicates if this identity is granted with a realm role with the givenroleName
.- Specified by:
hasRealmRole
in interfaceIdentity
- Parameters:
roleName
- the name of the role- Returns:
- true if the identity has the given role. Otherwise, it returns false.
-
hasClientRole
Description copied from interface:Identity
Indicates if this identity is granted with a client role with the givenroleName
.- Specified by:
hasClientRole
in interfaceIdentity
- Parameters:
clientId
- the client idroleName
- the name of the role- Returns:
- true if the identity has the given role. Otherwise, it returns false.
-
hasOneClientRole
Description copied from interface:Identity
Indicates if this identity is granted with a client role of one of the givenroleNames
.- Specified by:
hasOneClientRole
in interfaceIdentity
- Parameters:
clientId
- the client idroleNames
- list- Returns:
- true if the identity has any of the given roles. Otherwise, it returns false.
-