Passer au contenu principal
PATCH
https://{tenantDomain}/api/v2
/
users
/
{id}
/
authentication-methods
/
{authentication_method_id}
Go
package example

import (
    context "context"

    client "github.com/auth0/go-auth0/management/management/client"
    option "github.com/auth0/go-auth0/management/management/option"
    users "github.com/auth0/go-auth0/management/management/users"
)

func do() {
    client := client.NewClient(
        option.WithToken(
            "<token>",
        ),
    )
    request := &users.UpdateUserAuthenticationMethodRequestContent{}
    client.Users.AuthenticationMethods.Update(
        context.TODO(),
        "id",
        "authentication_method_id",
        request,
    )
}
{
  "aaguid": "<string>",
  "authentication_methods": [
    {
      "id": "<string>"
    }
  ],
  "confirmed": true,
  "created_at": "2023-11-07T05:31:56Z",
  "email": "<string>",
  "id": "<string>",
  "key_id": "<string>",
  "name": "<string>",
  "phone_number": "<string>",
  "public_key": "<string>",
  "relying_party_identifier": "<string>",
  "totp_secret": "<string>"
}

Autorisations

Authorization
string
header
requis

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Paramètres de chemin

id
string
requis

L’id de l’utilisateur concerné.

authentication_method_id
string
requis

L’id de la méthode d’authentification à mettre à jour.

Corps

name
string

Libellé en langage clair permettant d’identifier la méthode d’authentification.

preferred_authentication_method
enum<string>

Méthode d’authentification par téléphone privilégiée

Options disponibles:
voice,
sms

Réponse

Méthode d’authentification mise à jour.

La méthode d’authentification créée avec succès.

type
enum<string>
requis
Options disponibles:
phone,
email,
totp,
webauthn-roaming
aaguid
string

S’applique uniquement aux méthodes d’authentification par clé d’accès. Identifiant global unique d’attestation de l’authentificateur.

authentication_methods
object[]
confirmed
boolean

Indique si la méthode d’authentification a été confirmée.

created_at
string<date-time>

Date de création de la méthode d’authentification

email
string

S’applique uniquement aux méthodes d’authentification par courriel. L’adresse de courriel utilisée pour envoyer des messages de vérification.

id
string<authenticator-id>

L’ID de la méthode d’authentification nouvellement créée (généré automatiquement par l’application)

key_id
string

S’applique uniquement aux méthodes d’authentification WebAuthn. L’id de l’information d’identification.

name
string

Libellé en langage clair permettant d’identifier la méthode d’authentification.

phone_number
string

S’applique uniquement aux méthodes d’authentification par téléphone. Le numéro de téléphone de destination utilisé pour envoyer des codes de vérification par message texte et par appel vocal.

Required string length: 2 - 30
preferred_authentication_method
enum<string>

S’applique uniquement aux méthodes d’authentification par téléphone. Méthode de communication privilégiée.

Options disponibles:
voice,
sms
public_key
string

S’applique uniquement aux méthodes d’authentification WebAuthn. La clé publique.

relying_party_identifier
string

S’applique uniquement aux méthodes d’authentification WebAuthn. L’identifiant du Relying Party.

totp_secret
string

Secret encodé en Base32 pour la génération de TOTP