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
idstringThe ID of the user to assign permissions to.
requestAssignPermissionsRequestA AssignPermissionsRequest containing the permission identifiers to assign to the user.
cancellationTokenCancellationTokenThe 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
idstringThe ID of the user to assign roles to.
requestAssignRolesRequestA AssignRolesRequest containing the role IDs to assign to the user.
cancellationTokenCancellationTokenThe cancellation token to cancel operation.
Returns
CreateAsync(UserCreateRequest, CancellationToken)
Creates a new user.
Task<User> CreateAsync(UserCreateRequest request, CancellationToken cancellationToken = default)
Parameters
requestUserCreateRequestThe UserCreateRequest containing the properties of the user to create.
cancellationTokenCancellationTokenThe 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
userIdstringThe ID of the user for which you want to create the authentication method.
requestAuthenticationMethodCreateRequestThe AuthenticationMethodCreateRequest containing the properties of the authentication method to create.
cancellationTokenCancellationTokenThe 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
idstringThe 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
userIdstringThe ID of the user for which you want to delete the authentication methods.
authenticationMethodIdstringThe ID of the authentication method you want to delete.
cancellationTokenCancellationTokenThe 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
userIdstringThe ID of the user for which you want to update the authentication methods.
cancellationTokenCancellationTokenThe 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
idstringThe id of the user who multi factor provider to delete.
providerstringThe type of the multifactor provider. Supported values 'duo' or 'google-authenticator'.
cancellationTokenCancellationTokenThe cancellation token to cancel operation.
Returns
GenerateRecoveryCodeAsync(string, CancellationToken)
Generate new Guardian recovery code.
Task<GenerateRecoveryCodeResponse> GenerateRecoveryCodeAsync(string id, CancellationToken cancellationToken = default)
Parameters
idstringThe user_id of the user which guardian code will be regenerated.
cancellationTokenCancellationTokenThe 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
requestGetUsersRequestSpecifies criteria to use when querying users.
paginationPaginationInfoSpecifies pagination info to use when requesting paged results.
cancellationTokenCancellationTokenThe 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
userIdstringThe ID of the user for which you want to retrieve the organizations.
paginationPaginationInfoSpecifies pagination info to use when requesting paged results.
cancellationTokenCancellationTokenThe 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
idstringThe id of the user to retrieve.
fieldsstringA comma separated list of fields to include or exclude (depending on includeFields) from the result, empty to retrieve all fields
includeFieldsbooltrue if the fields specified are to be included in the result, false otherwise (defaults to true)
cancellationTokenCancellationTokenThe 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
userIdstringThe ID of the user for which you want to retrieve the authentication method.
authenticationMethodIdstringThe ID of the authentication method you want to retrieve.
cancellationTokenCancellationTokenThe 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
userIdstringThe ID of the user for which you want to retrieve the authentication methods.
paginationPaginationInfoSpecifies pagination info to use when requesting paged results.
cancellationTokenCancellationTokenThe 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
idstringThe user_id of the user to retrieve.
cancellationTokenCancellationTokenThe 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
requestGetUserLogsRequestSpecifies criteria to use when querying logs for a user.
paginationPaginationInfoSpecifies pagination info to use when requesting paged results.
cancellationTokenCancellationTokenThe 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
idstringThe id of the user to obtain the permissions for.
paginationPaginationInfoSpecifies PaginationInfo to use in requesting paged results.
cancellationTokenCancellationTokenThe cancellation token to cancel operation.
Returns
- Task<IPagedList<UserPermission>>
An IPagedList<T> containing the assigned permissions for this user.
GetRolesAsync(string, PaginationInfo, CancellationToken)
Retrieve assigned roles for a specific user.
Task<IPagedList<Role>> GetRolesAsync(string userId, PaginationInfo pagination = null, CancellationToken cancellationToken = default)
Parameters
userIdstringThe user id of the roles to retrieve.
paginationPaginationInfoSpecifies pagination info to use when requesting paged results.
cancellationTokenCancellationTokenThe cancellation token to cancel operation.
Returns
- Task<IPagedList<Role>>
An IPagedList<T> containing the roles for the user.
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
emailstringThe email address to search for.
fieldsstringA comma separated list of fields to include or exclude (depending on
includeFields) from the result, null to retrieve all fields.includeFieldsbool?true if the fields specified are to be included in the result, false otherwise. Defaults to true.
cancellationTokenCancellationTokenThe cancellation token to cancel operation.
Returns
InvalidateRememberBrowserAsync(string, CancellationToken)
Invalidate all remembered browsers for MFA.
Task InvalidateRememberBrowserAsync(string id, CancellationToken cancellationToken = default)
Parameters
idstringThe user_id of the user which will have its remembered browsers for MFA invalidated.
cancellationTokenCancellationTokenThe 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
idstringThe ID of the primary account.
requestUserAccountLinkRequestThe UserAccountLinkRequest containing details of the secondary account to link.
cancellationTokenCancellationTokenThe 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
idstringThe ID of the primary account.
primaryJwtTokenstringThe JWT of the primary account.
secondaryJwtTokenstringThe JWT for the secondary account you wish to link.
cancellationTokenCancellationTokenThe 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
idstringThe ID of the user to remove permissions from.
requestAssignPermissionsRequestA AssignPermissionsRequest containing the permission identifiers to remove from the user.
cancellationTokenCancellationTokenThe 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
idstringThe ID of the user to remove roles from.
requestAssignRolesRequestA AssignRolesRequest containing the role IDs to remove to the user.
cancellationTokenCancellationTokenThe 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
primaryUserIdstringThe ID of the primary account.
providerstringThe type of the identity provider.
secondaryUserIdstringThe ID for the secondary account.
cancellationTokenCancellationTokenThe 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
idstringThe id of the user to update.
requestUserUpdateRequestThe UserUpdateRequest containing the information you wish to update.
cancellationTokenCancellationTokenThe 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
userIdstringThe ID of the user for which you want to update the authentication methods
authenticationMethodIdstringThe ID of the authentication method you want to update.
requestAuthenticationMethodUpdateRequestThe AuthenticationMethodUpdateRequest containing the properties of the authentication methods to update.
cancellationTokenCancellationTokenThe 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
userIdstringThe ID of the user for which you want to update the authentication methods.
requestIList<AuthenticationMethodsUpdateRequest>The AuthenticationMethodsUpdateRequest containing the properties of the authentication methods to update.
cancellationTokenCancellationTokenThe cancellation token to cancel operation.
Returns
- Task<IList<AuthenticationMethod>>
The updated list of AuthenticationMethod.