Package org.keycloak.federation.kerberos
Class KerberosFederationProviderFactory
- java.lang.Object
-
- org.keycloak.federation.kerberos.KerberosFederationProviderFactory
-
- All Implemented Interfaces:
ComponentFactory<KerberosFederationProvider,UserStorageProvider>,ConfiguredProvider,EnvironmentDependentProviderFactory,ProviderFactory<UserStorageProvider>,UserStorageProviderFactory<KerberosFederationProvider>
public class KerberosFederationProviderFactory extends Object implements UserStorageProviderFactory<KerberosFederationProvider>, EnvironmentDependentProviderFactory
Factory for standalone Kerberos federation provider. Standalone means that it's not backed by LDAP. For Kerberos backed by LDAP (like MS AD or ApacheDS environment) you should rather use LDAP Federation Provider.- Author:
- Marek Posolda
-
-
Field Summary
Fields Modifier and Type Field Description protected static List<ProviderConfigProperty>configPropertiesstatic StringPROVIDER_NAME
-
Constructor Summary
Constructors Constructor Description KerberosFederationProviderFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()This is called when the server shuts down.KerberosFederationProvidercreate(KeycloakSession session, ComponentModel model)called per Keycloak transaction.protected KerberosServerSubjectAuthenticatorcreateKerberosSubjectAuthenticator(CommonKerberosConfig kerberosConfig)protected KerberosUsernamePasswordAuthenticatorcreateKerberosUsernamePasswordAuthenticator(CommonKerberosConfig kerberosConfig)protected SPNEGOAuthenticatorcreateSPNEGOAuthenticator(String spnegoToken, CommonKerberosConfig kerberosConfig)List<ProviderConfigProperty>getConfigProperties()StringgetId()This is the name of the provider and will be showed in the admin console as an option.voidinit(Config.Scope config)Only called once when the factory is first created.booleanisSupported()voidonCreate(KeycloakSession session, RealmModel realm, ComponentModel model)Called when UserStorageProviderModel is created.voidonUpdate(KeycloakSession session, RealmModel realm, ComponentModel oldModel, ComponentModel newModel)Called after the component is updated.voidpostInit(KeycloakSessionFactory factory)Called after all provider factories have been initializedvoidpreRemove(KeycloakSession session, RealmModel realm, ComponentModel model)Called before the component is removed.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.keycloak.component.ComponentFactory
create
-
Methods inherited from interface org.keycloak.provider.ConfiguredProvider
getConfig
-
Methods inherited from interface org.keycloak.provider.EnvironmentDependentProviderFactory
isSupported
-
Methods inherited from interface org.keycloak.provider.ProviderFactory
getConfigMetadata, order
-
Methods inherited from interface org.keycloak.storage.UserStorageProviderFactory
getCommonProviderConfigProperties, getHelpText, getTypeMetadata, validateConfiguration
-
-
-
-
Field Detail
-
PROVIDER_NAME
public static final String PROVIDER_NAME
- See Also:
- Constant Field Values
-
configProperties
protected static final List<ProviderConfigProperty> configProperties
-
-
Method Detail
-
create
public KerberosFederationProvider create(KeycloakSession session, ComponentModel model)
Description copied from interface:UserStorageProviderFactorycalled per Keycloak transaction.- Specified by:
createin interfaceComponentFactory<KerberosFederationProvider,UserStorageProvider>- Specified by:
createin interfaceUserStorageProviderFactory<KerberosFederationProvider>
-
getId
public String getId()
Description copied from interface:UserStorageProviderFactoryThis is the name of the provider and will be showed in the admin console as an option.- Specified by:
getIdin interfaceProviderFactory<UserStorageProvider>- Specified by:
getIdin interfaceUserStorageProviderFactory<KerberosFederationProvider>
-
isSupported
public boolean isSupported()
- Specified by:
isSupportedin interfaceEnvironmentDependentProviderFactory- Returns:
trueif the provider is supported and should be available,falseotherwise
-
getConfigProperties
public List<ProviderConfigProperty> getConfigProperties()
- Specified by:
getConfigPropertiesin interfaceConfiguredProvider- Specified by:
getConfigPropertiesin interfaceUserStorageProviderFactory<KerberosFederationProvider>
-
init
public void init(Config.Scope config)
Description copied from interface:ProviderFactoryOnly called once when the factory is first created. This config is pulled from keycloak_server.json- Specified by:
initin interfaceProviderFactory<UserStorageProvider>- Specified by:
initin interfaceUserStorageProviderFactory<KerberosFederationProvider>
-
postInit
public void postInit(KeycloakSessionFactory factory)
Description copied from interface:ProviderFactoryCalled after all provider factories have been initialized- Specified by:
postInitin interfaceProviderFactory<UserStorageProvider>- Specified by:
postInitin interfaceUserStorageProviderFactory<KerberosFederationProvider>
-
close
public void close()
Description copied from interface:ProviderFactoryThis is called when the server shuts down.- Specified by:
closein interfaceProviderFactory<UserStorageProvider>- Specified by:
closein interfaceUserStorageProviderFactory<KerberosFederationProvider>
-
createSPNEGOAuthenticator
protected SPNEGOAuthenticator createSPNEGOAuthenticator(String spnegoToken, CommonKerberosConfig kerberosConfig)
-
createKerberosSubjectAuthenticator
protected KerberosServerSubjectAuthenticator createKerberosSubjectAuthenticator(CommonKerberosConfig kerberosConfig)
-
createKerberosUsernamePasswordAuthenticator
protected KerberosUsernamePasswordAuthenticator createKerberosUsernamePasswordAuthenticator(CommonKerberosConfig kerberosConfig)
-
onCreate
public void onCreate(KeycloakSession session, RealmModel realm, ComponentModel model)
Description copied from interface:UserStorageProviderFactoryCalled when UserStorageProviderModel is created. This allows you to do initialization of any additional configuration you need to add. For example, you may be introspecting a database or ldap schema to automatically create mappings.- Specified by:
onCreatein interfaceComponentFactory<KerberosFederationProvider,UserStorageProvider>- Specified by:
onCreatein interfaceUserStorageProviderFactory<KerberosFederationProvider>
-
onUpdate
public void onUpdate(KeycloakSession session, RealmModel realm, ComponentModel oldModel, ComponentModel newModel)
Description copied from interface:ComponentFactoryCalled after the component is updated.- Specified by:
onUpdatein interfaceComponentFactory<KerberosFederationProvider,UserStorageProvider>oldModel- old saved modelnewModel- new configuration
-
preRemove
public void preRemove(KeycloakSession session, RealmModel realm, ComponentModel model)
Description copied from interface:ComponentFactoryCalled before the component is removed.- Specified by:
preRemovein interfaceComponentFactory<KerberosFederationProvider,UserStorageProvider>model- model of the component, which is going to be removed
-
-