Package org.keycloak.userprofile
Class AbstractUserProfileProvider<U extends org.keycloak.userprofile.UserProfileProvider>
- java.lang.Object
-
- org.keycloak.userprofile.AbstractUserProfileProvider<U>
-
- All Implemented Interfaces:
org.keycloak.provider.Provider,org.keycloak.provider.ProviderFactory<U>,org.keycloak.userprofile.UserProfileProvider,org.keycloak.userprofile.UserProfileProviderFactory<U>
- Direct Known Subclasses:
DeclarativeUserProfileProvider
public abstract class AbstractUserProfileProvider<U extends org.keycloak.userprofile.UserProfileProvider> extends Object implements org.keycloak.userprofile.UserProfileProvider, org.keycloak.userprofile.UserProfileProviderFactory<U>
A base class for
UserProfileProviderimplementations providing the main hooks for customizations.- Author:
- Markus Till
-
-
Field Summary
Fields Modifier and Type Field Description protected Map<org.keycloak.userprofile.UserProfileContext,org.keycloak.userprofile.UserProfileMetadata>contextualMetadataRegistryprotected org.keycloak.models.KeycloakSessionsession
-
Constructor Summary
Constructors Constructor Description AbstractUserProfileProvider()AbstractUserProfileProvider(org.keycloak.models.KeycloakSession session, Map<org.keycloak.userprofile.UserProfileContext,org.keycloak.userprofile.UserProfileMetadata> contextualMetadataRegistry)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidclose()protected org.keycloak.userprofile.UserProfileMetadataconfigureUserProfile(org.keycloak.userprofile.UserProfileMetadata metadata)Sub-types can override this method to customize how contextual profile metadata is configured at init time.protected org.keycloak.userprofile.UserProfileMetadataconfigureUserProfile(org.keycloak.userprofile.UserProfileMetadata metadata, org.keycloak.models.KeycloakSession session)Sub-types can override this method to customize how contextual profile metadata is configured at runtime.Ucreate(org.keycloak.models.KeycloakSession session)protected abstract Ucreate(org.keycloak.models.KeycloakSession session, Map<org.keycloak.userprofile.UserProfileContext,org.keycloak.userprofile.UserProfileMetadata> metadataRegistry)Subclasses can override this method to create their instances ofUserProfileProvider.org.keycloak.userprofile.UserProfilecreate(org.keycloak.userprofile.UserProfileContext context, Map<String,?> attributes)org.keycloak.userprofile.UserProfilecreate(org.keycloak.userprofile.UserProfileContext context, Map<String,?> attributes, org.keycloak.models.UserModel user)org.keycloak.userprofile.UserProfilecreate(org.keycloak.userprofile.UserProfileContext context, org.keycloak.models.UserModel user)protected org.keycloak.userprofile.AttributescreateAttributes(org.keycloak.userprofile.UserProfileContext context, Map<String,?> attributes, org.keycloak.models.UserModel user, org.keycloak.userprofile.UserProfileMetadata metadata)StringgetConfiguration()static PatterngetRegexPatternString(String[] builtinReadOnlyAttributes)voidinit(org.keycloak.Config.Scope config)voidpostInit(org.keycloak.models.KeycloakSessionFactory factory)voidsetConfiguration(String configuration)
-
-
-
Field Detail
-
contextualMetadataRegistry
protected final Map<org.keycloak.userprofile.UserProfileContext,org.keycloak.userprofile.UserProfileMetadata> contextualMetadataRegistry
-
session
protected final org.keycloak.models.KeycloakSession session
-
-
Constructor Detail
-
AbstractUserProfileProvider
public AbstractUserProfileProvider()
-
AbstractUserProfileProvider
public AbstractUserProfileProvider(org.keycloak.models.KeycloakSession session, Map<org.keycloak.userprofile.UserProfileContext,org.keycloak.userprofile.UserProfileMetadata> contextualMetadataRegistry)
-
-
Method Detail
-
getRegexPatternString
public static Pattern getRegexPatternString(String[] builtinReadOnlyAttributes)
-
create
public org.keycloak.userprofile.UserProfile create(org.keycloak.userprofile.UserProfileContext context, org.keycloak.models.UserModel user)- Specified by:
createin interfaceorg.keycloak.userprofile.UserProfileProvider
-
create
public org.keycloak.userprofile.UserProfile create(org.keycloak.userprofile.UserProfileContext context, Map<String,?> attributes, org.keycloak.models.UserModel user)- Specified by:
createin interfaceorg.keycloak.userprofile.UserProfileProvider
-
create
public org.keycloak.userprofile.UserProfile create(org.keycloak.userprofile.UserProfileContext context, Map<String,?> attributes)- Specified by:
createin interfaceorg.keycloak.userprofile.UserProfileProvider
-
create
public U create(org.keycloak.models.KeycloakSession session)
- Specified by:
createin interfaceorg.keycloak.provider.ProviderFactory<U extends org.keycloak.userprofile.UserProfileProvider>
-
init
public void init(org.keycloak.Config.Scope config)
- Specified by:
initin interfaceorg.keycloak.provider.ProviderFactory<U extends org.keycloak.userprofile.UserProfileProvider>
-
postInit
public void postInit(org.keycloak.models.KeycloakSessionFactory factory)
- Specified by:
postInitin interfaceorg.keycloak.provider.ProviderFactory<U extends org.keycloak.userprofile.UserProfileProvider>
-
close
public void close()
- Specified by:
closein interfaceorg.keycloak.provider.Provider- Specified by:
closein interfaceorg.keycloak.provider.ProviderFactory<U extends org.keycloak.userprofile.UserProfileProvider>
-
getConfiguration
public String getConfiguration()
- Specified by:
getConfigurationin interfaceorg.keycloak.userprofile.UserProfileProvider
-
setConfiguration
public void setConfiguration(String configuration)
- Specified by:
setConfigurationin interfaceorg.keycloak.userprofile.UserProfileProvider
-
create
protected abstract U create(org.keycloak.models.KeycloakSession session, Map<org.keycloak.userprofile.UserProfileContext,org.keycloak.userprofile.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
protected org.keycloak.userprofile.UserProfileMetadata configureUserProfile(org.keycloak.userprofile.UserProfileMetadata metadata)
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 org.keycloak.userprofile.UserProfileMetadata configureUserProfile(org.keycloak.userprofile.UserProfileMetadata metadata, org.keycloak.models.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
-
-