Back to Node Auth0

Class AuthenticationMethodsClient

docs/classes/management.SDK.AuthenticationMethodsClient.html

5.9.114.2 KB
Original Source

Class AuthenticationMethodsClient

Index

Constructors

constructor

Methods

listcreatesetdeleteAllgetdeleteupdate

Properties

_options

Constructors

constructor

new AuthenticationMethodsClient(
options: BaseClientOptions,
): AuthenticationMethodsClient

Parameters

Returns AuthenticationMethodsClient

Methods

list

list(
id: string,
request?: ListUserAuthenticationMethodsRequestParameters,
requestOptions?: AuthenticationMethodsClient.RequestOptions,
): Promise<
Page<
UserAuthenticationMethod,
ListUserAuthenticationMethodsOffsetPaginatedResponseContent,
>,
>

Retrieve detailed list of authentication methods associated with a specified user.

Parameters

  • id: string

The ID of the user in question.

Request-specific configuration.

Returns Promise< Page< UserAuthenticationMethod, ListUserAuthenticationMethodsOffsetPaginatedResponseContent, >, >

Throws

Management.BadRequestError

Throws

Management.UnauthorizedError

Throws

Management.ForbiddenError

Throws

Management.NotFoundError

Throws

Management.TooManyRequestsError

Example

await client.users.authenticationMethods.list("id", { page: 1, per_page: 1, include_totals: true })Copy

create

create(
id: string,
request: CreateUserAuthenticationMethodRequestContent,
requestOptions?: AuthenticationMethodsClient.RequestOptions,
): HttpResponsePromise<CreateUserAuthenticationMethodResponseContent>

Create an authentication method. Authentication methods created via this endpoint will be auto confirmed and should already have verification completed.

Parameters

  • id: string

The ID of the user to whom the new authentication method will be assigned.

Request-specific configuration.

Returns HttpResponsePromise<CreateUserAuthenticationMethodResponseContent>

Throws

Management.BadRequestError

Throws

Management.UnauthorizedError

Throws

Management.ForbiddenError

Throws

Management.NotFoundError

Throws

Management.ConflictError

Throws

Management.TooManyRequestsError

Example

await client.users.authenticationMethods.create("id", { type: "phone" })Copy

set

set(
id: string,
request: SetUserAuthenticationMethodsRequestContent,
requestOptions?: AuthenticationMethodsClient.RequestOptions,
): HttpResponsePromise<SetUserAuthenticationMethodResponseContent[]>

Replace the specified user authentication methods with supplied values.

<b>Note</b>: Authentication methods supplied through this action do not iterate on existing methods. Instead, any methods passed will overwrite the user&#8217s existing settings.

Parameters

  • id: string

The ID of the user in question.

Request-specific configuration.

Returns HttpResponsePromise<SetUserAuthenticationMethodResponseContent[]>

Throws

Management.BadRequestError

Throws

Management.UnauthorizedError

Throws

Management.ForbiddenError

Throws

Management.ConflictError

Throws

Management.TooManyRequestsError

Example

await client.users.authenticationMethods.set("id", [{ type: "phone" }])Copy

deleteAll

deleteAll(
id: string,
requestOptions?: AuthenticationMethodsClient.RequestOptions,
): HttpResponsePromise<void>

Remove all authentication methods (i.e., enrolled MFA factors) from the specified user account. This action cannot be undone.

Parameters

  • id: string

The ID of the user in question.

Request-specific configuration.

Returns HttpResponsePromise<void>

Throws

Management.BadRequestError

Throws

Management.UnauthorizedError

Throws

Management.ForbiddenError

Throws

Management.TooManyRequestsError

Example

await client.users.authenticationMethods.deleteAll("id")Copy

get

get(
id: string,
authentication_method_id: string,
requestOptions?: AuthenticationMethodsClient.RequestOptions,
): HttpResponsePromise<GetUserAuthenticationMethodResponseContent>

Parameters

  • id: string

The ID of the user in question.

  • authentication_method_id: string

The ID of the authentication methods in question.

Request-specific configuration.

Returns HttpResponsePromise<GetUserAuthenticationMethodResponseContent>

Throws

Management.BadRequestError

Throws

Management.UnauthorizedError

Throws

Management.ForbiddenError

Throws

Management.NotFoundError

Throws

Management.TooManyRequestsError

Example

await client.users.authenticationMethods.get("id", "authentication_method_id")Copy

delete

delete(
id: string,
authentication_method_id: string,
requestOptions?: AuthenticationMethodsClient.RequestOptions,
): HttpResponsePromise<void>

Remove the authentication method with the given ID from the specified user. For more information, review Manage Authentication Methods with Management API.

Parameters

  • id: string

The ID of the user in question.

  • authentication_method_id: string

The ID of the authentication method to delete.

Request-specific configuration.

Returns HttpResponsePromise<void>

Throws

Management.BadRequestError

Throws

Management.UnauthorizedError

Throws

Management.ForbiddenError

Throws

Management.NotFoundError

Throws

Management.TooManyRequestsError

Example

await client.users.authenticationMethods.delete("id", "authentication_method_id")Copy

update

update(
id: string,
authentication_method_id: string,
request?: UpdateUserAuthenticationMethodRequestContent,
requestOptions?: AuthenticationMethodsClient.RequestOptions,
): HttpResponsePromise<UpdateUserAuthenticationMethodResponseContent>

Modify the authentication method with the given ID from the specified user. For more information, review Manage Authentication Methods with Management API.

Parameters

  • id: string

The ID of the user in question.

  • authentication_method_id: string

The ID of the authentication method to update.

Request-specific configuration.

Returns HttpResponsePromise<UpdateUserAuthenticationMethodResponseContent>

Throws

Management.BadRequestError

Throws

Management.UnauthorizedError

Throws

Management.ForbiddenError

Throws

Management.NotFoundError

Throws

Management.TooManyRequestsError

Example

await client.users.authenticationMethods.update("id", "authentication_method_id")Copy

Properties

Protected Readonly_options

_options: NormalizedClientOptionsWithAuth<BaseClientOptions>

Settings

Member Visibility

  • Protected
  • Inherited

ThemeOSLightDark

On This Page

Constructors constructor Methods listcreatesetdeleteAllgetdeleteupdate Properties _options