C#
using Auth0.ManagementApi;
using System.Threading.Tasks;
using Auth0.ManagementApi.Users;
public partial class Examples
{
public async Task Example() {
var client = new ManagementApiClient(
token: "<token>",
clientOptions: new ClientOptions { BaseUrl = "https://{YOUR_DOMAIN}/api/v2" }
);
await client.Users.AuthenticationMethods.UpdateAsync(
id: "id",
authenticationMethodId: "authentication_method_id",
request: new UpdateUserAuthenticationMethodRequestContent()
);
}
}package example
import (
context "context"
management "github.com/auth0/go-auth0/v3/management"
client "github.com/auth0/go-auth0/v3/management/client"
option "github.com/auth0/go-auth0/v3/management/option"
)
func do() {
mgmt, err := client.New(
"{YOUR_DOMAIN}",
option.WithToken(
"<token>",
),
)
if err != nil {
return
}
request := &management.UpdateUserAuthenticationMethodRequestContent{}
mgmt.Users.AuthenticationMethods.Update(
context.TODO(),
"id",
"authentication_method_id",
request,
)
}
package com.example.usage;
import com.auth0.client.mgmt.ManagementApi;
import com.auth0.client.mgmt.users.types.UpdateUserAuthenticationMethodRequestContent;
public class Example {
public static void main(String[] args) {
ManagementApi client = ManagementApi
.builder()
.domain("{YOUR_DOMAIN}")
.token("<token>")
.build();
client.users().authenticationMethods().update(
"id",
"authentication_method_id",
UpdateUserAuthenticationMethodRequestContent
.builder()
.build()
);
}
}<?php
namespace Example;
use Auth0\SDK\API\Management\Wrapper\ManagementClient;
use Auth0\SDK\API\Management\Wrapper\ManagementClientOptions;
use Auth0\SDK\API\Management\Users\AuthenticationMethods\Requests\UpdateUserAuthenticationMethodRequestContent;
$client = new ManagementClient(new ManagementClientOptions(
domain: '{YOUR_DOMAIN}',
token: '<token>',
));
$client->users->authenticationMethods->update(
'id',
'authentication_method_id',
new UpdateUserAuthenticationMethodRequestContent([]),
);
from auth0.management import ManagementClient
client = ManagementClient(
domain="{YOUR_DOMAIN}",
token="<token>",
)
client.users.authentication_methods.update(
id="id",
authentication_method_id="authentication_method_id",
)
require "auth0"
client = Auth0::Management.new(token: "<token>", base_url: "https://{YOUR_DOMAIN}/api/v2")
client.users.authentication_methods.update(
id: "id",
authentication_method_id: "authentication_method_id"
)
import { ManagementClient } from "auth0";
async function main() {
const client = new ManagementClient({
domain: "{YOUR_DOMAIN}",
token: "<token>",
});
await client.users.authenticationMethods.update("id", "authentication_method_id", {});
}
main();
import { ManagementClient } from "auth0";
async function main() {
const client = new ManagementClient({
domain: "{YOUR_DOMAIN}",
token: "<token>",
});
await client.users.authenticationMethods.update("id", "authentication_method_id", {});
}
main();
curl --request PATCH \
--url https://{tenantDomain}/api/v2/users/{id}/authentication-methods/{authentication_method_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>"
}
'{
"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>"
}認証方法 ID で認証方法を更新
指定したユーザーの、指定した ID の認証方法を変更します。詳細は、Management API を使用して認証方法を管理するを参照してください。
PATCH
https://{tenantDomain}/api/v2
/
users
/
{id}
/
authentication-methods
/
{authentication_method_id}
C#
using Auth0.ManagementApi;
using System.Threading.Tasks;
using Auth0.ManagementApi.Users;
public partial class Examples
{
public async Task Example() {
var client = new ManagementApiClient(
token: "<token>",
clientOptions: new ClientOptions { BaseUrl = "https://{YOUR_DOMAIN}/api/v2" }
);
await client.Users.AuthenticationMethods.UpdateAsync(
id: "id",
authenticationMethodId: "authentication_method_id",
request: new UpdateUserAuthenticationMethodRequestContent()
);
}
}package example
import (
context "context"
management "github.com/auth0/go-auth0/v3/management"
client "github.com/auth0/go-auth0/v3/management/client"
option "github.com/auth0/go-auth0/v3/management/option"
)
func do() {
mgmt, err := client.New(
"{YOUR_DOMAIN}",
option.WithToken(
"<token>",
),
)
if err != nil {
return
}
request := &management.UpdateUserAuthenticationMethodRequestContent{}
mgmt.Users.AuthenticationMethods.Update(
context.TODO(),
"id",
"authentication_method_id",
request,
)
}
package com.example.usage;
import com.auth0.client.mgmt.ManagementApi;
import com.auth0.client.mgmt.users.types.UpdateUserAuthenticationMethodRequestContent;
public class Example {
public static void main(String[] args) {
ManagementApi client = ManagementApi
.builder()
.domain("{YOUR_DOMAIN}")
.token("<token>")
.build();
client.users().authenticationMethods().update(
"id",
"authentication_method_id",
UpdateUserAuthenticationMethodRequestContent
.builder()
.build()
);
}
}<?php
namespace Example;
use Auth0\SDK\API\Management\Wrapper\ManagementClient;
use Auth0\SDK\API\Management\Wrapper\ManagementClientOptions;
use Auth0\SDK\API\Management\Users\AuthenticationMethods\Requests\UpdateUserAuthenticationMethodRequestContent;
$client = new ManagementClient(new ManagementClientOptions(
domain: '{YOUR_DOMAIN}',
token: '<token>',
));
$client->users->authenticationMethods->update(
'id',
'authentication_method_id',
new UpdateUserAuthenticationMethodRequestContent([]),
);
from auth0.management import ManagementClient
client = ManagementClient(
domain="{YOUR_DOMAIN}",
token="<token>",
)
client.users.authentication_methods.update(
id="id",
authentication_method_id="authentication_method_id",
)
require "auth0"
client = Auth0::Management.new(token: "<token>", base_url: "https://{YOUR_DOMAIN}/api/v2")
client.users.authentication_methods.update(
id: "id",
authentication_method_id: "authentication_method_id"
)
import { ManagementClient } from "auth0";
async function main() {
const client = new ManagementClient({
domain: "{YOUR_DOMAIN}",
token: "<token>",
});
await client.users.authenticationMethods.update("id", "authentication_method_id", {});
}
main();
import { ManagementClient } from "auth0";
async function main() {
const client = new ManagementClient({
domain: "{YOUR_DOMAIN}",
token: "<token>",
});
await client.users.authenticationMethods.update("id", "authentication_method_id", {});
}
main();
curl --request PATCH \
--url https://{tenantDomain}/api/v2/users/{id}/authentication-methods/{authentication_method_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>"
}
'{
"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>"
}承認
bearerAuthoAuth2ClientCredentials
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
ボディ
application/jsonapplication/x-www-form-urlencoded
レスポンス
認証方法を更新しました。
正常に作成された認証方法。
利用可能なオプション:
phone, email, totp, webauthn-roaming パスキー認証方法にのみ適用されます。Authenticator Attestation Globally Unique Identifier。
Show child attributes
Show child attributes
この認証方法が確認済みかどうか。
認証方法の作成日
メール認証方法にのみ適用されます。確認メッセージの送信に使用されるメールアドレス。
新しく作成された認証方法の ID(アプリケーションによって自動生成されます)
webauthn 認証方法にのみ適用されます。credential の ID。
この認証方法を識別するためのわかりやすいラベル。
電話認証方法にのみ適用されます。テキストメッセージおよび音声で確認コードを送信するために使用される宛先の電話番号。
Required string length:
2 - 30phone 認証方法にのみ適用されます。優先される通信方法です。
利用可能なオプション:
voice, sms webauthn 認証方法にのみ適用されます。公開鍵。
webauthn 認証方法にのみ適用されます。Relying Party 識別子。
TOTP 生成用の Base32 エンコード済みシークレット
⌘I