pub struct UserManagement<'a> { /* private fields */ }
Expand description
User Management.
Implementations§
Source§impl<'a> UserManagement<'a>
impl<'a> UserManagement<'a>
Sourcepub fn new(workos: &'a WorkOs) -> Self
pub fn new(workos: &'a WorkOs) -> Self
Returns a new UserManagement
instance for the provided WorkOS client.
Trait Implementations§
Source§impl AuthenticateWithCode for UserManagement<'_>
impl AuthenticateWithCode for UserManagement<'_>
Source§fn authenticate_with_code<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
params: &'life1 AuthenticateWithCodeParams<'life2>,
) -> Pin<Box<dyn Future<Output = WorkOsResult<AuthenticationResponse, AuthenticateError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn authenticate_with_code<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
params: &'life1 AuthenticateWithCodeParams<'life2>,
) -> Pin<Box<dyn Future<Output = WorkOsResult<AuthenticationResponse, AuthenticateError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Authenticates a user using AuthKit, OAuth or an organization’s SSO connection. Read more
Source§impl AuthenticateWithEmailVerification for UserManagement<'_>
impl AuthenticateWithEmailVerification for UserManagement<'_>
Source§fn authenticate_with_email_verification<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
params: &'life1 AuthenticateWithEmailVerificationParams<'life2>,
) -> Pin<Box<dyn Future<Output = WorkOsResult<AuthenticationResponse, AuthenticateError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn authenticate_with_email_verification<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
params: &'life1 AuthenticateWithEmailVerificationParams<'life2>,
) -> Pin<Box<dyn Future<Output = WorkOsResult<AuthenticationResponse, AuthenticateError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Authenticates a user with an unverified email and verifies their email address. Read more
Source§impl AuthenticateWithMagicAuth for UserManagement<'_>
impl AuthenticateWithMagicAuth for UserManagement<'_>
Source§fn authenticate_with_magic_auth<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
params: &'life1 AuthenticateWithMagicAuthParams<'life2>,
) -> Pin<Box<dyn Future<Output = WorkOsResult<AuthenticationResponse, AuthenticateError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn authenticate_with_magic_auth<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
params: &'life1 AuthenticateWithMagicAuthParams<'life2>,
) -> Pin<Box<dyn Future<Output = WorkOsResult<AuthenticationResponse, AuthenticateError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Authenticates a user by verifying the Magic Auth code sent to the user’s email. Read more
Source§impl AuthenticateWithPassword for UserManagement<'_>
impl AuthenticateWithPassword for UserManagement<'_>
Source§fn authenticate_with_password<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
params: &'life1 AuthenticateWithPasswordParams<'life2>,
) -> Pin<Box<dyn Future<Output = WorkOsResult<AuthenticationResponse, AuthenticateError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn authenticate_with_password<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
params: &'life1 AuthenticateWithPasswordParams<'life2>,
) -> Pin<Box<dyn Future<Output = WorkOsResult<AuthenticationResponse, AuthenticateError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Authenticates a user with email and password. Read more
Source§impl AuthenticateWithRefreshToken for UserManagement<'_>
impl AuthenticateWithRefreshToken for UserManagement<'_>
Source§fn authenticate_with_refresh_token<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
params: &'life1 AuthenticateWithRefreshTokenParams<'life2>,
) -> Pin<Box<dyn Future<Output = WorkOsResult<AuthenticationResponse, AuthenticateError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn authenticate_with_refresh_token<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
params: &'life1 AuthenticateWithRefreshTokenParams<'life2>,
) -> Pin<Box<dyn Future<Output = WorkOsResult<AuthenticationResponse, AuthenticateError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Use this endpoint to exchange a refresh token for a new access token. Read more
Source§impl AuthenticateWithTotp for UserManagement<'_>
impl AuthenticateWithTotp for UserManagement<'_>
Source§fn authenticate_with_totp<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
params: &'life1 AuthenticateWithTotpParams<'life2>,
) -> Pin<Box<dyn Future<Output = WorkOsResult<AuthenticationResponse, AuthenticateError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn authenticate_with_totp<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
params: &'life1 AuthenticateWithTotpParams<'life2>,
) -> Pin<Box<dyn Future<Output = WorkOsResult<AuthenticationResponse, AuthenticateError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Authenticates a user enrolled into MFA using time-based one-time password (TOTP). Read more
Source§impl CreateMagicAuth for UserManagement<'_>
impl CreateMagicAuth for UserManagement<'_>
Source§fn create_magic_auth<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
params: &'life1 CreateMagicAuthParams<'life2>,
) -> Pin<Box<dyn Future<Output = WorkOsResult<MagicAuth, CreateMagicAuthError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn create_magic_auth<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
params: &'life1 CreateMagicAuthParams<'life2>,
) -> Pin<Box<dyn Future<Output = WorkOsResult<MagicAuth, CreateMagicAuthError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Creates a one-time authentication code that can be sent to the user’s email address. Read more
Source§impl CreatePasswordReset for UserManagement<'_>
impl CreatePasswordReset for UserManagement<'_>
Source§fn create_password_reset<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
params: &'life1 CreatePasswordResetParams<'life2>,
) -> Pin<Box<dyn Future<Output = WorkOsResult<PasswordReset, CreatePasswordResetError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn create_password_reset<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
params: &'life1 CreatePasswordResetParams<'life2>,
) -> Pin<Box<dyn Future<Output = WorkOsResult<PasswordReset, CreatePasswordResetError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Creates a one-time token that can be used to reset a user’s password. Read more
Source§impl CreateUser for UserManagement<'_>
impl CreateUser for UserManagement<'_>
Source§fn create_user<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
params: &'life1 CreateUserParams<'life2>,
) -> Pin<Box<dyn Future<Output = WorkOsResult<User, CreateUserError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn create_user<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
params: &'life1 CreateUserParams<'life2>,
) -> Pin<Box<dyn Future<Output = WorkOsResult<User, CreateUserError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Create a new user in the current environment. Read more
Source§impl DeleteUser for UserManagement<'_>
impl DeleteUser for UserManagement<'_>
Source§fn delete_user<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
params: &'life1 DeleteUserParams<'life2>,
) -> Pin<Box<dyn Future<Output = WorkOsResult<(), DeleteUserError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn delete_user<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
params: &'life1 DeleteUserParams<'life2>,
) -> Pin<Box<dyn Future<Output = WorkOsResult<(), DeleteUserError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Permanently deletes a user in the current environment. It cannot be undone. Read more
Source§impl EnrollAuthFactor for UserManagement<'_>
impl EnrollAuthFactor for UserManagement<'_>
Source§fn enroll_auth_factor<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
params: &'life1 EnrollAuthFactorParams<'life2>,
) -> Pin<Box<dyn Future<Output = WorkOsResult<EnrollAuthFactorResponse, EnrollAuthFactorError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn enroll_auth_factor<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
params: &'life1 EnrollAuthFactorParams<'life2>,
) -> Pin<Box<dyn Future<Output = WorkOsResult<EnrollAuthFactorResponse, EnrollAuthFactorError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Enrolls a user in a new authentication factor. Read more
Source§impl GetAuthorizationUrl for UserManagement<'_>
impl GetAuthorizationUrl for UserManagement<'_>
Generates an OAuth 2.0 authorization URL to authenticate a user with AuthKit or SSO. Read more
Source§impl GetEmailVerification for UserManagement<'_>
impl GetEmailVerification for UserManagement<'_>
Source§fn get_email_verification<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 EmailVerificationId,
) -> Pin<Box<dyn Future<Output = WorkOsResult<EmailVerification, GetEmailVerificationError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_email_verification<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 EmailVerificationId,
) -> Pin<Box<dyn Future<Output = WorkOsResult<EmailVerification, GetEmailVerificationError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get the details of an existing email verification code that can be used to send an email to a user for verification. Read more
Source§impl GetJwks for UserManagement<'_>
impl GetJwks for UserManagement<'_>
Source§impl GetJwksUrl for UserManagement<'_>
impl GetJwksUrl for UserManagement<'_>
Source§fn get_jwks_url(&self, client_id: &ClientId) -> Result<Url, ParseError>
fn get_jwks_url(&self, client_id: &ClientId) -> Result<Url, ParseError>
Returns a URL that hosts the JWKS for signing access tokens. Read more
Source§impl GetLogoutUrl for UserManagement<'_>
impl GetLogoutUrl for UserManagement<'_>
Source§fn get_logout_url(
&self,
params: &GetLogoutUrlParams<'_>,
) -> Result<Url, ParseError>
fn get_logout_url( &self, params: &GetLogoutUrlParams<'_>, ) -> Result<Url, ParseError>
Returns a logout URL the user’s browser should be redirected to. Read more
Source§impl GetMagicAuth for UserManagement<'_>
impl GetMagicAuth for UserManagement<'_>
Source§fn get_magic_auth<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 MagicAuthId,
) -> Pin<Box<dyn Future<Output = WorkOsResult<MagicAuth, GetMagicAuthError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_magic_auth<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 MagicAuthId,
) -> Pin<Box<dyn Future<Output = WorkOsResult<MagicAuth, GetMagicAuthError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get the details of an existing Magic Auth code that can be used to send an email to a user for authentication. Read more
Source§impl GetPasswordReset for UserManagement<'_>
impl GetPasswordReset for UserManagement<'_>
Source§fn get_password_reset<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 PasswordResetId,
) -> Pin<Box<dyn Future<Output = WorkOsResult<PasswordReset, GetPasswordResetError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_password_reset<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 PasswordResetId,
) -> Pin<Box<dyn Future<Output = WorkOsResult<PasswordReset, GetPasswordResetError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get the details of an existing password reset token that can be used to reset a user’s password. Read more
Source§impl GetUser for UserManagement<'_>
impl GetUser for UserManagement<'_>
Source§impl GetUserByExternalId for UserManagement<'_>
impl GetUserByExternalId for UserManagement<'_>
Source§fn get_user_by_external_id<'life0, 'life1, 'async_trait>(
&'life0 self,
external_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = WorkOsResult<User, GetUserByExternalIdError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_user_by_external_id<'life0, 'life1, 'async_trait>(
&'life0 self,
external_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = WorkOsResult<User, GetUserByExternalIdError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get the details of an existing user by an external identifier. Read more
Source§impl GetUserIdentities for UserManagement<'_>
impl GetUserIdentities for UserManagement<'_>
Source§fn get_user_identities<'life0, 'life1, 'async_trait>(
&'life0 self,
user_id: &'life1 UserId,
) -> Pin<Box<dyn Future<Output = WorkOsResult<Vec<Identity>, GetUserIdentitiesError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_user_identities<'life0, 'life1, 'async_trait>(
&'life0 self,
user_id: &'life1 UserId,
) -> Pin<Box<dyn Future<Output = WorkOsResult<Vec<Identity>, GetUserIdentitiesError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get a list of identities associated with the user. Read more
Source§impl ListAuthFactors for UserManagement<'_>
impl ListAuthFactors for UserManagement<'_>
Source§fn list_auth_factors<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
params: &'life1 ListAuthFactorsParams<'life2>,
) -> Pin<Box<dyn Future<Output = WorkOsResult<PaginatedList<AuthenticationFactor>, ()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn list_auth_factors<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
params: &'life1 ListAuthFactorsParams<'life2>,
) -> Pin<Box<dyn Future<Output = WorkOsResult<PaginatedList<AuthenticationFactor>, ()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Lists the authentication factors for a user. Read more
Source§impl ListUsers for UserManagement<'_>
impl ListUsers for UserManagement<'_>
Source§fn list_users<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
params: &'life1 ListUsersParams<'life2>,
) -> Pin<Box<dyn Future<Output = WorkOsResult<PaginatedList<User>, ListUsersError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn list_users<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
params: &'life1 ListUsersParams<'life2>,
) -> Pin<Box<dyn Future<Output = WorkOsResult<PaginatedList<User>, ListUsersError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Source§impl ResetPassword for UserManagement<'_>
impl ResetPassword for UserManagement<'_>
Source§fn reset_password<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
params: &'life1 ResetPasswordParams<'life2>,
) -> Pin<Box<dyn Future<Output = WorkOsResult<ResetPasswordResponse, ResetPasswordError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn reset_password<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
params: &'life1 ResetPasswordParams<'life2>,
) -> Pin<Box<dyn Future<Output = WorkOsResult<ResetPasswordResponse, ResetPasswordError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Sets a new password using the token query parameter from the link that the user received. Read more
Source§impl UpdateUser for UserManagement<'_>
impl UpdateUser for UserManagement<'_>
Source§fn update_user<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
params: &'life1 UpdateUserParams<'life2>,
) -> Pin<Box<dyn Future<Output = WorkOsResult<User, UpdateUserError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn update_user<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
params: &'life1 UpdateUserParams<'life2>,
) -> Pin<Box<dyn Future<Output = WorkOsResult<User, UpdateUserError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Updates properties of a user. The omitted properties will be left unchanged. Read more
Auto Trait Implementations§
impl<'a> Freeze for UserManagement<'a>
impl<'a> !RefUnwindSafe for UserManagement<'a>
impl<'a> Send for UserManagement<'a>
impl<'a> Sync for UserManagement<'a>
impl<'a> Unpin for UserManagement<'a>
impl<'a> !UnwindSafe for UserManagement<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more