Package org.keycloak.userprofile
Class ServiceAccountAttributes
java.lang.Object
java.util.AbstractMap<K,V>
java.util.HashMap<String,List<String>>
org.keycloak.userprofile.DefaultAttributes
org.keycloak.userprofile.ServiceAccountAttributes
- All Implemented Interfaces:
Serializable
,Cloneable
,Map<String,
,List<String>> Attributes
A specific Attributes
implementation to handle service accounts.
Service accounts are not regular users, and it should be possible to manage unmanaged attributes but only when
operating through the UserProfileContext.USER_API
. Otherwise, administrators will be forced to enable unmanaged
attributes by setting a UPConfig.UnmanagedAttributePolicy
or
end up defining managed attributes that are specific for service accounts in the user profile configuration, which is
mainly targeted for regular users.
- Author:
- Pedro Igor
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K extends Object,
V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object, V extends Object> -
Field Summary
Fields inherited from class org.keycloak.userprofile.DefaultAttributes
context, DEFAULT_MAX_LENGTH_ATTRIBUTES, READ_ONLY_ATTRIBUTE_KEY, session, user
Fields inherited from interface org.keycloak.userprofile.Attributes
EMPTY_VALUE
-
Constructor Summary
ConstructorDescriptionServiceAccountAttributes
(UserProfileContext context, Map<String, ?> attributes, UserModel user, UserProfileMetadata profileMetadata, KeycloakSession session) -
Method Summary
Modifier and TypeMethodDescriptionprotected AttributeMetadata
protected boolean
boolean
isReadOnly
(String name) Checks whether an attribute is read-only.protected void
Methods inherited from class org.keycloak.userprofile.DefaultAttributes
addDefaultValidators, contains, createAttributeContext, get, getMetadata, getReadable, getUnmanagedAttributes, getWritable, isIncludeAttributeIfNotProvided, isReadOnlyFromMetadata, isReadOnlyInternalAttribute, isRequired, isSupportedAttribute, nameSet, normalizeAttributeValues, toMap, validate
Methods inherited from class java.util.HashMap
clear, clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, get, getOrDefault, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
Methods inherited from class java.util.AbstractMap
equals, hashCode, toString
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.keycloak.userprofile.Attributes
getFirst
-
Constructor Details
-
ServiceAccountAttributes
public ServiceAccountAttributes(UserProfileContext context, Map<String, ?> attributes, UserModel user, UserProfileMetadata profileMetadata, KeycloakSession session)
-
-
Method Details
-
isReadOnly
Description copied from interface:Attributes
Checks whether an attribute is read-only.- Specified by:
isReadOnly
in interfaceAttributes
- Overrides:
isReadOnly
in classDefaultAttributes
- Parameters:
name
- the attribute name- Returns:
true
if the attribute is read-only. Otherwise,false
-
createUnmanagedAttributeMetadata
- Overrides:
createUnmanagedAttributeMetadata
in classDefaultAttributes
-
isAllowUnmanagedAttribute
protected boolean isAllowUnmanagedAttribute()- Overrides:
isAllowUnmanagedAttribute
in classDefaultAttributes
-
setUserName
- Overrides:
setUserName
in classDefaultAttributes
-