Saltar al contenido principal
POST
https://{tenantDomain}/api/v2
/
token-exchange-profiles
Go
package example

import (
    context "context"

    management "github.com/auth0/go-auth0/management/management"
    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>",
        ),
    )
    request := &management.CreateTokenExchangeProfileRequestContent{
        Name: "name",
        SubjectTokenType: "subject_token_type",
        ActionId: "action_id",
        Type: management.TokenExchangeProfileTypeEnum(
            "custom_authentication",
        ),
    }
    client.TokenExchangeProfiles.Create(
        context.TODO(),
        request,
    )
}
{
  "action_id": "<string>",
  "created_at": "2024-01-01T00:00:00.000Z",
  "id": "<string>",
  "name": "Token Exchange Profile 1",
  "subject_token_type": "<string>",
  "updated_at": "2024-01-01T00:00:00.000Z"
}

Autorizaciones

Authorization
string
header
requerido

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

Cuerpo

action_id
string
requerido

El ID de la Action de Custom Token Exchange que se ejecutará para este perfil a fin de validar el subject_token. La Action debe usar el desencadenador custom-token-exchange.

Required string length: 1 - 36
name
string
predeterminado:Token Exchange Profile 1
requerido

Nombre descriptivo de este perfil.

Required string length: 3 - 50
subject_token_type
string<url>
requerido

Tipo de token de sujeto de este perfil. Al recibir una solicitud de intercambio de tokens en la Authentication API, se ejecutará el perfil de intercambio de tokens correspondiente cuyo subject_token_type coincida. Debe ser un URI.

Required string length: 8 - 100
type
enum<string>
requerido

El tipo de perfil, que controla cómo se ejecutará el perfil al recibir una solicitud de intercambio de tokens.

Opciones disponibles:
custom_authentication
Required string length: 1 - 21

Respuesta

Perfil de intercambio de tokens creado correctamente.

action_id
string

El ID de la Action de Custom Token Exchange que se ejecutará para este perfil a fin de validar el subject_token. La Action debe usar el desencadenador custom-token-exchange.

Required string length: 1 - 36
created_at
string<date-time>
predeterminado:2024-01-01T00:00:00.000Z

La fecha y hora en que se creó este perfil.

id
string<token-exchange-profile-id>

El ID único del perfil de intercambio de tokens.

name
string
predeterminado:Token Exchange Profile 1

Nombre descriptivo de este perfil.

Required string length: 3 - 50
subject_token_type
string<url>

Tipo de token de sujeto de este perfil. Al recibir una solicitud de intercambio de tokens en la Authentication API, se ejecutará el perfil de intercambio de tokens correspondiente cuyo subject_token_type coincida. Debe ser un URI.

Required string length: 8 - 100
type
enum<string>

El tipo de perfil, que controla cómo se ejecutará el perfil al recibir una solicitud de intercambio de tokens.

Opciones disponibles:
custom_authentication
Required string length: 1 - 21
updated_at
string<date-time>
predeterminado:2024-01-01T00:00:00.000Z

La fecha y hora en que se actualizó este perfil.