Passer au contenu principal
GET
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"
)

func do() {
    client := client.NewClient(
        option.WithToken(
            "<token>",
        ),
    )
    client.Users.AuthenticationMethods.Get(
        context.TODO(),
        "id",
        "authentication_method_id",
    )
}
import { ManagementClient } from "auth0";

async function main() {
const client = new ManagementClient({
token: "<token>",
});
await client.users.authenticationMethods.get("id", "authentication_method_id");
}
main();
import { ManagementClient } from "auth0";

async function main() {
const client = new ManagementClient({
token: "<token>",
});
await client.users.authenticationMethods.get("id", "authentication_method_id");
}
main();
curl --request GET \
--url https://{tenantDomain}/api/v2/users/{id}/authentication-methods/{authentication_method_id} \
--header 'Authorization: Bearer <token>'
import requests

url = "https://{tenantDomain}/api/v2/users/{id}/authentication-methods/{authentication_method_id}"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.text)
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://{tenantDomain}/api/v2/users/{id}/authentication-methods/{authentication_method_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
HttpResponse<String> response = Unirest.get("https://{tenantDomain}/api/v2/users/{id}/authentication-methods/{authentication_method_id}")
.header("Authorization", "Bearer <token>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://{tenantDomain}/api/v2/users/{id}/authentication-methods/{authentication_method_id}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
{
  "id": "<string>",
  "created_at": "2023-11-07T05:31:56Z",
  "confirmed": true,
  "name": "<string>",
  "authentication_methods": [
    {
      "id": "<string>"
    }
  ],
  "link_id": "<string>",
  "phone_number": "<string>",
  "email": "<string>",
  "key_id": "<string>",
  "public_key": "<string>",
  "enrolled_at": "2023-11-07T05:31:56Z",
  "last_auth_at": "2023-11-07T05:31:56Z",
  "credential_device_type": "<string>",
  "credential_backed_up": true,
  "identity_user_id": "<string>",
  "user_agent": "<string>",
  "user_handle": "<string>",
  "transports": [
    "<string>"
  ],
  "aaguid": "<string>",
  "relying_party_identifier": "<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

The ID of the user in question.

authentication_method_id
string
requis

The ID of the authentication methods in question.

Réponse

Authentication method retrieved.

id
string
requis

The ID of the authentication method (auto generated)

type
enum<string>
requis
Options disponibles:
recovery-code,
totp,
push,
phone,
email,
email-verification,
webauthn-roaming,
webauthn-platform,
guardian,
passkey,
password
created_at
string<date-time>
requis

Authenticator creation date

confirmed
boolean

The authentication method status

name
string

A human-readable label to identify the authentication method

Maximum string length: 20
authentication_methods
object[]
preferred_authentication_method
enum<string>

Applies to phone authentication methods only. The preferred communication method.

Options disponibles:
voice,
sms

The ID of a linked authentication method. Linked authentication methods will be deleted together.

phone_number
string

Applies to phone authentication methods only. The destination phone number used to send verification codes via text and voice.

email
string

Applies to email and email-verification authentication methods only. The email address used to send verification messages.

key_id
string

Applies to webauthn authentication methods only. The ID of the generated credential.

public_key
string

Applies to webauthn authentication methods only. The public key.

enrolled_at
string<date-time>

Enrollment date

last_auth_at
string<date-time>

Last authentication

credential_device_type
string

Applies to passkeys only. The kind of device the credential is stored on as defined by backup eligibility. "single_device" credentials cannot be backed up and synced to another device, "multi_device" credentials can be backed up if enabled by the end-user.

credential_backed_up
boolean

Applies to passkeys only. Whether the credential was backed up.

identity_user_id
string

Applies to passkeys only. The ID of the user identity linked with the authentication method.

user_agent
string

Applies to passkeys only. The user-agent of the browser used to create the passkey.

user_handle
string

Applies to passkeys only. The user handle of the user identity.

transports
string[]

Applies to passkeys only. The transports used by clients to communicate with the authenticator.

aaguid
string

Applies to passkey authentication methods only. Authenticator Attestation Globally Unique Identifier.

relying_party_identifier
string

Applies to webauthn/passkey authentication methods only. The credential's relying party identifier.