public class DeclarativeUserProfileProvider extends AbstractUserProfileProvider<UserProfileProvider> implements AmphibianProviderFactory<UserProfileProvider>
UserProfileProvider
loading configuration from the changeable JSON file stored in component config. Parsed
configuration is cached.Modifier and Type | Field and Description |
---|---|
static String |
ID |
static String |
REALM_USER_PROFILE_ENABLED |
static String |
UP_PIECES_COUNT_COMPONENT_CONFIG_KEY |
contextualMetadataRegistry, session
Constructor and Description |
---|
DeclarativeUserProfileProvider() |
DeclarativeUserProfileProvider(KeycloakSession session,
Map<UserProfileContext,UserProfileMetadata> metadataRegistry,
String defaultRawConfig) |
Modifier and Type | Method and Description |
---|---|
protected UserProfileMetadata |
configureUserProfile(UserProfileMetadata metadata,
KeycloakSession session)
Sub-types can override this method to customize how contextual profile metadata is configured at runtime.
|
protected UserProfileProvider |
create(KeycloakSession session,
Map<UserProfileContext,UserProfileMetadata> metadataRegistry)
Subclasses can override this method to create their instances of
UserProfileProvider . |
protected Attributes |
createAttributes(UserProfileContext context,
Map<String,?> attributes,
UserModel user,
UserProfileMetadata metadata) |
protected AttributeValidatorMetadata |
createConfiguredValidator(String validator,
Map<String,Object> validatorConfig)
Create validator for validation configured in the user profile config.
|
protected UserProfileMetadata |
decorateUserProfileForCache(UserProfileMetadata decoratedMetadata,
ComponentModel model)
Decorate basic metadata provided from
AbstractUserProfileProvider based on 'per realm' configuration. |
ComponentModel |
getComponentModel() |
List<ProviderConfigProperty> |
getConfigProperties() |
String |
getConfiguration()
Get current UserProfile configuration.
|
String |
getHelpText() |
String |
getId() |
protected UPConfig |
getParsedConfig(ComponentModel model)
Get parsed config file configured in model.
|
void |
init(Config.Scope config)
Only called once when the factory is first created.
|
void |
setConfiguration(String configuration)
Set new UserProfile configuration.
|
void |
validateConfiguration(KeycloakSession session,
RealmModel realm,
ComponentModel model)
Called before a component is created or updated.
|
close, configureUserProfile, create, create, create, create, getRegexPatternString, postInit
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
close, create, create, onUpdate, preRemove
getCommonProviderConfigProperties, getTypeMetadata, onCreate
order, postInit
public static final String ID
public static final String UP_PIECES_COUNT_COMPONENT_CONFIG_KEY
public static final String REALM_USER_PROFILE_ENABLED
public DeclarativeUserProfileProvider()
public DeclarativeUserProfileProvider(KeycloakSession session, Map<UserProfileContext,UserProfileMetadata> metadataRegistry, String defaultRawConfig)
public String getId()
getId
in interface ProviderFactory<UserProfileProvider>
protected UserProfileProvider create(KeycloakSession session, Map<UserProfileContext,UserProfileMetadata> metadataRegistry)
AbstractUserProfileProvider
UserProfileProvider
.create
in class AbstractUserProfileProvider<UserProfileProvider>
session
- the sessionmetadataRegistry
- the profile metadataprotected Attributes createAttributes(UserProfileContext context, Map<String,?> attributes, UserModel user, UserProfileMetadata metadata)
createAttributes
in class AbstractUserProfileProvider<UserProfileProvider>
protected UserProfileMetadata configureUserProfile(UserProfileMetadata metadata, KeycloakSession session)
AbstractUserProfileProvider
configureUserProfile
in class AbstractUserProfileProvider<UserProfileProvider>
metadata
- the profile metadatasession
- the current sessionpublic String getHelpText()
getHelpText
in interface ConfiguredProvider
public void validateConfiguration(KeycloakSession session, RealmModel realm, ComponentModel model) throws ComponentValidationException
ComponentFactory
validateConfiguration
in interface ComponentFactory<UserProfileProvider,UserProfileProvider>
ComponentValidationException
public String getConfiguration()
UserProfileProvider
getConfiguration
in interface UserProfileProvider
getConfiguration
in class AbstractUserProfileProvider<UserProfileProvider>
UserProfileProvider.setConfiguration(String)
public void setConfiguration(String configuration)
UserProfileProvider
setConfiguration
in interface UserProfileProvider
setConfiguration
in class AbstractUserProfileProvider<UserProfileProvider>
configuration
- to be setUserProfileProvider.getConfiguration()
public List<ProviderConfigProperty> getConfigProperties()
getConfigProperties
in interface AmphibianProviderFactory<UserProfileProvider>
getConfigProperties
in interface ConfiguredProvider
public void init(Config.Scope config)
ProviderFactory
init
in interface ProviderFactory<UserProfileProvider>
init
in class AbstractUserProfileProvider<UserProfileProvider>
public ComponentModel getComponentModel()
protected UserProfileMetadata decorateUserProfileForCache(UserProfileMetadata decoratedMetadata, ComponentModel model)
AbstractUserProfileProvider
based on 'per realm' configuration.
This method is called for each UserProfileContext
in each realm, and metadata are cached then and this
method is called again only if configuration changes.decoratedMetadata
- base to be decorated based on configuration loaded from component modelmodel
- component model to get "per realm" configuration fromprotected UPConfig getParsedConfig(ComponentModel model)
model
- to take config fromprotected AttributeValidatorMetadata createConfiguredValidator(String validator, Map<String,Object> validatorConfig)
validator
- id to create validator forvalidatorConfig
- of the validatorCopyright © 2021 JBoss by Red Hat. All rights reserved.