org.keycloak.federation.kerberos

## Class KerberosFederationProviderFactory

- java.lang.Object
- - org.keycloak.federation.kerberos.KerberosFederationProviderFactory

- All Implemented Interfaces:
    UserFederationProviderFactory, ProviderFactory<UserFederationProvider>

      public class KerberosFederationProviderFactory
      extends Object
      implements UserFederationProviderFactory

  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 and Description
    --- | ---
    `static String` | `PROVIDER_NAME`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `KerberosFederationProviderFactory()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()` This is called when the server shuts down.
    `UserFederationProvider` | `create(KeycloakSession session)` This method is never called and is only an artifact of ProviderFactory.
    `protected KerberosServerSubjectAuthenticator` | `createKerberosSubjectAuthenticator(CommonKerberosConfig kerberosConfig)`
    `protected KerberosUsernamePasswordAuthenticator` | `createKerberosUsernamePasswordAuthenticator(CommonKerberosConfig kerberosConfig)`
    `protected SPNEGOAuthenticator` | `createSPNEGOAuthenticator(String spnegoToken, CommonKerberosConfig kerberosConfig)`
    `Set<String>` | `getConfigurationOptions()` Config options to display in generic admin console page for federation
    `String` | `getId()` This is the name of the provider and will be showed in the admin console as an option.
    `UserFederationProvider` | `getInstance(KeycloakSession session, UserFederationProviderModel model)` called per Keycloak transaction.
    `void` | `init(Config.Scope config)` Only called once when the factory is first created.
    `void` | `postInit(KeycloakSessionFactory factory)` Called after all provider factories have been initialized
    `UserFederationSyncResult` | `syncAllUsers(KeycloakSessionFactory sessionFactory, String realmId, UserFederationProviderModel model)` Sync all users from the provider storage to Keycloak storage.
    `UserFederationSyncResult` | `syncChangedUsers(KeycloakSessionFactory sessionFactory, String realmId, UserFederationProviderModel model, Date lastSync)` Sync just changed (added / updated / removed) users from the provider storage to Keycloak storage.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### PROVIDER_NAME

          public static final String PROVIDER_NAME

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### KerberosFederationProviderFactory

          public KerberosFederationProviderFactory()

  - ### Method Detail

    - #### getInstance

          public UserFederationProvider getInstance(KeycloakSession session,
                                                    UserFederationProviderModel model)

      Description copied from interface: `UserFederationProviderFactory`
      called per Keycloak transaction.
      Specified by:
        `getInstance` in interface `UserFederationProviderFactory`
      Returns:

    - #### getConfigurationOptions

          public Set<String> getConfigurationOptions()

      Description copied from interface: `UserFederationProviderFactory`
      Config options to display in generic admin console page for federation
      Specified by:
        `getConfigurationOptions` in interface `UserFederationProviderFactory`
      Returns:

    - #### getId

          public String getId()

      Description copied from interface: `UserFederationProviderFactory`
      This is the name of the provider and will be showed in the admin console as an option.
      Specified by:
        `getId` in interface `UserFederationProviderFactory`
      Specified by:
        `getId` in interface `ProviderFactory<UserFederationProvider>`

    - #### syncAllUsers

          public UserFederationSyncResult syncAllUsers(KeycloakSessionFactory sessionFactory,
                                                       String realmId,
                                                       UserFederationProviderModel model)

      Description copied from interface: `UserFederationProviderFactory`
      Sync all users from the provider storage to Keycloak storage. Alternatively can update existing users or remove keycloak users, which are no longer available in federation storage (depends on the implementation)
      Specified by:
        `syncAllUsers` in interface `UserFederationProviderFactory`
      Returns:
        result with count of added/updated/removed users

    - #### syncChangedUsers

          public UserFederationSyncResult syncChangedUsers(KeycloakSessionFactory sessionFactory,
                                                           String realmId,
                                                           UserFederationProviderModel model,
                                                           Date lastSync)

      Description copied from interface: `UserFederationProviderFactory`
      Sync just changed (added / updated / removed) users from the provider storage to Keycloak storage. This is useful in case that your storage supports "changelogs" (Tracking what users changed since specified date). It's implementation specific to decide what exactly will be changed
      Specified by:
        `syncChangedUsers` in interface `UserFederationProviderFactory`

    - #### create

          public UserFederationProvider create(KeycloakSession session)

      Description copied from interface: `UserFederationProviderFactory`
      This method is never called and is only an artifact of ProviderFactory. Returning null with no implementation is recommended.
      Specified by:
        `create` in interface `UserFederationProviderFactory`
      Specified by:
        `create` in interface `ProviderFactory<UserFederationProvider>`

    - #### init

          public void init(Config.Scope config)

      Description copied from interface: `ProviderFactory`
      Only called once when the factory is first created. This config is pulled from keycloak_server.json
      Specified by:
        `init` in interface `ProviderFactory<UserFederationProvider>`

    - #### postInit

          public void postInit(KeycloakSessionFactory factory)

      Description copied from interface: `ProviderFactory`
      Called after all provider factories have been initialized
      Specified by:
        `postInit` in interface `ProviderFactory<UserFederationProvider>`

    - #### close

          public void close()

      Description copied from interface: `ProviderFactory`
      This is called when the server shuts down.
      Specified by:
        `close` in interface `ProviderFactory<UserFederationProvider>`

    - #### createSPNEGOAuthenticator

          protected SPNEGOAuthenticator createSPNEGOAuthenticator(String spnegoToken,
                                                                  CommonKerberosConfig kerberosConfig)

    - #### createKerberosSubjectAuthenticator

          protected KerberosServerSubjectAuthenticator createKerberosSubjectAuthenticator(CommonKerberosConfig kerberosConfig)

    - #### createKerberosUsernamePasswordAuthenticator

          protected KerberosUsernamePasswordAuthenticator createKerberosUsernamePasswordAuthenticator(CommonKerberosConfig kerberosConfig)

Copyright © 2016 JBoss by Red Hat. All rights reserved.