Package org.keycloak.federation.sssd
Class SSSDFederationProvider
- java.lang.Object
- 
- org.keycloak.federation.sssd.SSSDFederationProvider
 
- 
- All Implemented Interfaces:
- CredentialInputUpdater,- CredentialInputValidator,- Provider,- ImportedUserValidation,- UserLookupProvider,- UserStorageProvider
 
 public class SSSDFederationProvider extends Object implements UserStorageProvider, UserLookupProvider, CredentialInputUpdater, CredentialInputValidator, ImportedUserValidation SPI provider implementation to retrieve data from SSSD and authenticate against PAM- Version:
- $Revision: 1 $
- Author:
- Bruno Oliveira
 
- 
- 
Nested Class Summary- 
Nested classes/interfaces inherited from interface org.keycloak.credential.CredentialInputUpdaterCredentialInputUpdater.Streams
 - 
Nested classes/interfaces inherited from interface org.keycloak.storage.user.UserLookupProviderUserLookupProvider.Streams
 - 
Nested classes/interfaces inherited from interface org.keycloak.storage.UserStorageProviderUserStorageProvider.EditMode
 
- 
 - 
Field SummaryFields Modifier and Type Field Description protected UserStorageProviderModelmodelprotected KeycloakSessionsessionprotected static Set<String>supportedCredentialTypes
 - 
Constructor SummaryConstructors Constructor Description SSSDFederationProvider(KeycloakSession session, UserStorageProviderModel model, SSSDFederationProviderFactory sssdFederationProviderFactory)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()voiddisableCredentialType(RealmModel realm, UserModel user, String credentialType)protected UserModelfindOrCreateAuthenticatedUser(RealmModel realm, String username)Called after successful authenticationStream<String>getDisableableCredentialTypesStream(RealmModel realm, UserModel user)Obtains the set of credential types that can be disabled viadisableCredentialType.UserModelgetUserByEmail(RealmModel realm, String email)Returns a user with the given email belonging to the realmUserModelgetUserById(RealmModel realm, String id)Returns a user with the given id belonging to the realmUserModelgetUserByUsername(RealmModel realm, String username)Exact search for a user by its username.protected UserModelimportUserToKeycloak(RealmModel realm, String username)booleanisConfiguredFor(RealmModel realm, UserModel user, String credentialType)booleanisValid(RealmModel realm, UserModel local)booleanisValid(RealmModel realm, UserModel user, CredentialInput input)Tests whether a credential is validvoidpreRemove(RealmModel realm)Callback when a realm is removed.voidpreRemove(RealmModel realm, GroupModel group)Callback when a group is removed.voidpreRemove(RealmModel realm, RoleModel role)Callback when a role is removed.booleansupportsCredentialType(String credentialType)booleanupdateCredential(RealmModel realm, UserModel user, CredentialInput input)UserModelvalidate(RealmModel realm, UserModel user)If this method returns null, then the user in local storage will be removedUserModelvalidateAndProxy(RealmModel realm, UserModel local)- 
Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 - 
Methods inherited from interface org.keycloak.storage.user.UserLookupProvidergetUserByCredential
 
- 
 
- 
- 
- 
Field Detail- 
sessionprotected KeycloakSession session 
 - 
modelprotected UserStorageProviderModel model 
 
- 
 - 
Constructor Detail- 
SSSDFederationProviderpublic SSSDFederationProvider(KeycloakSession session, UserStorageProviderModel model, SSSDFederationProviderFactory sssdFederationProviderFactory) 
 
- 
 - 
Method Detail- 
getUserByUsernamepublic UserModel getUserByUsername(RealmModel realm, String username) Description copied from interface:UserLookupProviderExact search for a user by its username. Returns a user with the given username belonging to the realm- Specified by:
- getUserByUsernamein interface- UserLookupProvider
- Parameters:
- realm- the realm model
- username- (case-sensitivity is controlled by storage)
- Returns:
- found user model, or nullif no such user exists
 
 - 
validatepublic UserModel validate(RealmModel realm, UserModel user) Description copied from interface:ImportedUserValidationIf this method returns null, then the user in local storage will be removed- Specified by:
- validatein interface- ImportedUserValidation
- Returns:
- null if user no longer valid
 
 - 
findOrCreateAuthenticatedUserprotected UserModel findOrCreateAuthenticatedUser(RealmModel realm, String username) Called after successful authentication- Parameters:
- realm- realm
- username- username without realm prefix
- Returns:
- user if found or successfully created. Null if user with same username already exists, but is not linked to this provider
 
 - 
importUserToKeycloakprotected UserModel importUserToKeycloak(RealmModel realm, String username) 
 - 
getUserByIdpublic UserModel getUserById(RealmModel realm, String id) Description copied from interface:UserLookupProviderReturns a user with the given id belonging to the realm- Specified by:
- getUserByIdin interface- UserLookupProvider
- Parameters:
- realm- the realm model
- id- id of the user
- Returns:
- found user model, or nullif no such user exists
 
 - 
getUserByEmailpublic UserModel getUserByEmail(RealmModel realm, String email) Description copied from interface:UserLookupProviderReturns a user with the given email belonging to the realm- Specified by:
- getUserByEmailin interface- UserLookupProvider
- Parameters:
- realm- the realm model
- email- email address
- Returns:
- found user model, or nullif no such user exists
 
 - 
preRemovepublic void preRemove(RealmModel realm) Description copied from interface:UserStorageProviderCallback when a realm is removed. Implement this if, for example, you want to do some cleanup in your user storage when a realm is removed- Specified by:
- preRemovein interface- UserStorageProvider
 
 - 
preRemovepublic void preRemove(RealmModel realm, RoleModel role) Description copied from interface:UserStorageProviderCallback when a role is removed. Allows you to do things like remove a user role mapping in your external store if appropriate- Specified by:
- preRemovein interface- UserStorageProvider
 
 - 
preRemovepublic void preRemove(RealmModel realm, GroupModel group) Description copied from interface:UserStorageProviderCallback when a group is removed. Allows you to do things like remove a user group mapping in your external store if appropriate- Specified by:
- preRemovein interface- UserStorageProvider
 
 - 
isValidpublic boolean isValid(RealmModel realm, UserModel local) 
 - 
supportsCredentialTypepublic boolean supportsCredentialType(String credentialType) - Specified by:
- supportsCredentialTypein interface- CredentialInputUpdater
- Specified by:
- supportsCredentialTypein interface- CredentialInputValidator
 
 - 
isConfiguredForpublic boolean isConfiguredFor(RealmModel realm, UserModel user, String credentialType) - Specified by:
- isConfiguredForin interface- CredentialInputValidator
 
 - 
isValidpublic boolean isValid(RealmModel realm, UserModel user, CredentialInput input) Description copied from interface:CredentialInputValidatorTests whether a credential is valid- Specified by:
- isValidin interface- CredentialInputValidator
- Parameters:
- realm- The realm in which to which the credential belongs to
- user- The user for which to test the credential
- input- the credential details to verify
- Returns:
- true if the passed secret is correct
 
 - 
validateAndProxypublic UserModel validateAndProxy(RealmModel realm, UserModel local) 
 - 
updateCredentialpublic boolean updateCredential(RealmModel realm, UserModel user, CredentialInput input) - Specified by:
- updateCredentialin interface- CredentialInputUpdater
 
 - 
disableCredentialTypepublic void disableCredentialType(RealmModel realm, UserModel user, String credentialType) - Specified by:
- disableCredentialTypein interface- CredentialInputUpdater
 
 - 
getDisableableCredentialTypesStreampublic Stream<String> getDisableableCredentialTypesStream(RealmModel realm, UserModel user) Description copied from interface:CredentialInputUpdaterObtains the set of credential types that can be disabled viadisableCredentialType.- Specified by:
- getDisableableCredentialTypesStreamin interface- CredentialInputUpdater
- Parameters:
- realm- a reference to the realm.
- user- the user whose credentials are being searched.
- Returns:
- a non-null Streamof credential types.
 
 
- 
 
-