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, userFields inherited from interface org.keycloak.userprofile.Attributes
EMPTY_VALUE -
Constructor Summary
ConstructorsConstructorDescriptionServiceAccountAttributes(UserProfileContext context, Map<String, ?> attributes, UserModel user, UserProfileMetadata profileMetadata, KeycloakSession session) -
Method Summary
Modifier and TypeMethodDescriptionprotected AttributeMetadataprotected booleanbooleanisReadOnly(String name) Checks whether an attribute is read-only.protected voidMethods inherited from class org.keycloak.userprofile.DefaultAttributes
addDefaultValidators, contains, createAttributeContext, get, getAnnotations, getMetadata, getReadable, getUnmanagedAttributes, getWritable, isIncludeAttributeIfNotProvided, isReadOnlyFromMetadata, isReadOnlyInternalAttribute, isRequired, isSupportedAttribute, nameSet, normalizeAttributeValues, toMap, validateMethods 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, valuesMethods inherited from class java.util.AbstractMap
equals, hashCode, toStringMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods 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:AttributesChecks whether an attribute is read-only.- Specified by:
isReadOnlyin interfaceAttributes- Overrides:
isReadOnlyin classDefaultAttributes- Parameters:
name- the attribute name- Returns:
trueif the attribute is read-only. Otherwise,false
-
createUnmanagedAttributeMetadata
- Overrides:
createUnmanagedAttributeMetadatain classDefaultAttributes
-
isAllowUnmanagedAttribute
protected boolean isAllowUnmanagedAttribute()- Overrides:
isAllowUnmanagedAttributein classDefaultAttributes
-
setUserName
- Overrides:
setUserNamein classDefaultAttributes
-