import { ManagementClient } from "auth0";
async function main() {
const client = new ManagementClient({
domain: "{YOUR_DOMAIN}",
token: "<token>",
});
await client.tokenExchangeProfiles.create({
name: "name",
subject_token_type: "subject_token_type",
action_id: "action_id",
type: "custom_authentication",
});
}
main();
import { ManagementClient } from "auth0";
async function main() {
const client = new ManagementClient({
domain: "{YOUR_DOMAIN}",
token: "<token>",
});
await client.tokenExchangeProfiles.create({
name: "name",
subject_token_type: "subject_token_type",
action_id: "action_id",
type: "custom_authentication",
});
}
main();
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.CreateTokenExchangeProfileRequestContent{
Name: "name",
SubjectTokenType: "subject_token_type",
ActionID: "action_id",
Type: management.TokenExchangeProfileTypeEnumCustomAuthentication,
}
mgmt.TokenExchangeProfiles.Create(
context.TODO(),
request,
)
}
# Ensure you're logged in: auth0 login
auth0 api post "token-exchange-profiles" --data '{
"name": "name",
"subject_token_type": "subject_token_type",
"action_id": "action_id",
"type": "custom_authentication"
}'using Auth0.ManagementApi;
using System.Threading.Tasks;
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.TokenExchangeProfiles.CreateAsync(
new CreateTokenExchangeProfileRequestContent {
Name = "name",
SubjectTokenType = "subject_token_type",
ActionId = "action_id",
Type = TokenExchangeProfileTypeEnum.CustomAuthentication
}
);
}
}
package com.example.usage;
import com.auth0.client.mgmt.ManagementApi;
import com.auth0.client.mgmt.types.CreateTokenExchangeProfileRequestContent;
import com.auth0.client.mgmt.types.TokenExchangeProfileTypeEnum;
public class Example {
public static void main(String[] args) {
ManagementApi client = ManagementApi
.builder()
.domain("{YOUR_DOMAIN}")
.token("<token>")
.build();
client.tokenExchangeProfiles().create(
CreateTokenExchangeProfileRequestContent
.builder()
.name("name")
.subjectTokenType("subject_token_type")
.actionId("action_id")
.type(TokenExchangeProfileTypeEnum.CUSTOM_AUTHENTICATION)
.build()
);
}
}<?php
namespace Example;
use Auth0\SDK\API\Management\Wrapper\ManagementClient;
use Auth0\SDK\API\Management\Wrapper\ManagementClientOptions;
use Auth0\SDK\API\Management\TokenExchangeProfiles\Requests\CreateTokenExchangeProfileRequestContent;
use Auth0\SDK\API\Management\Types\TokenExchangeProfileTypeEnum;
$client = new ManagementClient(new ManagementClientOptions(
domain: '{YOUR_DOMAIN}',
token: '<token>',
));
$client->tokenExchangeProfiles->create(
new CreateTokenExchangeProfileRequestContent([
'name' => 'name',
'subjectTokenType' => 'subject_token_type',
'actionId' => 'action_id',
'type' => TokenExchangeProfileTypeEnum::CustomAuthentication->value,
]),
);
from auth0.management import ManagementClient
client = ManagementClient(
domain="{YOUR_DOMAIN}",
token="<token>",
)
client.token_exchange_profiles.create(
name="name",
subject_token_type="subject_token_type",
action_id="action_id",
type="custom_authentication",
)
require "auth0"
client = Auth0::Management.new(token: "<token>", base_url: "https://{YOUR_DOMAIN}/api/v2")
client.token_exchange_profiles.create(
name: "name",
subject_token_type: "subject_token_type",
action_id: "action_id",
type: "custom_authentication"
)
curl --request POST \
--url https://{tenantDomain}/api/v2/token-exchange-profiles \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Token Exchange Profile 1",
"subject_token_type": "<string>",
"action_id": "<string>",
"type": "custom_authentication"
}
'{
"id": "<string>",
"name": "Token Exchange Profile 1",
"subject_token_type": "<string>",
"action_id": "<string>",
"type": "custom_authentication",
"created_at": "2024-01-01T00:00:00.000Z",
"updated_at": "2024-01-01T00:00:00.000Z"
}トークン交換プロファイルを作成
テナント内に新しいトークン交換プロファイルを作成します。
この機能を使用することにより、Okta’s Master Subscription Agreement に記載されている該当する無料トライアル条項に同意したものとみなされます。ユーザーの subject_token を安全に検証する責任はお客様にあります。詳細については、User Guide を参照してください。
import { ManagementClient } from "auth0";
async function main() {
const client = new ManagementClient({
domain: "{YOUR_DOMAIN}",
token: "<token>",
});
await client.tokenExchangeProfiles.create({
name: "name",
subject_token_type: "subject_token_type",
action_id: "action_id",
type: "custom_authentication",
});
}
main();
import { ManagementClient } from "auth0";
async function main() {
const client = new ManagementClient({
domain: "{YOUR_DOMAIN}",
token: "<token>",
});
await client.tokenExchangeProfiles.create({
name: "name",
subject_token_type: "subject_token_type",
action_id: "action_id",
type: "custom_authentication",
});
}
main();
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.CreateTokenExchangeProfileRequestContent{
Name: "name",
SubjectTokenType: "subject_token_type",
ActionID: "action_id",
Type: management.TokenExchangeProfileTypeEnumCustomAuthentication,
}
mgmt.TokenExchangeProfiles.Create(
context.TODO(),
request,
)
}
# Ensure you're logged in: auth0 login
auth0 api post "token-exchange-profiles" --data '{
"name": "name",
"subject_token_type": "subject_token_type",
"action_id": "action_id",
"type": "custom_authentication"
}'using Auth0.ManagementApi;
using System.Threading.Tasks;
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.TokenExchangeProfiles.CreateAsync(
new CreateTokenExchangeProfileRequestContent {
Name = "name",
SubjectTokenType = "subject_token_type",
ActionId = "action_id",
Type = TokenExchangeProfileTypeEnum.CustomAuthentication
}
);
}
}
package com.example.usage;
import com.auth0.client.mgmt.ManagementApi;
import com.auth0.client.mgmt.types.CreateTokenExchangeProfileRequestContent;
import com.auth0.client.mgmt.types.TokenExchangeProfileTypeEnum;
public class Example {
public static void main(String[] args) {
ManagementApi client = ManagementApi
.builder()
.domain("{YOUR_DOMAIN}")
.token("<token>")
.build();
client.tokenExchangeProfiles().create(
CreateTokenExchangeProfileRequestContent
.builder()
.name("name")
.subjectTokenType("subject_token_type")
.actionId("action_id")
.type(TokenExchangeProfileTypeEnum.CUSTOM_AUTHENTICATION)
.build()
);
}
}<?php
namespace Example;
use Auth0\SDK\API\Management\Wrapper\ManagementClient;
use Auth0\SDK\API\Management\Wrapper\ManagementClientOptions;
use Auth0\SDK\API\Management\TokenExchangeProfiles\Requests\CreateTokenExchangeProfileRequestContent;
use Auth0\SDK\API\Management\Types\TokenExchangeProfileTypeEnum;
$client = new ManagementClient(new ManagementClientOptions(
domain: '{YOUR_DOMAIN}',
token: '<token>',
));
$client->tokenExchangeProfiles->create(
new CreateTokenExchangeProfileRequestContent([
'name' => 'name',
'subjectTokenType' => 'subject_token_type',
'actionId' => 'action_id',
'type' => TokenExchangeProfileTypeEnum::CustomAuthentication->value,
]),
);
from auth0.management import ManagementClient
client = ManagementClient(
domain="{YOUR_DOMAIN}",
token="<token>",
)
client.token_exchange_profiles.create(
name="name",
subject_token_type="subject_token_type",
action_id="action_id",
type="custom_authentication",
)
require "auth0"
client = Auth0::Management.new(token: "<token>", base_url: "https://{YOUR_DOMAIN}/api/v2")
client.token_exchange_profiles.create(
name: "name",
subject_token_type: "subject_token_type",
action_id: "action_id",
type: "custom_authentication"
)
curl --request POST \
--url https://{tenantDomain}/api/v2/token-exchange-profiles \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Token Exchange Profile 1",
"subject_token_type": "<string>",
"action_id": "<string>",
"type": "custom_authentication"
}
'{
"id": "<string>",
"name": "Token Exchange Profile 1",
"subject_token_type": "<string>",
"action_id": "<string>",
"type": "custom_authentication",
"created_at": "2024-01-01T00:00:00.000Z",
"updated_at": "2024-01-01T00:00:00.000Z"
}承認
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
ボディ
このプロファイルの表示名。
3 - 50このプロファイルのサブジェクトトークンタイプ。Authentication APIでトークン交換リクエストを受信すると、subject_token_typeが一致する対応するトークン交換プロファイルが実行されます。これはURIである必要があります。
8 - 100subject_tokenを検証するために、このプロファイルに対して実行するカスタムトークン交換ActionのID。Actionはcustom-token-exchangeトリガーを使用する必要があります。
1 - 36このプロファイルの種別。トークン交換リクエストを受信した際に、プロファイルをどのように実行するかを制御します。
custom_authentication 1 - 21レスポンス
トークン交換プロファイルが正常に作成されました。
トークン交換プロファイルの一意のID。
このプロファイルの表示名。
3 - 50このプロファイルのサブジェクトトークンタイプ。Authentication APIでトークン交換リクエストを受信すると、subject_token_typeが一致する対応するトークン交換プロファイルが実行されます。これはURIである必要があります。
8 - 100subject_tokenを検証するために、このプロファイルに対して実行するカスタムトークン交換ActionのID。Actionはcustom-token-exchangeトリガーを使用する必要があります。
1 - 36このプロファイルの種別。トークン交換リクエストを受信した際に、プロファイルをどのように実行するかを制御します。
custom_authentication 1 - 21このプロファイルが作成された日時。
このプロファイルが更新された日時。