1. Packages
  2. Auth0 Provider
  3. API Docs
  4. TokenExchangeProfile
Auth0 v3.16.0 published on Wednesday, Mar 12, 2025 by Pulumi

auth0.TokenExchangeProfile

Explore with Pulumi AI

With this resource, you can manage Auth0 Custom Token Exchange Profiles

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as auth0 from "@pulumi/auth0";

// Below action is created with custom-token-exchange as supported_triggers
// This action is then linked using the action_id param to the token-exchange profile
const myAction = new auth0.Action("my_action", {
    name: "TokenExchange-Action",
    code: `exports.onContinuePostLogin = async (event, api) => {
\x09console.log("foo")
};"
`,
    deploy: true,
    supportedTriggers: {
        id: "custom-token-exchange",
        version: "v1",
    },
});
const myTokenExchangeProfile = new auth0.TokenExchangeProfile("my_token_exchange_profile", {
    name: "token-exchange-prof",
    subjectTokenType: "https://acme.com/cis-token",
    actionId: myAction.id,
    type: "custom_authentication",
});
Copy
import pulumi
import pulumi_auth0 as auth0

# Below action is created with custom-token-exchange as supported_triggers
# This action is then linked using the action_id param to the token-exchange profile
my_action = auth0.Action("my_action",
    name="TokenExchange-Action",
    code="""exports.onContinuePostLogin = async (event, api) => {
\x09console.log("foo")
};"
""",
    deploy=True,
    supported_triggers={
        "id": "custom-token-exchange",
        "version": "v1",
    })
my_token_exchange_profile = auth0.TokenExchangeProfile("my_token_exchange_profile",
    name="token-exchange-prof",
    subject_token_type="https://acme.com/cis-token",
    action_id=my_action.id,
    type="custom_authentication")
Copy
package main

import (
	"github.com/pulumi/pulumi-auth0/sdk/v3/go/auth0"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		// Below action is created with custom-token-exchange as supported_triggers
		// This action is then linked using the action_id param to the token-exchange profile
		myAction, err := auth0.NewAction(ctx, "my_action", &auth0.ActionArgs{
			Name:   pulumi.String("TokenExchange-Action"),
			Code:   pulumi.String("exports.onContinuePostLogin = async (event, api) => {\n	console.log(\"foo\")\n};\"\n"),
			Deploy: pulumi.Bool(true),
			SupportedTriggers: &auth0.ActionSupportedTriggersArgs{
				Id:      pulumi.String("custom-token-exchange"),
				Version: pulumi.String("v1"),
			},
		})
		if err != nil {
			return err
		}
		_, err = auth0.NewTokenExchangeProfile(ctx, "my_token_exchange_profile", &auth0.TokenExchangeProfileArgs{
			Name:             pulumi.String("token-exchange-prof"),
			SubjectTokenType: pulumi.String("https://acme.com/cis-token"),
			ActionId:         myAction.ID(),
			Type:             pulumi.String("custom_authentication"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Auth0 = Pulumi.Auth0;

return await Deployment.RunAsync(() => 
{
    // Below action is created with custom-token-exchange as supported_triggers
    // This action is then linked using the action_id param to the token-exchange profile
    var myAction = new Auth0.Action("my_action", new()
    {
        Name = "TokenExchange-Action",
        Code = @"exports.onContinuePostLogin = async (event, api) => {
	console.log(""foo"")
};""
",
        Deploy = true,
        SupportedTriggers = new Auth0.Inputs.ActionSupportedTriggersArgs
        {
            Id = "custom-token-exchange",
            Version = "v1",
        },
    });

    var myTokenExchangeProfile = new Auth0.TokenExchangeProfile("my_token_exchange_profile", new()
    {
        Name = "token-exchange-prof",
        SubjectTokenType = "https://acme.com/cis-token",
        ActionId = myAction.Id,
        Type = "custom_authentication",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.auth0.Action;
import com.pulumi.auth0.ActionArgs;
import com.pulumi.auth0.inputs.ActionSupportedTriggersArgs;
import com.pulumi.auth0.TokenExchangeProfile;
import com.pulumi.auth0.TokenExchangeProfileArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        // Below action is created with custom-token-exchange as supported_triggers
        // This action is then linked using the action_id param to the token-exchange profile
        var myAction = new Action("myAction", ActionArgs.builder()
            .name("TokenExchange-Action")
            .code("""
exports.onContinuePostLogin = async (event, api) => {
	console.log("foo")
};"
            """)
            .deploy(true)
            .supportedTriggers(ActionSupportedTriggersArgs.builder()
                .id("custom-token-exchange")
                .version("v1")
                .build())
            .build());

        var myTokenExchangeProfile = new TokenExchangeProfile("myTokenExchangeProfile", TokenExchangeProfileArgs.builder()
            .name("token-exchange-prof")
            .subjectTokenType("https://acme.com/cis-token")
            .actionId(myAction.id())
            .type("custom_authentication")
            .build());

    }
}
Copy
resources:
  myTokenExchangeProfile:
    type: auth0:TokenExchangeProfile
    name: my_token_exchange_profile
    properties:
      name: token-exchange-prof
      subjectTokenType: https://acme.com/cis-token
      actionId: ${myAction.id}
      type: custom_authentication
  # Below action is created with custom-token-exchange as supported_triggers
  # This action is then linked using the action_id param to the token-exchange profile
  myAction:
    type: auth0:Action
    name: my_action
    properties:
      name: TokenExchange-Action
      code: |
        exports.onContinuePostLogin = async (event, api) => {
        	console.log("foo")
        };"        
      deploy: true
      supportedTriggers:
        id: custom-token-exchange
        version: v1
Copy

Create TokenExchangeProfile Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new TokenExchangeProfile(name: string, args?: TokenExchangeProfileArgs, opts?: CustomResourceOptions);
@overload
def TokenExchangeProfile(resource_name: str,
                         args: Optional[TokenExchangeProfileArgs] = None,
                         opts: Optional[ResourceOptions] = None)

@overload
def TokenExchangeProfile(resource_name: str,
                         opts: Optional[ResourceOptions] = None,
                         action_id: Optional[str] = None,
                         name: Optional[str] = None,
                         subject_token_type: Optional[str] = None,
                         type: Optional[str] = None)
func NewTokenExchangeProfile(ctx *Context, name string, args *TokenExchangeProfileArgs, opts ...ResourceOption) (*TokenExchangeProfile, error)
public TokenExchangeProfile(string name, TokenExchangeProfileArgs? args = null, CustomResourceOptions? opts = null)
public TokenExchangeProfile(String name, TokenExchangeProfileArgs args)
public TokenExchangeProfile(String name, TokenExchangeProfileArgs args, CustomResourceOptions options)
type: auth0:TokenExchangeProfile
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args TokenExchangeProfileArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args TokenExchangeProfileArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args TokenExchangeProfileArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args TokenExchangeProfileArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. TokenExchangeProfileArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var tokenExchangeProfileResource = new Auth0.TokenExchangeProfile("tokenExchangeProfileResource", new()
{
    ActionId = "string",
    Name = "string",
    SubjectTokenType = "string",
    Type = "string",
});
Copy
example, err := auth0.NewTokenExchangeProfile(ctx, "tokenExchangeProfileResource", &auth0.TokenExchangeProfileArgs{
	ActionId:         pulumi.String("string"),
	Name:             pulumi.String("string"),
	SubjectTokenType: pulumi.String("string"),
	Type:             pulumi.String("string"),
})
Copy
var tokenExchangeProfileResource = new TokenExchangeProfile("tokenExchangeProfileResource", TokenExchangeProfileArgs.builder()
    .actionId("string")
    .name("string")
    .subjectTokenType("string")
    .type("string")
    .build());
Copy
token_exchange_profile_resource = auth0.TokenExchangeProfile("tokenExchangeProfileResource",
    action_id="string",
    name="string",
    subject_token_type="string",
    type="string")
Copy
const tokenExchangeProfileResource = new auth0.TokenExchangeProfile("tokenExchangeProfileResource", {
    actionId: "string",
    name: "string",
    subjectTokenType: "string",
    type: "string",
});
Copy
type: auth0:TokenExchangeProfile
properties:
    actionId: string
    name: string
    subjectTokenType: string
    type: string
Copy

TokenExchangeProfile Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The TokenExchangeProfile resource accepts the following input properties:

ActionId string
Unique identifier of the Action
Name string
Name of the token exchange profile.
SubjectTokenType string
Type of the subject token
Type string
Type of the token exchange profile
ActionId string
Unique identifier of the Action
Name string
Name of the token exchange profile.
SubjectTokenType string
Type of the subject token
Type string
Type of the token exchange profile
actionId String
Unique identifier of the Action
name String
Name of the token exchange profile.
subjectTokenType String
Type of the subject token
type String
Type of the token exchange profile
actionId string
Unique identifier of the Action
name string
Name of the token exchange profile.
subjectTokenType string
Type of the subject token
type string
Type of the token exchange profile
action_id str
Unique identifier of the Action
name str
Name of the token exchange profile.
subject_token_type str
Type of the subject token
type str
Type of the token exchange profile
actionId String
Unique identifier of the Action
name String
Name of the token exchange profile.
subjectTokenType String
Type of the subject token
type String
Type of the token exchange profile

Outputs

All input properties are implicitly available as output properties. Additionally, the TokenExchangeProfile resource produces the following output properties:

CreatedAt string
The ISO 8601 formatted date the credential was created.
Id string
The provider-assigned unique ID for this managed resource.
UpdatedAt string
The ISO 8601 formatted date the credential was updated.
CreatedAt string
The ISO 8601 formatted date the credential was created.
Id string
The provider-assigned unique ID for this managed resource.
UpdatedAt string
The ISO 8601 formatted date the credential was updated.
createdAt String
The ISO 8601 formatted date the credential was created.
id String
The provider-assigned unique ID for this managed resource.
updatedAt String
The ISO 8601 formatted date the credential was updated.
createdAt string
The ISO 8601 formatted date the credential was created.
id string
The provider-assigned unique ID for this managed resource.
updatedAt string
The ISO 8601 formatted date the credential was updated.
created_at str
The ISO 8601 formatted date the credential was created.
id str
The provider-assigned unique ID for this managed resource.
updated_at str
The ISO 8601 formatted date the credential was updated.
createdAt String
The ISO 8601 formatted date the credential was created.
id String
The provider-assigned unique ID for this managed resource.
updatedAt String
The ISO 8601 formatted date the credential was updated.

Look up Existing TokenExchangeProfile Resource

Get an existing TokenExchangeProfile resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: TokenExchangeProfileState, opts?: CustomResourceOptions): TokenExchangeProfile
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        action_id: Optional[str] = None,
        created_at: Optional[str] = None,
        name: Optional[str] = None,
        subject_token_type: Optional[str] = None,
        type: Optional[str] = None,
        updated_at: Optional[str] = None) -> TokenExchangeProfile
func GetTokenExchangeProfile(ctx *Context, name string, id IDInput, state *TokenExchangeProfileState, opts ...ResourceOption) (*TokenExchangeProfile, error)
public static TokenExchangeProfile Get(string name, Input<string> id, TokenExchangeProfileState? state, CustomResourceOptions? opts = null)
public static TokenExchangeProfile get(String name, Output<String> id, TokenExchangeProfileState state, CustomResourceOptions options)
resources:  _:    type: auth0:TokenExchangeProfile    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
ActionId string
Unique identifier of the Action
CreatedAt string
The ISO 8601 formatted date the credential was created.
Name string
Name of the token exchange profile.
SubjectTokenType string
Type of the subject token
Type string
Type of the token exchange profile
UpdatedAt string
The ISO 8601 formatted date the credential was updated.
ActionId string
Unique identifier of the Action
CreatedAt string
The ISO 8601 formatted date the credential was created.
Name string
Name of the token exchange profile.
SubjectTokenType string
Type of the subject token
Type string
Type of the token exchange profile
UpdatedAt string
The ISO 8601 formatted date the credential was updated.
actionId String
Unique identifier of the Action
createdAt String
The ISO 8601 formatted date the credential was created.
name String
Name of the token exchange profile.
subjectTokenType String
Type of the subject token
type String
Type of the token exchange profile
updatedAt String
The ISO 8601 formatted date the credential was updated.
actionId string
Unique identifier of the Action
createdAt string
The ISO 8601 formatted date the credential was created.
name string
Name of the token exchange profile.
subjectTokenType string
Type of the subject token
type string
Type of the token exchange profile
updatedAt string
The ISO 8601 formatted date the credential was updated.
action_id str
Unique identifier of the Action
created_at str
The ISO 8601 formatted date the credential was created.
name str
Name of the token exchange profile.
subject_token_type str
Type of the subject token
type str
Type of the token exchange profile
updated_at str
The ISO 8601 formatted date the credential was updated.
actionId String
Unique identifier of the Action
createdAt String
The ISO 8601 formatted date the credential was created.
name String
Name of the token exchange profile.
subjectTokenType String
Type of the subject token
type String
Type of the token exchange profile
updatedAt String
The ISO 8601 formatted date the credential was updated.

Import

This resource can be imported using the token exchange profile ID.

Example:

$ pulumi import auth0:index/tokenExchangeProfile:TokenExchangeProfile profile "tep_XXXXXXXXXXXXXX"
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
Auth0 pulumi/pulumi-auth0
License
Apache-2.0
Notes
This Pulumi package is based on the auth0 Terraform Provider.