Interface IUserService
Defines the UserService, which is an easy access to operations involving IProfile and eventually Users.
Namespace: Umbraco.Cms.Core.Services
Assembly: Umbraco.Core.dll
Syntax
public interface IUserService : IMembershipUserService, IMembershipMemberService<IUser>, IService
Methods
View SourceAddClientIdAsync(Guid, string)
Adds a client ID to a user for OAuth client credentials authentication.
Declaration
Task<UserClientCredentialsOperationStatus> AddClientIdAsync(Guid userKey, string clientId)
Parameters
| Type | Name | Description |
|---|---|---|
| Guid | userKey | The unique key of the user. |
| string | clientId | The client ID to add. |
Returns
| Type | Description |
|---|---|
| Task<UserClientCredentialsOperationStatus> | A UserClientCredentialsOperationStatus indicating the result of the operation. |
AssignUserGroupPermission(int, string, params int[])
Assigns the same permission set for a single user group to any number of entities
Declaration
void AssignUserGroupPermission(int groupId, string permission, params int[] entityIds)
Parameters
| Type | Name | Description |
|---|---|---|
| int | groupId | Id of the group |
| string | permission | The permission to assign. |
| int[] | entityIds | Specify the nodes to replace permissions for |
ChangePasswordAsync(Guid, ChangeUserPasswordModel)
Changes a user's password.
Declaration
Task<Attempt<PasswordChangedModel, UserOperationStatus>> ChangePasswordAsync(Guid performingUserKey, ChangeUserPasswordModel model)
Parameters
| Type | Name | Description |
|---|---|---|
| Guid | performingUserKey | The key of the user performing the operation. |
| ChangeUserPasswordModel | model | The model containing the password change details. |
Returns
| Type | Description |
|---|---|
| Task<Attempt<PasswordChangedModel, UserOperationStatus>> | An attempt containing the password changed result as well as a more detailed UserOperationStatus. |
ClearAvatarAsync(Guid)
Clears the avatar for a user.
Declaration
Task<UserOperationStatus> ClearAvatarAsync(Guid userKey)
Parameters
| Type | Name | Description |
|---|---|---|
| Guid | userKey | The unique key of the user. |
Returns
| Type | Description |
|---|---|
| Task<UserOperationStatus> | A UserOperationStatus indicating the result of the operation. |
ClearLoginSession(Guid)
Removes the session's validity
Declaration
void ClearLoginSession(Guid sessionId)
Parameters
| Type | Name | Description |
|---|---|---|
| Guid | sessionId | The session id to clear. |
ClearLoginSessions(int)
Removes all valid sessions for the user
Declaration
int ClearLoginSessions(int userId)
Parameters
| Type | Name | Description |
|---|---|---|
| int | userId | The integer id of the user. |
Returns
| Type | Description |
|---|---|
| int | The number of sessions that were cleared. |
CreateAsync(Guid, UserCreateModel, bool)
Creates a user based in a create model and persists it to the database.
Declaration
Task<Attempt<UserCreationResult, UserOperationStatus>> CreateAsync(Guid performingUserKey, UserCreateModel model, bool approveUser = false)
Parameters
| Type | Name | Description |
|---|---|---|
| Guid | performingUserKey | The key of the user performing the operation. |
| UserCreateModel | model | Model to create the user from. |
| bool | approveUser | Specifies if the user should be enabled be default. Defaults to false. |
Returns
| Type | Description |
|---|---|
| Task<Attempt<UserCreationResult, UserOperationStatus>> | An attempt indicating if the operation was a success as well as a more detailed UserOperationStatus. |
Remarks
This creates both the Umbraco user and the identity user.
CreateInitialPasswordAsync(Guid, string, string)
Creates an initial password for a user after invitation verification.
Declaration
Task<Attempt<PasswordChangedModel, UserOperationStatus>> CreateInitialPasswordAsync(Guid userKey, string token, string password)
Parameters
| Type | Name | Description |
|---|---|---|
| Guid | userKey | The unique key of the user. |
| string | token | The invitation token. |
| string | password | The password to set for the user. |
Returns
| Type | Description |
|---|---|
| Task<Attempt<PasswordChangedModel, UserOperationStatus>> | An attempt indicating if the operation was a success as well as a more detailed UserOperationStatus. |
CreateLoginSession(int, string)
Creates a database entry for starting a new login session for a user
Declaration
Guid CreateLoginSession(int userId, string requestingIpAddress)
Parameters
| Type | Name | Description |
|---|---|---|
| int | userId | The integer id of the user. |
| string | requestingIpAddress | The IP address from which the login request originated. |
Returns
| Type | Description |
|---|---|
| Guid | A System.Guid representing the session id. |
Delete(IUser, bool)
Deletes or disables a User
Declaration
void Delete(IUser user, bool deletePermanently)
Parameters
| Type | Name | Description |
|---|---|---|
| IUser | user | IUser to delete |
| bool | deletePermanently |
|
DeleteAsync(Guid, ISet<Guid>)
Deletes multiple users by their keys.
Declaration
Task<UserOperationStatus> DeleteAsync(Guid performingUserKey, ISet<Guid> keys)
Parameters
| Type | Name | Description |
|---|---|---|
| Guid | performingUserKey | The key of the user performing the operation. |
| ISet<Guid> | keys | The set of user keys to delete. |
Returns
| Type | Description |
|---|---|
| Task<UserOperationStatus> | A UserOperationStatus indicating the result of the operation. |
DeleteAsync(Guid, Guid)
Deletes a single user by their key.
Declaration
Task<UserOperationStatus> DeleteAsync(Guid performingUserKey, Guid key)
Parameters
| Type | Name | Description |
|---|---|---|
| Guid | performingUserKey | The key of the user performing the operation. |
| Guid | key | The unique key of the user to delete. |
Returns
| Type | Description |
|---|---|
| Task<UserOperationStatus> | A UserOperationStatus indicating the result of the operation. |
DeleteSectionFromAllUserGroups(string)
Removes a specific section from all user groups
Declaration
void DeleteSectionFromAllUserGroups(string sectionAlias)
Parameters
| Type | Name | Description |
|---|---|---|
| string | sectionAlias | Alias of the section to remove |
Remarks
This is useful when an entire section is removed from config
DisableAsync(Guid, ISet<Guid>)
Disables multiple users by their keys.
Declaration
Task<UserOperationStatus> DisableAsync(Guid performingUserKey, ISet<Guid> keys)
Parameters
| Type | Name | Description |
|---|---|---|
| Guid | performingUserKey | The key of the user performing the operation. |
| ISet<Guid> | keys | The set of user keys to disable. |
Returns
| Type | Description |
|---|---|
| Task<UserOperationStatus> | A UserOperationStatus indicating the result of the operation. |
EnableAsync(Guid, ISet<Guid>)
Enables multiple users by their keys.
Declaration
Task<UserOperationStatus> EnableAsync(Guid performingUserKey, ISet<Guid> keys)
Parameters
| Type | Name | Description |
|---|---|---|
| Guid | performingUserKey | The key of the user performing the operation. |
| ISet<Guid> | keys | The set of user keys to enable. |
Returns
| Type | Description |
|---|---|
| Task<UserOperationStatus> | A UserOperationStatus indicating the result of the operation. |
FilterAsync(Guid, UserFilter, int, int, UserOrder, Direction)
Filters users based on the specified criteria.
Declaration
Task<Attempt<PagedModel<IUser>, UserOperationStatus>> FilterAsync(Guid userKey, UserFilter filter, int skip = 0, int take = 100, UserOrder orderBy = UserOrder.UserName, Direction orderDirection = Direction.Ascending)
Parameters
| Type | Name | Description |
|---|---|---|
| Guid | userKey | The key of the user performing the filter operation. |
| UserFilter | filter | The filter criteria to apply. |
| int | skip | The number of records to skip. Default is 0. |
| int | take | The number of records to take. Default is 100. |
| UserOrder | orderBy | The field to order results by. Default is UserName. |
| Direction | orderDirection | The direction to order results. Default is Ascending. |
Returns
| Type | Description |
|---|---|
| Task<Attempt<PagedModel<IUser>, UserOperationStatus>> | An attempt containing a paged model of filtered users as well as a more detailed UserOperationStatus. |
FindByClientIdAsync(string)
Finds a user by their client ID.
Declaration
Task<IUser?> FindByClientIdAsync(string clientId)
Parameters
| Type | Name | Description |
|---|---|---|
| string | clientId | The client ID to search for. |
Returns
| Type | Description |
|---|---|
| Task<IUser> | The IUser associated with the client ID, or |
GetAll(long, int, out long, string, Direction, UserState[]?, string[]?, string?)
Get paged users
Declaration
IEnumerable<IUser> GetAll(long pageIndex, int pageSize, out long totalRecords, string orderBy, Direction orderDirection, UserState[]? userState = null, string[]? userGroups = null, string? filter = null)
Parameters
| Type | Name | Description |
|---|---|---|
| long | pageIndex | The page index (zero-based). |
| int | pageSize | The number of items per page. |
| long | totalRecords | The total number of records found (out). |
| string | orderBy | The field to order by. |
| Direction | orderDirection | The direction to order by. |
| UserState[] | userState | Optional array of user states to filter by. |
| string[] | userGroups | A filter to only include user that belong to these user groups |
| string | filter | Optional string filter. |
Returns
| Type | Description |
|---|---|
| IEnumerable<IUser> | An enumerable collection of IUser objects. |
GetAll(long, int, out long, string, Direction, UserState[]?, string[]?, string[]?, IQuery<IUser>?)
Get paged users
Declaration
IEnumerable<IUser> GetAll(long pageIndex, int pageSize, out long totalRecords, string orderBy, Direction orderDirection, UserState[]? userState = null, string[]? includeUserGroups = null, string[]? excludeUserGroups = null, IQuery<IUser>? filter = null)
Parameters
| Type | Name | Description |
|---|---|---|
| long | pageIndex | The page index (zero-based). |
| int | pageSize | The number of items per page. |
| long | totalRecords | The total number of records found (out). |
| string | orderBy | The field to order by. |
| Direction | orderDirection | The direction to order by. |
| UserState[] | userState | Optional array of user states to filter by. |
| string[] | includeUserGroups | A filter to only include user that belong to these user groups |
| string[] | excludeUserGroups | A filter to only include users that do not belong to these user groups |
| IQuery<IUser> | filter | Optional query filter. |
Returns
| Type | Description |
|---|---|
| IEnumerable<IUser> | An enumerable collection of IUser objects. |
GetAllAsync(Guid, int, int)
Gets all users that the requesting user is allowed to see.
Declaration
Task<Attempt<PagedModel<IUser>?, UserOperationStatus>> GetAllAsync(Guid performingUserKey, int skip, int take)
Parameters
| Type | Name | Description |
|---|---|---|
| Guid | performingUserKey | The Key of the user requesting the users. |
| int | skip | Amount to skip. |
| int | take | Amount to take. |
Returns
| Type | Description |
|---|---|
| Task<Attempt<PagedModel<IUser>, UserOperationStatus>> | All users that the user is allowed to see. |
GetAllInGroup(int?)
Gets a list of IUser objects associated with a given group
Declaration
IEnumerable<IUser> GetAllInGroup(int? groupId)
Parameters
| Type | Name | Description |
|---|---|---|
| int? | groupId | Id of group |
Returns
| Type | Description |
|---|---|
| IEnumerable<IUser> | System.Collections.Generic.IEnumerable<T> |
GetAllNotInGroup(int)
Gets a list of IUser objects not associated with a given group
Declaration
IEnumerable<IUser> GetAllNotInGroup(int groupId)
Parameters
| Type | Name | Description |
|---|---|---|
| int | groupId | Id of group |
Returns
| Type | Description |
|---|---|
| IEnumerable<IUser> | System.Collections.Generic.IEnumerable<T> |
GetAsync(IEnumerable<Guid>)
Gets multiple users by their keys.
Declaration
Task<IEnumerable<IUser>> GetAsync(IEnumerable<Guid> keys)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<Guid> | keys | The keys of the users to retrieve. |
Returns
| Type | Description |
|---|---|
| Task<IEnumerable<IUser>> | An enumerable collection of IUser objects matching the specified keys. |
GetAsync(Guid)
Get a user by its key.
Declaration
Task<IUser?> GetAsync(Guid key)
Parameters
| Type | Name | Description |
|---|---|---|
| Guid | key | The GUID key of the user. |
Returns
| Type | Description |
|---|---|
| Task<IUser> | The found user, or null if nothing was found. |
GetClientIdsAsync(Guid)
Gets all client IDs associated with a user.
Declaration
Task<IEnumerable<string>> GetClientIdsAsync(Guid userKey)
Parameters
| Type | Name | Description |
|---|---|---|
| Guid | userKey | The unique key of the user. |
Returns
| Type | Description |
|---|---|
| Task<IEnumerable<string>> | An enumerable collection of client IDs. |
GetDocumentPermissionsAsync(Guid, IEnumerable<Guid>)
Get explicitly assigned media permissions for a user and node keys.
Declaration
Task<Attempt<IEnumerable<NodePermissions>, UserOperationStatus>> GetDocumentPermissionsAsync(Guid userKey, IEnumerable<Guid> contentKeys)
Parameters
| Type | Name | Description |
|---|---|---|
| Guid | userKey | Key of user to retrieve permissions for. |
| IEnumerable<Guid> | contentKeys | The keys of the content to get permissions for. |
Returns
| Type | Description |
|---|---|
| Task<Attempt<IEnumerable<NodePermissions>, UserOperationStatus>> | An attempt indicating if the operation was a success as well as a more detailed UserOperationStatus, and an enumerable of permissions. |
GetLinkedLoginsAsync(Guid)
Gets all linked external logins for a user.
Declaration
Task<Attempt<ICollection<IIdentityUserLogin>, UserOperationStatus>> GetLinkedLoginsAsync(Guid userKey)
Parameters
| Type | Name | Description |
|---|---|---|
| Guid | userKey | The unique key of the user. |
Returns
| Type | Description |
|---|---|
| Task<Attempt<ICollection<IIdentityUserLogin>, UserOperationStatus>> | An attempt containing the collection of linked logins as well as a more detailed UserOperationStatus. |
GetMediaPermissionsAsync(Guid, IEnumerable<Guid>)
Get explicitly assigned content permissions for a user and node keys.
Declaration
Task<Attempt<IEnumerable<NodePermissions>, UserOperationStatus>> GetMediaPermissionsAsync(Guid userKey, IEnumerable<Guid> mediaKeys)
Parameters
| Type | Name | Description |
|---|---|---|
| Guid | userKey | Key of user to retrieve permissions for. |
| IEnumerable<Guid> | mediaKeys | The keys of the media to get permissions for. |
Returns
| Type | Description |
|---|---|
| Task<Attempt<IEnumerable<NodePermissions>, UserOperationStatus>> | An attempt indicating if the operation was a success as well as a more detailed UserOperationStatus, and an enumerable of permissions. |
GetPermissions(IUser?, params int[])
Get explicitly assigned permissions for a user and optional node ids
Declaration
EntityPermissionCollection GetPermissions(IUser? user, params int[] nodeIds)
Parameters
| Type | Name | Description |
|---|---|---|
| IUser | user | User to retrieve permissions for |
| int[] | nodeIds | Specifying nothing will return all user permissions for all nodes that have explicit permissions defined |
Returns
| Type | Description |
|---|---|
| EntityPermissionCollection | An enumerable list of EntityPermission |
Remarks
If no permissions are found for a particular entity then the user's default permissions will be applied
GetPermissions(IUserGroup?[], bool, params int[])
Get explicitly assigned permissions for groups and optional node Ids
Declaration
EntityPermissionCollection GetPermissions(IUserGroup?[] groups, bool fallbackToDefaultPermissions, params int[] nodeIds)
Parameters
| Type | Name | Description |
|---|---|---|
| IUserGroup[] | groups | The user groups to get permissions for. |
| bool | fallbackToDefaultPermissions | Flag indicating if we want to include the default group permissions for each result if there are not explicit permissions set |
| int[] | nodeIds | Specifying nothing will return all permissions for all nodes |
Returns
| Type | Description |
|---|---|
| EntityPermissionCollection | An enumerable list of EntityPermission |
GetPermissionsAsync(Guid, params Guid[])
Get explicitly assigned permissions for a user and node keys.
Declaration
Task<Attempt<IEnumerable<NodePermissions>, UserOperationStatus>> GetPermissionsAsync(Guid userKey, params Guid[] nodeKeys)
Parameters
| Type | Name | Description |
|---|---|---|
| Guid | userKey | Key of user to retrieve permissions for. |
| Guid[] | nodeKeys | The keys of the nodes to get permissions for. |
Returns
| Type | Description |
|---|---|
| Task<Attempt<IEnumerable<NodePermissions>, UserOperationStatus>> | An enumerable list of NodePermissions. |
GetPermissionsForPath(IUser?, string?)
Gets the implicit/inherited permissions for the user for the given path
Declaration
EntityPermissionSet GetPermissionsForPath(IUser? user, string? path)
Parameters
| Type | Name | Description |
|---|---|---|
| IUser | user | User to check permissions for |
| string | path | Path to check permissions for |
Returns
| Type | Description |
|---|---|
| EntityPermissionSet | An EntityPermissionSet containing the calculated permissions. |
GetPermissionsForPath(IUserGroup[], string, bool)
Gets the permissions for the provided groups and path
Declaration
EntityPermissionSet GetPermissionsForPath(IUserGroup[] groups, string path, bool fallbackToDefaultPermissions = false)
Parameters
| Type | Name | Description |
|---|---|---|
| IUserGroup[] | groups | The user groups to get permissions for. |
| string | path | Path to check permissions for |
| bool | fallbackToDefaultPermissions | Flag indicating if we want to include the default group permissions for each result if there are not explicit permissions set |
Returns
| Type | Description |
|---|---|
| EntityPermissionSet | An EntityPermissionSet containing the calculated permissions. |
GetProfileById(int)
Gets an IProfile by User Id.
Declaration
IProfile? GetProfileById(int id)
Parameters
| Type | Name | Description |
|---|---|---|
| int | id | Id of the User to retrieve |
Returns
| Type | Description |
|---|---|
| IProfile |
GetProfileByUserName(string)
Gets a profile by username
Declaration
IProfile? GetProfileByUserName(string username)
Parameters
| Type | Name | Description |
|---|---|---|
| string | username | Username |
Returns
| Type | Description |
|---|---|
| IProfile |
GetUserById(int)
Gets a user by Id
Declaration
IUser? GetUserById(int id)
Parameters
| Type | Name | Description |
|---|---|---|
| int | id | Id of the user to retrieve |
Returns
| Type | Description |
|---|---|
| IUser |
GetUserStates()
This is basically facets of UserStates key = state, value = count
Declaration
IDictionary<UserState, int> GetUserStates()
Returns
| Type | Description |
|---|---|
| IDictionary<UserState, int> | A dictionary where the key is the UserState and the value is the count of users in that state. |
GetUsersById(params int[]?)
Gets a users by Id
Declaration
IEnumerable<IUser> GetUsersById(params int[]? ids)
Parameters
| Type | Name | Description |
|---|---|---|
| int[] | ids | Ids of the users to retrieve |
Returns
| Type | Description |
|---|---|
| IEnumerable<IUser> |
InviteAsync(Guid, UserInviteModel)
Invites a new user to the system by sending an invitation email.
Declaration
Task<Attempt<UserInvitationResult, UserOperationStatus>> InviteAsync(Guid performingUserKey, UserInviteModel model)
Parameters
| Type | Name | Description |
|---|---|---|
| Guid | performingUserKey | The key of the user performing the operation. |
| UserInviteModel | model | The model containing the invitation details. |
Returns
| Type | Description |
|---|---|
| Task<Attempt<UserInvitationResult, UserOperationStatus>> | An attempt indicating if the operation was a success as well as a more detailed UserOperationStatus. |
RemoveClientIdAsync(Guid, string)
Removes a client ID from a user.
Declaration
Task<bool> RemoveClientIdAsync(Guid userKey, string clientId)
Parameters
| Type | Name | Description |
|---|---|---|
| Guid | userKey | The unique key of the user. |
| string | clientId | The client ID to remove. |
Returns
| Type | Description |
|---|---|
| Task<bool> |
|
ReplaceUserGroupPermissions(int, ISet<string>, params int[])
Replaces the same permission set for a single group to any number of entities
Declaration
void ReplaceUserGroupPermissions(int groupId, ISet<string> permissions, params int[] entityIds)
Parameters
| Type | Name | Description |
|---|---|---|
| int | groupId | Id of the group |
| ISet<string> | permissions | Permissions as enumerable list of char, if no permissions are specified then all permissions for this node are removed for this group |
| int[] | entityIds | Specify the nodes to replace permissions for. If nothing is specified all permissions are removed. |
Remarks
If no 'entityIds' are specified all permissions will be removed for the specified group.
ResendInvitationAsync(Guid, UserResendInviteModel)
Resends an invitation email to a user.
Declaration
Task<Attempt<UserInvitationResult, UserOperationStatus>> ResendInvitationAsync(Guid performingUserKey, UserResendInviteModel model)
Parameters
| Type | Name | Description |
|---|---|---|
| Guid | performingUserKey | The key of the user performing the operation. |
| UserResendInviteModel | model | The model containing the resend invitation details. |
Returns
| Type | Description |
|---|---|
| Task<Attempt<UserInvitationResult, UserOperationStatus>> | An attempt containing the invitation result as well as a more detailed UserOperationStatus. |
ResetPasswordAsync(Guid, Guid)
Resets a user's password without requiring a token.
Declaration
Task<Attempt<PasswordChangedModel, UserOperationStatus>> ResetPasswordAsync(Guid performingUserKey, Guid userKey)
Parameters
| Type | Name | Description |
|---|---|---|
| Guid | performingUserKey | The key of the user performing the operation. |
| Guid | userKey | The unique key of the user whose password will be reset. |
Returns
| Type | Description |
|---|---|
| Task<Attempt<PasswordChangedModel, UserOperationStatus>> | An attempt containing the password changed result as well as a more detailed UserOperationStatus. |
ResetPasswordAsync(Guid, string, string)
Changes the user's password.
Declaration
Task<Attempt<PasswordChangedModel, UserOperationStatus>> ResetPasswordAsync(Guid userKey, string token, string password)
Parameters
| Type | Name | Description |
|---|---|---|
| Guid | userKey | The unique key of the user. |
| string | token | The reset password token. |
| string | password | The new password of the user. |
Returns
| Type | Description |
|---|---|
| Task<Attempt<PasswordChangedModel, UserOperationStatus>> | An attempt containing the password changed result as well as a more detailed UserOperationStatus. |
SendResetPasswordEmailAsync(string)
Sends an email with a link to reset user's password.
Declaration
Task<Attempt<UserOperationStatus>> SendResetPasswordEmailAsync(string userEmail)
Parameters
| Type | Name | Description |
|---|---|---|
| string | userEmail | The email address of the user. |
Returns
| Type | Description |
|---|---|
| Task<Attempt<UserOperationStatus>> | An attempt indicating if the operation was successful as well as a more detailed UserOperationStatus. |
SetAvatarAsync(Guid, Guid)
Sets the avatar for a user from a temporary file.
Declaration
Task<UserOperationStatus> SetAvatarAsync(Guid userKey, Guid temporaryFileKey)
Parameters
| Type | Name | Description |
|---|---|---|
| Guid | userKey | The unique key of the user. |
| Guid | temporaryFileKey | The key of the temporary file containing the avatar image. |
Returns
| Type | Description |
|---|---|
| Task<UserOperationStatus> | A UserOperationStatus indicating the result of the operation. |
UnlockAsync(Guid, params Guid[])
Unlocks users that have been locked out.
Declaration
Task<Attempt<UserUnlockResult, UserOperationStatus>> UnlockAsync(Guid performingUserKey, params Guid[] keys)
Parameters
| Type | Name | Description |
|---|---|---|
| Guid | performingUserKey | The key of the user performing the operation. |
| Guid[] | keys | The keys of the users to unlock. |
Returns
| Type | Description |
|---|---|
| Task<Attempt<UserUnlockResult, UserOperationStatus>> | An attempt containing the unlock result as well as a more detailed UserOperationStatus. |
UpdateAsync(Guid, UserUpdateModel)
Updates an existing user.
Declaration
Task<Attempt<IUser?, UserOperationStatus>> UpdateAsync(Guid performingUserKey, UserUpdateModel model)
Parameters
| Type | Name | Description |
|---|---|---|
| Guid | performingUserKey | The key of the user performing the operation. |
| UserUpdateModel | model | The model containing the updated user details. |
Returns
| Type | Description |
|---|---|
| Task<Attempt<IUser, UserOperationStatus>> | An attempt containing the updated IUser if successful, as well as a more detailed UserOperationStatus. |
ValidateLoginSession(int, Guid)
Validates that a user login session is valid/current and hasn't been closed
Declaration
bool ValidateLoginSession(int userId, Guid sessionId)
Parameters
| Type | Name | Description |
|---|---|---|
| int | userId | The integer id of the user. |
| Guid | sessionId | The session id to validate. |
Returns
| Type | Description |
|---|---|
| bool |
|
VerifyInviteAsync(Guid, string)
Verifies an invitation token for a user.
Declaration
Task<Attempt<UserOperationStatus>> VerifyInviteAsync(Guid userKey, string token)
Parameters
| Type | Name | Description |
|---|---|---|
| Guid | userKey | The unique key of the user. |
| string | token | The invitation token to verify. |
Returns
| Type | Description |
|---|---|
| Task<Attempt<UserOperationStatus>> | An attempt indicating if the verification was successful as well as a more detailed UserOperationStatus. |
VerifyPasswordResetAsync(Guid, string)
Verifies the reset code sent from the reset password mail for a given user.
Declaration
Task<Attempt<UserOperationStatus>> VerifyPasswordResetAsync(Guid userKey, string token)
Parameters
| Type | Name | Description |
|---|---|---|
| Guid | userKey | The unique key of the user. |
| string | token | The reset password token. |
Returns
| Type | Description |
|---|---|
| Task<Attempt<UserOperationStatus>> | An attempt indicating if the verification was successful as well as a more detailed UserOperationStatus. |