Passer au contenu principal
PUT
https://{tenantDomain}/api/v2
/
guardian
/
factors
/
{name}
Go
package example

import (
    client "github.com/auth0/go-auth0/management/client"
    option "github.com/auth0/go-auth0/management/option"
    context "context"
    management "github.com/auth0/go-auth0/management"
    guardian "github.com/auth0/go-auth0/management/guardian"
)

func do() () {
    client := client.NewClient(
        option.WithToken(
            "<token>",
        ),
    )
    client.Guardian.Factors.Set(
        context.TODO(),
        management.GuardianFactorNameEnumPushNotification,
        &guardian.SetGuardianFactorRequestContent{
            Enabled: true,
        },
    )
}
{
  "enabled": true
}

Autorisations

Authorization
string
header
requis

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

Paramètres de chemin

name
enum<string>
défaut:sms
requis

Factor name. Can be sms, push-notification, email, duo otp webauthn-roaming, webauthn-platform, or recovery-code.

Options disponibles:
push-notification,
sms,
email,
duo,
otp,
webauthn-roaming,
webauthn-platform,
recovery-code
Minimum string length: 1

Corps

enabled
boolean
requis

Whether this factor is enabled (true) or disabled (false).

Réponse

Factor updated successfully.

enabled
boolean
requis

Whether this factor is enabled (true) or disabled (false).