Struct UserManagement

Source
pub struct UserManagement<'a> { /* private fields */ }
Expand description

Implementations§

Source§

impl<'a> UserManagement<'a>

Source

pub fn new(workos: &'a WorkOs) -> Self

Returns a new UserManagement instance for the provided WorkOS client.

Trait Implementations§

Source§

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,

Authenticates a user using AuthKit, OAuth or an organization’s SSO connection. Read more
Source§

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,

Authenticates a user with an unverified email and verifies their email address. Read more
Source§

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,

Authenticates a user by verifying the Magic Auth code sent to the user’s email. Read more
Source§

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,

Authenticates a user with email and password. Read more
Source§

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,

Use this endpoint to exchange a refresh token for a new access token. Read more
Source§

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,

Authenticates a user enrolled into MFA using time-based one-time password (TOTP). Read more
Source§

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,

Creates a one-time authentication code that can be sent to the user’s email address. Read more
Source§

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,

Creates a one-time token that can be used to reset a user’s password. Read more
Source§

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,

Create a new user in the current environment. Read more
Source§

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,

Permanently deletes a user in the current environment. It cannot be undone. Read more
Source§

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,

Enrolls a user in a new authentication factor. Read more
Source§

impl GetAuthorizationUrl for UserManagement<'_>

Source§

fn get_authorization_url( &self, params: &GetAuthorizationUrlParams<'_>, ) -> Result<Url, ParseError>

Generates an OAuth 2.0 authorization URL to authenticate a user with AuthKit or SSO. Read more
Source§

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,

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<'_>

Source§

fn get_jwks<'life0, 'life1, 'async_trait>( &'life0 self, client_id: &'life1 ClientId, ) -> Pin<Box<dyn Future<Output = WorkOsResult<JwkSet, GetJwksError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get JSON Web Key Set (JWKS). Read more
Source§

impl GetJwksUrl for UserManagement<'_>

Source§

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<'_>

Source§

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<'_>

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,

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<'_>

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,

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<'_>

Source§

fn get_user<'life0, 'life1, 'async_trait>( &'life0 self, id: &'life1 UserId, ) -> Pin<Box<dyn Future<Output = WorkOsResult<User, GetUserError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get the details of an existing user. Read more
Source§

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,

Get the details of an existing user by an external identifier. Read more
Source§

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,

Get a list of identities associated with the user. Read more
Source§

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,

Lists the authentication factors for a user. Read more
Source§

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,

Retrieves a list of Users. Read more
Source§

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,

Sets a new password using the token query parameter from the link that the user received. Read more
Source§

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,

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,