# Extend Transaction Metadata to the Custom Token Exchange flow

**URL:** <https://community.auth0.com/t/extend-transaction-metadata-to-the-custom-token-exchange-flow/198640>\
**Category:** Product Feedback\
**Tags:** custom-claims, metadata, login\
**Created:** [April 3, 2026, 8:06pm UTC](https://community.auth0.com/t/extend-transaction-metadata-to-the-custom-token-exchange-flow/198640 "2026-04-03T20:06:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![shennessey](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/shennessey/32/70983_2.png) [@shennessey](https://community.auth0.com/u/shennessey)\
**Post date:** [April 3, 2026, 8:06pm UTC](https://community.auth0.com/t/extend-transaction-metadata-to-the-custom-token-exchange-flow/198640/1 "2026-04-03T20:06:07Z")

</div>

**Feature:** Allow transaction metadata set in a **Custom Token Exchange Action** to be read by the following **Post Login Action**

**Description:** The Transaction Metadata feature is an obviously superior method of passing data between actions than previous techniques (shoving it in user metadata or the api cache) and a welcome addition. But it isn’t available in the CTE Action (yet?).

**Use-case:** I want to use use CTE to re-use another identity provider for some things, but the subject\_token has some necessary information inside it that I need to be carried over as a custom claim in the issued token.

**Example:**

It would be great if we could do this:

```javascript
// The Custom Token Exchange Trigger
exports.onExecuteCustomTokenExchange = async (event, api) => {
  const { isValid, payload } = await validateToken(
    event.transaction.subject_token,
  );
  if (isValid) {
    api.authentication.setUserById(payload.sub);
    api.transaction.setMetadata('my_custom_claim', payload.my_custom_claim);
  }
  // etc.
};

// A post-login trigger
exports.onExecutePostLogin = async (event, api) => {
  // etc. etc.
  if (event.transaction.protocol === 'oauth2-token-exchange') {
    api.accessToken.setCustomClaim('urn:blah:custom', event.transaction?.metadata?.my_custom_claim);
  }
};

```

---

<div class="post-metadata">

**Author:** ![nik.baleca](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/nik.baleca/32/68749_2.png) [@nik.baleca](https://community.auth0.com/u/nik.baleca)\
**Post date:** [April 29, 2026, 7:09pm UTC](https://community.auth0.com/t/extend-transaction-metadata-to-the-custom-token-exchange-flow/198640/3 "2026-04-29T19:09:19Z")

</div>

Hi @shennessey

Thanks for submitting this feature card, do not forget to upvote it!

Currently, this feature is being addressed in our backlog, however, it does not have an ETA to when it will become available.

Kind Regards,  
Nik
