public class LDAPStorageProvider extends Object implements UserStorageProvider, CredentialInputValidator, CredentialInputUpdater, CredentialAuthentication, UserLookupProvider, UserRegistrationProvider, UserQueryProvider, ImportedUserValidation
UserStorageProvider.EditMode
Modifier and Type | Field and Description |
---|---|
protected UserStorageProvider.EditMode |
editMode |
protected LDAPStorageProviderFactory |
factory |
protected LDAPProviderKerberosConfig |
kerberosConfig |
protected LDAPIdentityStore |
ldapIdentityStore |
protected LDAPStorageMapperManager |
mapperManager |
protected UserStorageProviderModel |
model |
protected KeycloakSession |
session |
protected Set<String> |
supportedCredentialTypes |
protected PasswordUpdateCallback |
updater |
protected LDAPStorageUserManager |
userManager |
Constructor and Description |
---|
LDAPStorageProvider(LDAPStorageProviderFactory factory,
KeycloakSession session,
ComponentModel model,
LDAPIdentityStore ldapIdentityStore) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
countUsersInGroups, getRoleMembers, getRoleMembers, getUsersCount, getUsersCount, getUsersCount, getUsersCount, getUsersCount, getUsersCount
protected LDAPStorageProviderFactory factory
protected KeycloakSession session
protected UserStorageProviderModel model
protected LDAPIdentityStore ldapIdentityStore
protected UserStorageProvider.EditMode editMode
protected LDAPProviderKerberosConfig kerberosConfig
protected PasswordUpdateCallback updater
protected LDAPStorageMapperManager mapperManager
protected LDAPStorageUserManager userManager
public LDAPStorageProvider(LDAPStorageProviderFactory factory, KeycloakSession session, ComponentModel model, LDAPIdentityStore ldapIdentityStore)
public void setUpdater(PasswordUpdateCallback updater)
public KeycloakSession getSession()
public LDAPIdentityStore getLdapIdentityStore()
public UserStorageProvider.EditMode getEditMode()
public UserStorageProviderModel getModel()
public LDAPStorageMapperManager getMapperManager()
public LDAPStorageUserManager getUserManager()
public UserModel validate(RealmModel realm, UserModel local)
validate
in interface ImportedUserValidation
protected UserModel proxy(RealmModel realm, UserModel local, LDAPObject ldapObject, boolean newUser)
public boolean supportsCredentialAuthenticationFor(String type)
supportsCredentialAuthenticationFor
in interface CredentialAuthentication
public List<UserModel> searchForUserByUserAttribute(String attrName, String attrValue, RealmModel realm)
searchForUserByUserAttribute
in interface UserQueryProvider
public boolean synchronizeRegistrations()
public UserModel addUser(RealmModel realm, String username)
addUser
in interface UserRegistrationProvider
public boolean removeUser(RealmModel realm, UserModel user)
removeUser
in interface UserRegistrationProvider
public UserModel getUserById(String id, RealmModel realm)
getUserById
in interface UserLookupProvider
public int getUsersCount(RealmModel realm)
getUsersCount
in interface UserQueryProvider
public List<UserModel> getUsers(RealmModel realm)
getUsers
in interface UserQueryProvider
public List<UserModel> getUsers(RealmModel realm, int firstResult, int maxResults)
getUsers
in interface UserQueryProvider
public List<UserModel> searchForUser(String search, RealmModel realm)
searchForUser
in interface UserQueryProvider
public List<UserModel> searchForUser(String search, RealmModel realm, int firstResult, int maxResults)
searchForUser
in interface UserQueryProvider
public List<UserModel> searchForUser(Map<String,String> params, RealmModel realm)
searchForUser
in interface UserQueryProvider
public List<UserModel> searchForUser(Map<String,String> params, RealmModel realm, int firstResult, int maxResults)
searchForUser
in interface UserQueryProvider
public List<UserModel> getGroupMembers(RealmModel realm, GroupModel group)
getGroupMembers
in interface UserQueryProvider
public List<UserModel> getGroupMembers(RealmModel realm, GroupModel group, int firstResult, int maxResults)
getGroupMembers
in interface UserQueryProvider
public List<UserModel> loadUsersByUsernames(List<String> usernames, RealmModel realm)
protected List<LDAPObject> searchLDAP(RealmModel realm, Map<String,String> attributes, int maxResults)
protected LDAPObject loadAndValidateUser(RealmModel realm, UserModel local)
local
- public UserModel getUserByUsername(String username, RealmModel realm)
getUserByUsername
in interface UserLookupProvider
protected UserModel importUserFromLDAP(KeycloakSession session, RealmModel realm, LDAPObject ldapUser)
protected LDAPObject queryByEmail(RealmModel realm, String email)
public UserModel getUserByEmail(String email, RealmModel realm)
getUserByEmail
in interface UserLookupProvider
public void preRemove(RealmModel realm)
preRemove
in interface UserStorageProvider
public void preRemove(RealmModel realm, RoleModel role)
preRemove
in interface UserStorageProvider
public void preRemove(RealmModel realm, GroupModel group)
preRemove
in interface UserStorageProvider
public boolean validPassword(RealmModel realm, UserModel user, String password)
public boolean updateCredential(RealmModel realm, UserModel user, CredentialInput input)
updateCredential
in interface CredentialInputUpdater
public void disableCredentialType(RealmModel realm, UserModel user, String credentialType)
disableCredentialType
in interface CredentialInputUpdater
public Set<String> getDisableableCredentialTypes(RealmModel realm, UserModel user)
getDisableableCredentialTypes
in interface CredentialInputUpdater
public boolean supportsCredentialType(String credentialType)
supportsCredentialType
in interface CredentialInputUpdater
supportsCredentialType
in interface CredentialInputValidator
public boolean isConfiguredFor(RealmModel realm, UserModel user, String credentialType)
isConfiguredFor
in interface CredentialInputValidator
public boolean isValid(RealmModel realm, UserModel user, CredentialInput input)
isValid
in interface CredentialInputValidator
public CredentialValidationOutput authenticate(RealmModel realm, CredentialInput cred)
authenticate
in interface CredentialAuthentication
protected UserModel findOrCreateAuthenticatedUser(RealmModel realm, String username)
realm
- realmusername
- username without realm prefixpublic LDAPObject loadLDAPUserByUsername(RealmModel realm, String username)
Copyright © 2021 JBoss by Red Hat. All rights reserved.