public interface UserProvider extends Provider, UserLookupProvider, UserQueryProvider, UserRegistrationProvider, UserBulkUpdateProvider
Modifier and Type | Interface and Description |
---|---|
static interface |
UserProvider.Streams
The
UserProvider.Streams interface makes all collection-based methods in UserProvider default by
providing implementations that delegate to the Stream -based variants instead of the other way around. |
Modifier and Type | Method and Description |
---|---|
void |
addConsent(RealmModel realm,
String userId,
UserConsentModel consent)
Add user consent for the user.
|
void |
addFederatedIdentity(RealmModel realm,
UserModel user,
FederatedIdentityModel socialLink)
Adds a federated identity link for the user within the realm
|
UserModel |
addUser(RealmModel realm,
String id,
String username,
boolean addDefaultRoles,
boolean addDefaultRequiredActions)
Adds a new user into the storage.
|
void |
close() |
UserConsentModel |
getConsentByClient(RealmModel realm,
String userId,
String clientInternalId)
Returns UserConsentModel given by a user with the userId for the client with clientInternalId
|
List<UserConsentModel> |
getConsents(RealmModel realm,
String userId)
Deprecated.
Use
getConsentsStream instead. |
default Stream<UserConsentModel> |
getConsentsStream(RealmModel realm,
String userId)
Obtains the consents associated with the user identified by the specified
userId . |
Set<FederatedIdentityModel> |
getFederatedIdentities(UserModel user,
RealmModel realm)
Deprecated.
Use
getFederatedIdentitiesStream instead. |
default Stream<FederatedIdentityModel> |
getFederatedIdentitiesStream(RealmModel realm,
UserModel user)
Obtains the federated identities of the specified user.
|
default FederatedIdentityModel |
getFederatedIdentity(RealmModel realm,
UserModel user,
String socialProvider)
Returns details of the association between the user and the socialProvider.
|
FederatedIdentityModel |
getFederatedIdentity(UserModel user,
String socialProvider,
RealmModel realm)
Deprecated.
Use
getFederatedIdentity instead. |
int |
getNotBeforeOfUser(RealmModel realm,
UserModel user)
Gets the notBefore value for the given user
|
UserModel |
getServiceAccount(ClientModel client)
Return a UserModel representing service account of the client
|
UserModel |
getUserByFederatedIdentity(FederatedIdentityModel socialLink,
RealmModel realm)
Deprecated.
Use
getUserByFederatedIdentity instead. |
default UserModel |
getUserByFederatedIdentity(RealmModel realm,
FederatedIdentityModel socialLink)
Returns a userModel that corresponds to the given socialLink.
|
List<UserModel> |
getUsers(RealmModel realm,
boolean includeServiceAccounts)
Deprecated.
Use
getUsersStream instead. |
List<UserModel> |
getUsers(RealmModel realm,
int firstResult,
int maxResults,
boolean includeServiceAccounts)
Deprecated.
Use
getUsersStream instead. |
default Stream<UserModel> |
getUsersStream(RealmModel realm,
boolean includeServiceAccounts)
Obtains the users associated with the specified realm.
|
default Stream<UserModel> |
getUsersStream(RealmModel realm,
Integer firstResult,
Integer maxResults,
boolean includeServiceAccounts)
Obtains the users associated with the specified realm.
|
void |
preRemove(ClientScopeModel clientScope)
Called when a client scope is removed.
|
void |
preRemove(ProtocolMapperModel protocolMapper)
Called when a protocolMapper is removed
|
void |
preRemove(RealmModel realm)
Called when a realm is removed.
|
void |
preRemove(RealmModel realm,
ClientModel client)
Called when a client is removed.
|
void |
preRemove(RealmModel realm,
ComponentModel component)
Called when a component is removed.
|
void |
preRemove(RealmModel realm,
GroupModel group)
Called when a group is removed.
|
void |
preRemove(RealmModel realm,
IdentityProviderModel provider)
Called when an identity provider is removed.
|
void |
preRemove(RealmModel realm,
RoleModel role)
Called when a role is removed.
|
boolean |
removeFederatedIdentity(RealmModel realm,
UserModel user,
String socialProvider)
Removes federation link between the user and the identity provider given by its id
|
void |
removeImportedUsers(RealmModel realm,
String storageProviderId)
Removes any imported users from a specific User Storage Provider.
|
boolean |
revokeConsentForClient(RealmModel realm,
String userId,
String clientInternalId)
Remove a user consent given by the user id and client id
|
void |
setNotBeforeForUser(RealmModel realm,
UserModel user,
int notBefore)
Sets the notBefore value for the given user
|
void |
unlinkUsers(RealmModel realm,
String storageProviderId)
Set federation link to
null to imported users of a specific User Storage Provider |
void |
updateConsent(RealmModel realm,
String userId,
UserConsentModel consent)
Update client scopes in the stored user consent
|
void |
updateFederatedIdentity(RealmModel realm,
UserModel federatedUser,
FederatedIdentityModel federatedIdentityModel)
Update details of association between the federatedUser and the idp given by the federatedIdentityModel
|
getUserByEmail, getUserByEmail, getUserById, getUserById, getUserByUsername, getUserByUsername
countUsersInGroups, getGroupMembers, getGroupMembers, getGroupMembersStream, getGroupMembersStream, getRoleMembers, getRoleMembers, getRoleMembersStream, getRoleMembersStream, getUsers, getUsers, getUsersCount, getUsersCount, getUsersCount, getUsersCount, getUsersCount, getUsersCount, getUsersCount, getUsersCount, getUsersCount, getUsersCount, getUsersCount, getUsersStream, getUsersStream, searchForUser, searchForUser, searchForUser, searchForUser, searchForUserByUserAttribute, searchForUserByUserAttributeStream, searchForUserStream, searchForUserStream, searchForUserStream, searchForUserStream
addUser, removeUser
grantToAllUsers
void setNotBeforeForUser(RealmModel realm, UserModel user, int notBefore)
realm
- a reference to the realmuser
- the user modelnotBefore
- new value for notBeforeModelException
- when user doesn't exist in the storageint getNotBeforeOfUser(RealmModel realm, UserModel user)
realm
- a reference to the realmuser
- the user modelModelException
- when user doesn't exist in the storageUserModel getServiceAccount(ClientModel client)
client
- the client modelIllegalArgumentException
- when there are more service accounts associated with the given clientId@Deprecated List<UserModel> getUsers(RealmModel realm, boolean includeServiceAccounts)
getUsersStream
instead.default Stream<UserModel> getUsersStream(RealmModel realm, boolean includeServiceAccounts)
realm
- a reference to the realm being used for the search.includeServiceAccounts
- true
if service accounts should be included in the result; false
otherwise.Stream
of users associated withe the realm.@Deprecated List<UserModel> getUsers(RealmModel realm, int firstResult, int maxResults, boolean includeServiceAccounts)
getUsersStream
instead.default Stream<UserModel> getUsersStream(RealmModel realm, Integer firstResult, Integer maxResults, boolean includeServiceAccounts)
realm
- a reference to the realm being used for the search.firstResult
- first result to return. Ignored if negative, zero, or null
.maxResults
- maximum number of results to return. Ignored if negative or null
.includeServiceAccounts
- true
if service accounts should be included in the result; false
otherwise.Stream
of users associated withe the realm.UserModel addUser(RealmModel realm, String id, String username, boolean addDefaultRoles, boolean addDefaultRequiredActions)
realm
- the realm that user will be created inid
- id of the new user. Should be generated to a random value if null
.username
- usernameaddDefaultRoles
- if true
, the user should join all realm default rolesaddDefaultRequiredActions
- if true
, all default required actions are added to the created userNullPointerException
- when username or realm is null
ModelDuplicateException
- when a user with given id or username already existsvoid removeImportedUsers(RealmModel realm, String storageProviderId)
realm
- a reference to the realmstorageProviderId
- id of the user storage providervoid unlinkUsers(RealmModel realm, String storageProviderId)
null
to imported users of a specific User Storage Providerrealm
- a reference to the realmstorageProviderId
- id of the storage providervoid addConsent(RealmModel realm, String userId, UserConsentModel consent)
realm
- a reference to the realmuserId
- id of the userconsent
- all details corresponding to the granted consentModelException
- If there is no user with userIdUserConsentModel getConsentByClient(RealmModel realm, String userId, String clientInternalId)
realm
- a reference to the realmuserId
- id of the userclientInternalId
- id of the clientnull
if no consent or user existsModelException
- when there are more consents fulfilling specified parameters@Deprecated List<UserConsentModel> getConsents(RealmModel realm, String userId)
getConsentsStream
instead.default Stream<UserConsentModel> getConsentsStream(RealmModel realm, String userId)
userId
.realm
- a reference to the realm.userId
- the user identifier.Stream
of consents associated with the user.void updateConsent(RealmModel realm, String userId, UserConsentModel consent)
realm
- a reference to the realmuserId
- id of the userconsent
- new details of the user consentModelException
- when consent doesn't exist for the userIdboolean revokeConsentForClient(RealmModel realm, String userId, String clientInternalId)
realm
- a reference to the realmuserId
- id of the userclientInternalId
- id of the clienttrue
if the consent was removed, false
otherwisevoid addFederatedIdentity(RealmModel realm, UserModel user, FederatedIdentityModel socialLink)
realm
- a reference to the realmuser
- the user modelsocialLink
- the federated identity model containing all details of the association between the user and
the identity providerboolean removeFederatedIdentity(RealmModel realm, UserModel user, String socialProvider)
realm
- a reference to the realmuser
- the user modelsocialProvider
- alias of the identity provider, see IdentityProviderModel.getAlias()
true
if the association was removed, false
otherwisevoid updateFederatedIdentity(RealmModel realm, UserModel federatedUser, FederatedIdentityModel federatedIdentityModel)
realm
- a reference to the realmfederatedUser
- the user modelfederatedIdentityModel
- the federated identity model containing all details of the association between
the user and the identity provider@Deprecated Set<FederatedIdentityModel> getFederatedIdentities(UserModel user, RealmModel realm)
getFederatedIdentitiesStream
instead.default Stream<FederatedIdentityModel> getFederatedIdentitiesStream(RealmModel realm, UserModel user)
realm
- a reference to the realm.user
- the reference to the user.Stream
of federated identities associated with the user.default FederatedIdentityModel getFederatedIdentity(RealmModel realm, UserModel user, String socialProvider)
realm
- a reference to the realmuser
- the user modelsocialProvider
- the id of the identity providernull
if no association exists@Deprecated FederatedIdentityModel getFederatedIdentity(UserModel user, String socialProvider, RealmModel realm)
getFederatedIdentity
instead.default UserModel getUserByFederatedIdentity(RealmModel realm, FederatedIdentityModel socialLink)
realm
- a reference to the realmsocialLink
- the socialLinknull
if no such user existsIllegalStateException
- when there are more users for the given socialLink@Deprecated UserModel getUserByFederatedIdentity(FederatedIdentityModel socialLink, RealmModel realm)
getUserByFederatedIdentity
instead.void preRemove(RealmModel realm)
realm
- a reference to the realmvoid preRemove(RealmModel realm, IdentityProviderModel provider)
realm
- a reference to the realmprovider
- provider modelvoid preRemove(RealmModel realm, RoleModel role)
realm
- a reference to the realmrole
- the role modelvoid preRemove(RealmModel realm, GroupModel group)
realm
- a reference to the realmgroup
- the group modelvoid preRemove(RealmModel realm, ClientModel client)
realm
- a reference to the realmclient
- the client modelvoid preRemove(ProtocolMapperModel protocolMapper)
protocolMapper
- the protocolMapper modelvoid preRemove(ClientScopeModel clientScope)
clientScope
- the clientScope modelvoid preRemove(RealmModel realm, ComponentModel component)
realm
- a reference to the realmcomponent
- the component modelCopyright © 2021 JBoss by Red Hat. All rights reserved.