Interface IUsersClient
- Namespace
- Auth0.ManagementApi.Clients
- Assembly
- Auth0.ManagementApi.dll
public interface IUsersClient
Methods
AssignPermissionsAsync(string, AssignPermissionsRequest, CancellationToken)
Assign permissions to a user.
Task AssignPermissionsAsync(string id, AssignPermissionsRequest request, CancellationToken cancellationToken = default)
Parameters
id
stringThe ID of the user to assign permissions to.
request
AssignPermissionsRequestA AssignPermissionsRequest containing the permission identifiers to assign to the user.
cancellationToken
CancellationTokenThe cancellation token to cancel operation.
Returns
AssignRolesAsync(string, AssignRolesRequest, CancellationToken)
Assigns Roles to a user.
Task AssignRolesAsync(string id, AssignRolesRequest request, CancellationToken cancellationToken = default)
Parameters
id
stringThe ID of the user to assign roles to.
request
AssignRolesRequestA AssignRolesRequest containing the role IDs to assign to the user.
cancellationToken
CancellationTokenThe cancellation token to cancel operation.
Returns
CreateAsync(UserCreateRequest, CancellationToken)
Creates a new user.
Task<User> CreateAsync(UserCreateRequest request, CancellationToken cancellationToken = default)
Parameters
request
UserCreateRequestThe UserCreateRequest containing the properties of the user to create.
cancellationToken
CancellationTokenThe cancellation token to cancel operation.
Returns
CreateAuthenticationMethodAsync(string, AuthenticationMethodCreateRequest, CancellationToken)
Creates an authentication method for a given user.
Task<AuthenticationMethod> CreateAuthenticationMethodAsync(string userId, AuthenticationMethodCreateRequest request, CancellationToken cancellationToken = default)
Parameters
userId
stringThe ID of the user for which you want to create the authentication method.
request
AuthenticationMethodCreateRequestThe AuthenticationMethodCreateRequest containing the properties of the authentication method to create.
cancellationToken
CancellationTokenThe cancellation token to cancel operation.
Returns
- Task<AuthenticationMethod>
The newly created AuthenticationMethod.
Remarks
Authentication methods created via this endpoint will be auto confirmed and should already have verification completed.
DeleteAsync(string)
Deletes a user.
Task DeleteAsync(string id)
Parameters
id
stringThe id of the user to delete.
Returns
DeleteAuthenticationMethodAsync(string, string, CancellationToken)
Deletes an authentication method by id,.
Task DeleteAuthenticationMethodAsync(string userId, string authenticationMethodId, CancellationToken cancellationToken = default)
Parameters
userId
stringThe ID of the user for which you want to delete the authentication methods.
authenticationMethodId
stringThe ID of the authentication method you want to delete.
cancellationToken
CancellationTokenThe cancellation token to cancel operation.
Returns
DeleteAuthenticationMethodsAsync(string, CancellationToken)
Deletes all authentication methods for the given user.
Task DeleteAuthenticationMethodsAsync(string userId, CancellationToken cancellationToken = default)
Parameters
userId
stringThe ID of the user for which you want to update the authentication methods.
cancellationToken
CancellationTokenThe cancellation token to cancel operation.
Returns
DeleteMultifactorProviderAsync(string, string, CancellationToken)
Deletes a user's multifactor provider.
Task DeleteMultifactorProviderAsync(string id, string provider, CancellationToken cancellationToken = default)
Parameters
id
stringThe id of the user who multi factor provider to delete.
provider
stringThe type of the multifactor provider. Supported values 'duo' or 'google-authenticator'.
cancellationToken
CancellationTokenThe cancellation token to cancel operation.
Returns
DeleteRefreshTokensAsync(string, CancellationToken)
Delete all refresh tokens for a user.
Task DeleteRefreshTokensAsync(string userId, CancellationToken cancellationToken = default)
Parameters
userId
stringID of the user to remove refresh tokens for
cancellationToken
CancellationToken
Returns
DeleteSessionsAsync(string, CancellationToken)
Delete all sessions for a user.
Task DeleteSessionsAsync(string userId, CancellationToken cancellationToken = default)
Parameters
userId
stringID of the user to remove sessions for
cancellationToken
CancellationToken
Returns
GenerateRecoveryCodeAsync(string, CancellationToken)
Generate new Guardian recovery code.
Task<GenerateRecoveryCodeResponse> GenerateRecoveryCodeAsync(string id, CancellationToken cancellationToken = default)
Parameters
id
stringThe user_id of the user which guardian code will be regenerated.
cancellationToken
CancellationTokenThe cancellation token to cancel operation.
Returns
- Task<GenerateRecoveryCodeResponse>
A Task representing the operation and potential return value.
GetAllAsync(GetUsersRequest, PaginationInfo, CancellationToken)
Lists or search for users based on criteria.
Task<IPagedList<User>> GetAllAsync(GetUsersRequest request, PaginationInfo pagination = null, CancellationToken cancellationToken = default)
Parameters
request
GetUsersRequestSpecifies criteria to use when querying users.
pagination
PaginationInfoSpecifies pagination info to use when requesting paged results.
cancellationToken
CancellationTokenThe cancellation token to cancel operation.
Returns
- Task<IPagedList<User>>
An IPagedList<T> containing the list of users.
GetAllOrganizationsAsync(string, PaginationInfo, CancellationToken)
Lists organizations for a user.
Task<IPagedList<Organization>> GetAllOrganizationsAsync(string userId, PaginationInfo pagination, CancellationToken cancellationToken = default)
Parameters
userId
stringThe ID of the user for which you want to retrieve the organizations.
pagination
PaginationInfoSpecifies pagination info to use when requesting paged results.
cancellationToken
CancellationTokenThe cancellation token to cancel operation.
Returns
- Task<IPagedList<Organization>>
An IPagedList<T> containing the list of organizations.
GetAsync(string, string, bool, CancellationToken)
Gets a user.
Task<User> GetAsync(string id, string fields = null, bool includeFields = true, CancellationToken cancellationToken = default)
Parameters
id
stringThe id of the user to retrieve.
fields
stringA comma separated list of fields to include or exclude (depending on includeFields) from the result, empty to retrieve all fields
includeFields
booltrue if the fields specified are to be included in the result, false otherwise (defaults to true)
cancellationToken
CancellationTokenThe cancellation token to cancel operation.
Returns
GetAuthenticationMethodAsync(string, string, CancellationToken)
Gets an authentication method for a given user.
Task<AuthenticationMethod> GetAuthenticationMethodAsync(string userId, string authenticationMethodId, CancellationToken cancellationToken = default)
Parameters
userId
stringThe ID of the user for which you want to retrieve the authentication method.
authenticationMethodId
stringThe ID of the authentication method you want to retrieve.
cancellationToken
CancellationTokenThe cancellation token to cancel operation.
Returns
- Task<AuthenticationMethod>
The AuthenticationMethod that was requested.
GetAuthenticationMethodsAsync(string, PaginationInfo, CancellationToken)
Gets a list of authentication methods.
Task<IPagedList<AuthenticationMethod>> GetAuthenticationMethodsAsync(string userId, PaginationInfo pagination = null, CancellationToken cancellationToken = default)
Parameters
userId
stringThe ID of the user for which you want to retrieve the authentication methods.
pagination
PaginationInfoSpecifies pagination info to use when requesting paged results.
cancellationToken
CancellationTokenThe cancellation token to cancel operation.
Returns
- Task<IPagedList<AuthenticationMethod>>
An IPagedList<T> containing the list of authentication methods.
GetEnrollmentsAsync(string, CancellationToken)
Get a list of Guardian enrollments.
Task<IList<EnrollmentsResponse>> GetEnrollmentsAsync(string id, CancellationToken cancellationToken = default)
Parameters
id
stringThe user_id of the user to retrieve.
cancellationToken
CancellationTokenThe cancellation token to cancel operation.
Returns
- Task<IList<EnrollmentsResponse>>
A Task representing the operation and potential return value.
GetLogsAsync(GetUserLogsRequest, PaginationInfo, CancellationToken)
Retrieve every log event for a specific user.
Task<IPagedList<LogEntry>> GetLogsAsync(GetUserLogsRequest request, PaginationInfo pagination = null, CancellationToken cancellationToken = default)
Parameters
request
GetUserLogsRequestSpecifies criteria to use when querying logs for a user.
pagination
PaginationInfoSpecifies pagination info to use when requesting paged results.
cancellationToken
CancellationTokenThe cancellation token to cancel operation.
Returns
- Task<IPagedList<LogEntry>>
An IPagedList<T> containing the log entries for the user.
GetPermissionsAsync(string, PaginationInfo, CancellationToken)
Get the permissions assigned to the user.
Task<IPagedList<UserPermission>> GetPermissionsAsync(string id, PaginationInfo pagination = null, CancellationToken cancellationToken = default)
Parameters
id
stringThe id of the user to obtain the permissions for.
pagination
PaginationInfoSpecifies PaginationInfo to use in requesting paged results.
cancellationToken
CancellationTokenThe cancellation token to cancel operation.
Returns
- Task<IPagedList<UserPermission>>
An IPagedList<T> containing the assigned permissions for this user.
GetRefreshTokensAsync(UserRefreshTokensGetRequest, CheckpointPaginationInfo, CancellationToken)
Retrieve details for a user's refresh tokens.
Task<ICheckpointPagedList<RefreshTokenInformation>> GetRefreshTokensAsync(UserRefreshTokensGetRequest request, CheckpointPaginationInfo pagination, CancellationToken cancellationToken = default)
Parameters
request
UserRefreshTokensGetRequestpagination
CheckpointPaginationInfocancellationToken
CancellationToken
Returns
- Task<ICheckpointPagedList<RefreshTokenInformation>>
Collection of RefreshTokenInformation
GetRolesAsync(string, PaginationInfo, CancellationToken)
Retrieve assigned roles for a specific user.
Task<IPagedList<Role>> GetRolesAsync(string userId, PaginationInfo pagination = null, CancellationToken cancellationToken = default)
Parameters
userId
stringThe user id of the roles to retrieve.
pagination
PaginationInfoSpecifies pagination info to use when requesting paged results.
cancellationToken
CancellationTokenThe cancellation token to cancel operation.
Returns
- Task<IPagedList<Role>>
An IPagedList<T> containing the roles for the user.
GetUserSessionsAsync(UserSessionsGetRequest, CheckpointPaginationInfo, CancellationToken)
Retrieve details for a user's sessions.
Task<ICheckpointPagedList<Sessions>> GetUserSessionsAsync(UserSessionsGetRequest request, CheckpointPaginationInfo pagination, CancellationToken cancellationToken = default)
Parameters
request
UserSessionsGetRequestpagination
CheckpointPaginationInfocancellationToken
CancellationToken
Returns
- Task<ICheckpointPagedList<Sessions>>
Collection of Sessions
GetUsersByEmailAsync(string, string, bool?, CancellationToken)
Gets all users by email address.
Task<IList<User>> GetUsersByEmailAsync(string email, string fields = null, bool? includeFields = null, CancellationToken cancellationToken = default)
Parameters
email
stringThe email address to search for.
fields
stringA comma separated list of fields to include or exclude (depending on
includeFields
) from the result, null to retrieve all fields.includeFields
bool?true if the fields specified are to be included in the result, false otherwise. Defaults to true.
cancellationToken
CancellationTokenThe cancellation token to cancel operation.
Returns
InvalidateRememberBrowserAsync(string, CancellationToken)
Invalidate all remembered browsers for MFA.
Task InvalidateRememberBrowserAsync(string id, CancellationToken cancellationToken = default)
Parameters
id
stringThe user_id of the user which will have its remembered browsers for MFA invalidated.
cancellationToken
CancellationTokenThe cancellation token to cancel operation.
Returns
- Task
A Task representing the operation and potential return value.
LinkAccountAsync(string, UserAccountLinkRequest, CancellationToken)
Links a secondary account to a primary account.
Task<IList<AccountLinkResponse>> LinkAccountAsync(string id, UserAccountLinkRequest request, CancellationToken cancellationToken = default)
Parameters
id
stringThe ID of the primary account.
request
UserAccountLinkRequestThe UserAccountLinkRequest containing details of the secondary account to link.
cancellationToken
CancellationTokenThe cancellation token to cancel operation.
Returns
- Task<IList<AccountLinkResponse>>
A IList<T> containing details about this account link.
LinkAccountAsync(string, string, string, CancellationToken)
Links a secondary account to a primary account.
Task<IList<AccountLinkResponse>> LinkAccountAsync(string id, string primaryJwtToken, string secondaryJwtToken, CancellationToken cancellationToken = default)
Parameters
id
stringThe ID of the primary account.
primaryJwtToken
stringThe JWT of the primary account.
secondaryJwtToken
stringThe JWT for the secondary account you wish to link.
cancellationToken
CancellationTokenThe cancellation token to cancel operation.
Returns
- Task<IList<AccountLinkResponse>>
A IList<T> containing details about this account link.
RemovePermissionsAsync(string, AssignPermissionsRequest, CancellationToken)
Removes permissions assigned to a user.
Task RemovePermissionsAsync(string id, AssignPermissionsRequest request, CancellationToken cancellationToken = default)
Parameters
id
stringThe ID of the user to remove permissions from.
request
AssignPermissionsRequestA AssignPermissionsRequest containing the permission identifiers to remove from the user.
cancellationToken
CancellationTokenThe cancellation token to cancel operation.
Returns
RemoveRolesAsync(string, AssignRolesRequest, CancellationToken)
Removes Roles from a user.
Task RemoveRolesAsync(string id, AssignRolesRequest request, CancellationToken cancellationToken = default)
Parameters
id
stringThe ID of the user to remove roles from.
request
AssignRolesRequestA AssignRolesRequest containing the role IDs to remove to the user.
cancellationToken
CancellationTokenThe cancellation token to cancel operation.
Returns
UnlinkAccountAsync(string, string, string, CancellationToken)
Unlinks user accounts
Task<IList<AccountLinkResponse>> UnlinkAccountAsync(string primaryUserId, string provider, string secondaryUserId, CancellationToken cancellationToken = default)
Parameters
primaryUserId
stringThe ID of the primary account.
provider
stringThe type of the identity provider.
secondaryUserId
stringThe ID for the secondary account.
cancellationToken
CancellationTokenThe cancellation token to cancel operation.
Returns
- Task<IList<AccountLinkResponse>>
A IList<T> containing details about this account link.
UpdateAsync(string, UserUpdateRequest, CancellationToken)
Updates a user.
Task<User> UpdateAsync(string id, UserUpdateRequest request, CancellationToken cancellationToken = default)
Parameters
id
stringThe id of the user to update.
request
UserUpdateRequestThe UserUpdateRequest containing the information you wish to update.
cancellationToken
CancellationTokenThe cancellation token to cancel operation.
Returns
UpdateAuthenticationMethodAsync(string, string, AuthenticationMethodUpdateRequest, CancellationToken)
Update an authentication methods.
Task<AuthenticationMethod> UpdateAuthenticationMethodAsync(string userId, string authenticationMethodId, AuthenticationMethodUpdateRequest request, CancellationToken cancellationToken = default)
Parameters
userId
stringThe ID of the user for which you want to update the authentication methods
authenticationMethodId
stringThe ID of the authentication method you want to update.
request
AuthenticationMethodUpdateRequestThe AuthenticationMethodUpdateRequest containing the properties of the authentication methods to update.
cancellationToken
CancellationTokenThe cancellation token to cancel operation.
Returns
- Task<AuthenticationMethod>
The updated AuthenticationMethod.
UpdateAuthenticationMethodsAsync(string, IList<AuthenticationMethodsUpdateRequest>, CancellationToken)
Updates all authentication methods by replacing them with the given ones.
Task<IList<AuthenticationMethod>> UpdateAuthenticationMethodsAsync(string userId, IList<AuthenticationMethodsUpdateRequest> request, CancellationToken cancellationToken = default)
Parameters
userId
stringThe ID of the user for which you want to update the authentication methods.
request
IList<AuthenticationMethodsUpdateRequest>The AuthenticationMethodsUpdateRequest containing the properties of the authentication methods to update.
cancellationToken
CancellationTokenThe cancellation token to cancel operation.
Returns
- Task<IList<AuthenticationMethod>>
The updated list of AuthenticationMethod.