Package org.keycloak.ipatuura_user_spi
Class IpatuuraUserStorageProvider
java.lang.Object
org.keycloak.ipatuura_user_spi.IpatuuraUserStorageProvider
- All Implemented Interfaces:
- CredentialAuthentication,- CredentialInputValidator,- Provider,- ImportedUserValidation,- UserCountMethodsProvider,- UserLookupProvider,- UserQueryMethodsProvider,- UserQueryProvider,- UserRegistrationProvider,- UserStorageProvider
public class IpatuuraUserStorageProvider
extends Object
implements UserStorageProvider, UserLookupProvider, CredentialInputValidator, CredentialAuthentication, UserRegistrationProvider, UserQueryProvider, ImportedUserValidation
- Version:
- $Revision: 1 $
- Author:
- Justin Stephenson
- 
Nested Class SummaryNested classes/interfaces inherited from interface org.keycloak.storage.UserStorageProviderUserStorageProvider.EditMode
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected IpatuuraUserStorageProviderFactoryprotected Ipatuuraprotected ComponentModelprotected KeycloakSession
- 
Constructor SummaryConstructorsConstructorDescriptionIpatuuraUserStorageProvider(KeycloakSession session, ComponentModel model, Ipatuura ipatuura, IpatuuraUserStorageProviderFactory factory) 
- 
Method SummaryModifier and TypeMethodDescriptionaddUser(RealmModel realm, String username) All storage providers that implement this interface will be looped through.authenticate(RealmModel realm, CredentialInput input) voidclose()protected UserModelcreateUserInKeycloak(RealmModel realm, String username) getGroupMembersStream(RealmModel arg0, GroupModel arg1, Integer arg2, Integer arg3) Obtains users that belong to a specific group.getUserByEmail(RealmModel realm, String email) Returns a user with the given email belonging to the realmgetUserById(RealmModel realm, String id) Returns a user with the given id belonging to the realmgetUserByUsername(RealmModel realm, String username) Exact search for a user by its username.intgetUsersCount(RealmModel realm) Returns the number of users, without consider any service account.booleanisConfiguredFor(RealmModel realm, UserModel user, String credentialType) booleanisValid(RealmModel realm, UserModel user, CredentialInput input) Tests whether a credential is validbooleanremoveUser(RealmModel realm, UserModel user) Called if user originated from this provider.searchForUserByUserAttributeStream(RealmModel realm, String attrName, String attrValue) Searches for users that have a specific attribute with a specific value.searchForUserStream(RealmModel realm, Map<String, String> params, Integer firstResult, Integer maxResults) Searches for user by parameter.booleanbooleansupportsCredentialType(String credentialType) validate(RealmModel realm, UserModel local) If this method returns null, then the user in local storage will be removedMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.keycloak.storage.user.UserCountMethodsProvidergetUsersCount, getUsersCount, getUsersCount, getUsersCount, getUsersCount, getUsersCountMethods inherited from interface org.keycloak.storage.user.UserLookupProvidergetUserByCredentialMethods inherited from interface org.keycloak.storage.user.UserQueryMethodsProvidergetGroupMembersStream, getGroupMembersStream, getRoleMembersStream, getRoleMembersStream, searchForUserStream, searchForUserStream, searchForUserStreamMethods inherited from interface org.keycloak.storage.UserStorageProviderpreRemove, preRemove, preRemove
- 
Field Details- 
session
- 
model
- 
ipatuura
- 
supportedCredentialTypes
- 
factory
 
- 
- 
Constructor Details- 
IpatuuraUserStorageProviderpublic IpatuuraUserStorageProvider(KeycloakSession session, ComponentModel model, Ipatuura ipatuura, IpatuuraUserStorageProviderFactory factory) 
 
- 
- 
Method Details- 
getUserByEmailDescription 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
 
- 
getUserByIdDescription 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
 
- 
getUserByUsernameDescription 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
 
- 
createUserInKeycloak
- 
closepublic void close()
- 
getSupportedCredentialTypes
- 
isConfiguredFor- Specified by:
- isConfiguredForin interface- CredentialInputValidator
 
- 
supportsCredentialType- Specified by:
- supportsCredentialTypein interface- CredentialInputValidator
 
- 
isValidDescription 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
 
- 
validateDescription 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
 
- 
addUserDescription copied from interface:UserRegistrationProviderAll storage providers that implement this interface will be looped through. If this method returns null, then the next storage provider's addUser() method will be called. If no storage providers handle the add, then the user will be created in local storage. Returning null is useful when you want optional support for adding users. For example, our LDAP provider can enable and disable the ability to add users.- Specified by:
- addUserin interface- UserRegistrationProvider
- Parameters:
- realm- a reference to the realm
- username- a username the created user will be assigned
- Returns:
- a model of created user
 
- 
removeUserDescription copied from interface:UserRegistrationProviderCalled if user originated from this provider. If a local user is linked to this provider, this method will be called before local storage's removeUser() method is invoked. If you are using an import strategy, and this is a local user linked to this provider, this method will be called before local storage's removeUser() method is invoked. Also, you DO NOT need to remove the imported user. The runtime will handle this for you.- Specified by:
- removeUserin interface- UserRegistrationProvider
- Parameters:
- realm- a reference to the realm
- user- a reference to the user that is removed
- Returns:
- true if the user was removed, false otherwise
 
- 
getGroupMembersStreampublic Stream<UserModel> getGroupMembersStream(RealmModel arg0, GroupModel arg1, Integer arg2, Integer arg3) Description copied from interface:UserQueryMethodsProviderObtains users that belong to a specific group.- Specified by:
- getGroupMembersStreamin interface- UserQueryMethodsProvider
- Parameters:
- arg0- a reference to the realm.
- arg1- a reference to the group.
- arg2- first result to return. Ignored if negative, zero, or- null.
- arg3- maximum number of results to return. Ignored if negative or- null.
- Returns:
- a non-null Streamof users that belong to the group.
 
- 
getUsersCountDescription copied from interface:UserCountMethodsProviderReturns the number of users, without consider any service account.- Specified by:
- getUsersCountin interface- UserCountMethodsProvider
- Parameters:
- realm- the realm
- Returns:
- the number of users
 
- 
searchForUserByUserAttributeStreampublic Stream<UserModel> searchForUserByUserAttributeStream(RealmModel realm, String attrName, String attrValue) Description copied from interface:UserQueryMethodsProviderSearches for users that have a specific attribute with a specific value.- Specified by:
- searchForUserByUserAttributeStreamin interface- UserQueryMethodsProvider
- Parameters:
- realm- a reference to the realm.
- attrName- the attribute name.
- attrValue- the attribute value.
- Returns:
- a non-null Streamof users that match the search criteria.
 
- 
searchForUserStreampublic Stream<UserModel> searchForUserStream(RealmModel realm, Map<String, String> params, Integer firstResult, Integer maxResults) Description copied from interface:UserQueryMethodsProviderSearches for user by parameter. If possible, implementations should treat the parameter values as partial match patterns (i.e. in RDMBS terms use LIKE). Valid parameters are:- UserModel.SEARCH- search for users whose username, email, first name or last name contain any of the strings in- searchseparated by whitespace, when- SEARCHis set all other params are ignored
- UserModel.FIRST_NAME- first name (case insensitive string)
- UserModel.LAST_NAME- last name (case insensitive string)
- UserModel.EMAIL- email (case insensitive string)
- UserModel.USERNAME- username (case insensitive string)
- UserModel.EXACT- whether search with FIRST_NAME, LAST_NAME, USERNAME or EMAIL should be exact match
- UserModel.EMAIL_VERIFIED- search only for users with verified/non-verified email (true/false)
- UserModel.ENABLED- search only for enabled/disabled users (true/false)
- UserModel.IDP_ALIAS- search only for users that have a federated identity from idp with the given alias configured (case sensitive string)
- UserModel.IDP_USER_ID- search for users with federated identity with the given userId (case sensitive string)
 Any other parameters will be treated as custom user attributes. This method is used by the REST API when querying users. - Specified by:
- searchForUserStreamin interface- UserQueryMethodsProvider
- Parameters:
- realm- a reference to the realm.
- params- a map containing the search parameters.
- firstResult- first result to return. Ignored if negative, zero, or- null.
- maxResults- maximum number of results to return. Ignored if negative or- null.
- Returns:
- a non-null Streamof users that match the search criteria.
 
- 
supportsCredentialAuthenticationFor- Specified by:
- supportsCredentialAuthenticationForin interface- CredentialAuthentication
 
- 
authenticate- Specified by:
- authenticatein interface- CredentialAuthentication
 
 
-