Package org.keycloak.models.light
Class LightweightUserAdapter
java.lang.Object
org.keycloak.models.UserModelDefaultMethods
org.keycloak.storage.adapter.AbstractInMemoryUserAdapter
org.keycloak.models.light.LightweightUserAdapter
- All Implemented Interfaces:
RoleMapperModel
,UserModel
- Author:
- hmlnarik
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.keycloak.models.UserModel
UserModel.RequiredAction, UserModel.UserPreRemovedEvent, UserModel.UserRemovedEvent
-
Field Summary
Fields inherited from class org.keycloak.storage.adapter.AbstractInMemoryUserAdapter
id, realm, session
Fields inherited from interface org.keycloak.models.UserModel
COMPARE_BY_USERNAME, DISABLED_REASON, EMAIL, EMAIL_VERIFIED, ENABLED, EXACT, FIRST_NAME, GROUPS, IDP_ALIAS, IDP_USER_ID, INCLUDE_SERVICE_ACCOUNT, LAST_NAME, LOCALE, SEARCH, USERNAME
-
Constructor Summary
ModifierConstructorDescriptionprotected
LightweightUserAdapter
(KeycloakSession session, String id) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addConsent
(UserConsentModel consent) void
void
addRequiredAction
(String action) void
Instance of a user credential manager to validate and update the credentials of this user.void
deleteRoleMapping
(RoleModel role) Removes the given role mapping from this object.static LightweightUserAdapter
fromString
(KeycloakSession session, RealmModel realm, String serializedForm) getConsentByClient
(String clientInternalId) static String
void
Grants the given role to this object.static boolean
static boolean
isLightweightUser
(UserModel user) void
joinGroup
(GroupModel group) void
leaveGroup
(GroupModel group) void
removeAttribute
(String name) void
removeRequiredAction
(String action) void
boolean
revokeConsentForClient
(String clientInternalId) void
setAttribute
(String name, List<String> values) void
setCreatedTimestamp
(Long timestamp) void
setEmailVerified
(boolean verified) void
setEnabled
(boolean enabled) void
setFederationLink
(String link) void
void
setReadonly
(boolean flag) void
setServiceAccountClientLink
(String clientInternalId) void
setSingleAttribute
(String name, String value) Set single value of specified attribute.void
setUpdateHandler
(Consumer<LightweightUserAdapter> updateHandler) void
setUsername
(String username) Sets username for this user.void
updateConsent
(UserConsentModel consent) Methods inherited from class org.keycloak.storage.adapter.AbstractInMemoryUserAdapter
checkReadonly, equals, getAttributes, getAttributeStream, getClientRoleMappingsStream, getCreatedTimestamp, getFederationLink, getFirstAttribute, getGroupsStream, getId, getRealmRoleMappingsStream, getRequiredActionsStream, getRoleMappingsStream, getServiceAccountClientLink, getUsername, hashCode, hasRole, isEmailVerified, isEnabled, isMemberOf
Methods inherited from class org.keycloak.models.UserModelDefaultMethods
getEmail, getFirstName, getLastName, setEmail, setFirstName, setLastName, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.keycloak.models.RoleMapperModel
hasDirectRole
Methods inherited from interface org.keycloak.models.UserModel
getGroupsCount, getGroupsCountByNameContaining, getGroupsStream, isFederated, joinGroup
-
Field Details
-
ID_PREFIX
- See Also:
-
-
Constructor Details
-
LightweightUserAdapter
-
LightweightUserAdapter
protected LightweightUserAdapter()
-
-
Method Details
-
isLightweightUser
-
isLightweightUser
-
getLightweightUserId
-
setOwningUserSessionId
-
fromString
public static LightweightUserAdapter fromString(KeycloakSession session, RealmModel realm, String serializedForm) -
credentialManager
Description copied from interface:UserModel
Instance of a user credential manager to validate and update the credentials of this user. -
serialize
-
deleteRoleMapping
Description copied from interface:RoleMapperModel
Removes the given role mapping from this object.- Specified by:
deleteRoleMapping
in interfaceRoleMapperModel
- Overrides:
deleteRoleMapping
in classAbstractInMemoryUserAdapter
- Parameters:
role
- Role to remove
-
grantRole
Description copied from interface:RoleMapperModel
Grants the given role to this object.- Specified by:
grantRole
in interfaceRoleMapperModel
- Overrides:
grantRole
in classAbstractInMemoryUserAdapter
-
setServiceAccountClientLink
- Specified by:
setServiceAccountClientLink
in interfaceUserModel
- Overrides:
setServiceAccountClientLink
in classAbstractInMemoryUserAdapter
-
setFederationLink
- Specified by:
setFederationLink
in interfaceUserModel
- Overrides:
setFederationLink
in classAbstractInMemoryUserAdapter
-
leaveGroup
- Specified by:
leaveGroup
in interfaceUserModel
- Overrides:
leaveGroup
in classAbstractInMemoryUserAdapter
-
joinGroup
- Specified by:
joinGroup
in interfaceUserModel
- Overrides:
joinGroup
in classAbstractInMemoryUserAdapter
-
setEmailVerified
public void setEmailVerified(boolean verified) - Specified by:
setEmailVerified
in interfaceUserModel
- Overrides:
setEmailVerified
in classAbstractInMemoryUserAdapter
-
removeRequiredAction
- Specified by:
removeRequiredAction
in interfaceUserModel
- Overrides:
removeRequiredAction
in classAbstractInMemoryUserAdapter
-
addRequiredAction
- Specified by:
addRequiredAction
in interfaceUserModel
- Overrides:
addRequiredAction
in classAbstractInMemoryUserAdapter
-
removeRequiredAction
- Specified by:
removeRequiredAction
in interfaceUserModel
- Overrides:
removeRequiredAction
in classAbstractInMemoryUserAdapter
-
addRequiredAction
- Specified by:
addRequiredAction
in interfaceUserModel
- Overrides:
addRequiredAction
in classAbstractInMemoryUserAdapter
-
removeAttribute
- Specified by:
removeAttribute
in interfaceUserModel
- Overrides:
removeAttribute
in classAbstractInMemoryUserAdapter
-
setAttribute
- Specified by:
setAttribute
in interfaceUserModel
- Overrides:
setAttribute
in classAbstractInMemoryUserAdapter
-
setSingleAttribute
Description copied from interface:UserModel
Set single value of specified attribute. Remove all other existing values of this attribute- Specified by:
setSingleAttribute
in interfaceUserModel
- Overrides:
setSingleAttribute
in classAbstractInMemoryUserAdapter
-
setEnabled
public void setEnabled(boolean enabled) - Specified by:
setEnabled
in interfaceUserModel
- Overrides:
setEnabled
in classAbstractInMemoryUserAdapter
-
setCreatedTimestamp
- Specified by:
setCreatedTimestamp
in interfaceUserModel
- Overrides:
setCreatedTimestamp
in classAbstractInMemoryUserAdapter
-
setReadonly
public void setReadonly(boolean flag) - Overrides:
setReadonly
in classAbstractInMemoryUserAdapter
-
addDefaults
public void addDefaults()- Overrides:
addDefaults
in classAbstractInMemoryUserAdapter
-
setUsername
Description copied from interface:UserModel
Sets username for this user. No default method here to allow Abstract subclasses where the username is provided in a different manner- Specified by:
setUsername
in interfaceUserModel
- Overrides:
setUsername
in classAbstractInMemoryUserAdapter
- Parameters:
username
- username string
-
setUpdateHandler
-
addConsent
-
getConsentByClient
-
revokeConsentForClient
-
updateConsent
-
getConsentsStream
-