Package org.keycloak.userprofile
Class AbstractUserProfileProvider<U extends UserProfileProvider>
java.lang.Object
org.keycloak.userprofile.AbstractUserProfileProvider<U>
- All Implemented Interfaces:
Provider,ProviderFactory<U>,UserProfileProvider,UserProfileProviderFactory<U>
- Direct Known Subclasses:
DeclarativeUserProfileProvider
public abstract class AbstractUserProfileProvider<U extends UserProfileProvider>
extends Object
implements UserProfileProvider, UserProfileProviderFactory<U>
A base class for UserProfileProvider implementations providing the main hooks for customizations.
- Author:
- Markus Till
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringprotected final Map<UserProfileContext,UserProfileMetadata> static final Stringprotected final KeycloakSession -
Constructor Summary
ConstructorsConstructorDescriptionAbstractUserProfileProvider(KeycloakSession session, Map<UserProfileContext, UserProfileMetadata> contextualMetadataRegistry) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()protected UserProfileMetadataconfigureUserProfile(UserProfileMetadata metadata) Sub-types can override this method to customize how contextual profile metadata is configured at init time.protected UserProfileMetadataconfigureUserProfile(UserProfileMetadata metadata, KeycloakSession session) Sub-types can override this method to customize how contextual profile metadata is configured at runtime.create(KeycloakSession session) protected abstract Ucreate(KeycloakSession session, Map<UserProfileContext, UserProfileMetadata> metadataRegistry) Subclasses can override this method to create their instances ofUserProfileProvider.create(UserProfileContext context, Map<String, ?> attributes) create(UserProfileContext context, Map<String, ?> attributes, UserModel user) create(UserProfileContext context, UserModel user) protected AttributescreateAttributes(UserProfileContext context, Map<String, ?> attributes, UserModel user, UserProfileMetadata metadata) static PatterngetRegexPatternString(String[] builtinReadOnlyAttributes) voidinit(Config.Scope config) voidpostInit(KeycloakSessionFactory factory) voidsetConfiguration(String configuration) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.keycloak.provider.ProviderFactory
getId, orderMethods inherited from interface org.keycloak.userprofile.UserProfileProvider
isEnabled
-
Field Details
-
CONFIG_ADMIN_READ_ONLY_ATTRIBUTES
- See Also:
-
CONFIG_READ_ONLY_ATTRIBUTES
- See Also:
-
MAX_EMAIL_LOCAL_PART_LENGTH
- See Also:
-
contextualMetadataRegistry
-
session
-
-
Constructor Details
-
AbstractUserProfileProvider
public AbstractUserProfileProvider() -
AbstractUserProfileProvider
public AbstractUserProfileProvider(KeycloakSession session, Map<UserProfileContext, UserProfileMetadata> contextualMetadataRegistry)
-
-
Method Details
-
getRegexPatternString
-
create
- Specified by:
createin interfaceUserProfileProvider
-
create
- Specified by:
createin interfaceUserProfileProvider
-
create
- Specified by:
createin interfaceUserProfileProvider
-
create
- Specified by:
createin interfaceProviderFactory<U extends UserProfileProvider>
-
init
- Specified by:
initin interfaceProviderFactory<U extends UserProfileProvider>
-
postInit
- Specified by:
postInitin interfaceProviderFactory<U extends UserProfileProvider>
-
close
public void close()- Specified by:
closein interfaceProvider- Specified by:
closein interfaceProviderFactory<U extends UserProfileProvider>
-
getConfiguration
- Specified by:
getConfigurationin interfaceUserProfileProvider
-
setConfiguration
- Specified by:
setConfigurationin interfaceUserProfileProvider
-
create
protected abstract U create(KeycloakSession session, Map<UserProfileContext, UserProfileMetadata> metadataRegistry) Subclasses can override this method to create their instances ofUserProfileProvider.- Parameters:
session- the sessionmetadataRegistry- the profile metadata- Returns:
- the profile provider instance
-
configureUserProfile
Sub-types can override this method to customize how contextual profile metadata is configured at init time.- Parameters:
metadata- the profile metadata- Returns:
- the metadata
-
configureUserProfile
protected UserProfileMetadata configureUserProfile(UserProfileMetadata metadata, KeycloakSession session) Sub-types can override this method to customize how contextual profile metadata is configured at runtime.- Parameters:
metadata- the profile metadatasession- the current session- Returns:
- the metadata
-
createAttributes
protected Attributes createAttributes(UserProfileContext context, Map<String, ?> attributes, UserModel user, UserProfileMetadata metadata) -
getConfigMetadata
- Specified by:
getConfigMetadatain interfaceProviderFactory<U extends UserProfileProvider>
-