# Triggers-\>postLogin-\>exports.onExecutePostLogin | Not reflect custom data | Not working

**URL:** <https://community.auth0.com/t/triggers-postlogin-exports-onexecutepostlogin-not-reflect-custom-data-not-working/169295>\
**Category:** Get Help\
**Tags:** new-universal-login-experience, login-experience\
**Created:** [January 19, 2025, 4:38pm UTC](https://community.auth0.com/t/triggers-postlogin-exports-onexecutepostlogin-not-reflect-custom-data-not-working/169295 "2025-01-19T16:38:58Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![vova](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/vova/32/61679_2.png) [@vova](https://community.auth0.com/u/vova)\
**Post date:** [January 19, 2025, 4:38pm UTC](https://community.auth0.com/t/triggers-postlogin-exports-onexecutepostlogin-not-reflect-custom-data-not-working/169295/1 "2025-01-19T16:38:58Z")

</div>

Hello all,  
Need your help or advice:

Trying to pass any custom data via setCustomClaim but without success.  
**Missing pemissions or any checkbox to set to enable pass custom data on token?**

```
api.accessToken.setCustomClaim('data1','data1');
api.idToken.setCustomClaim('data2', 'data2');

```

Trying to see on Token any custom data that I’m trying to pass but without success:

FE: @auth0/auth0-spa-js

```auto
auth0ClientInstance = new Auth0Client(with relevant info +   
  authorizationParams: {
      audience: 'https://my-auth0.com/api/v2/',
      redirect_uri: window.location.origin + '/auth/auth0/callback',
    });

Token = auth0ClientInstance.getTokenSilently()

```

Currently on Token only data below:

```auto
{
  "iss": "https://https://my-auth0.com/",
  "sub": "auth0|asdasdasdadadad",
  "aud": [
    "https://https://my-auth0.com/api/v2/",
    "https://https://my-auth0.com/userinfo"
  ],
  "iat": 1737303638,
  "exp": 1737390038,
  "scope": "openid profile email",
  "org_id": "org_adsasdasdadad",
  "azp": "ssdasdadasdasdadadad"
}

```

---

<div class="post-metadata">

**Author:** ![sumansaurav](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/sumansaurav/32/70627_2.png) [@sumansaurav](https://community.auth0.com/u/sumansaurav)\
**Post date:** [January 21, 2025, 5:53am UTC](https://community.auth0.com/t/triggers-postlogin-exports-onexecutepostlogin-not-reflect-custom-data-not-working/169295/3 "2025-01-21T05:53:57Z")

</div>

Hi @vova ,

Please look at this documentation to set custom claims on access\_token.

> **[Create Custom Claims](https://auth0.com/docs/secure/tokens/json-web-tokens/create-custom-claims#create-custom-claims)**
>
> Learn how to create collision-resistant names for custom claims.

You would want to use `onExecuteCredentialsExchange` in your action.

---

<div class="post-metadata">

**Author:** ![dawid.matuszczyk](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dawid.matuszczyk/32/74550_2.png) [@dawid.matuszczyk](https://community.auth0.com/u/dawid.matuszczyk)\
**Post date:** [January 28, 2025, 1:49pm UTC](https://community.auth0.com/t/triggers-postlogin-exports-onexecutepostlogin-not-reflect-custom-data-not-working/169295/4 "2025-01-28T13:49:00Z")

</div>

Hi @vova

Welcome to the Auth0 Community!

Thank you for posting your question, I’ve checked your action code in my tenant, and it correctly added claims to the ID Token and access token. Could you check if your application is passing the audience in the request? I’m guessing that you could be getting an opaque token, not a valid JWT → [Why Access Token Is Not a JWT (Opaque Token)](https://community.auth0.com/t/why-access-token-is-not-a-jwt-opaque-token/31028). You can also use Auth0 CLI with `auth0 test token` command to check the access token.

Thanks  
Dawid

---

<div class="post-metadata">

**Author:** ![vova](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/vova/32/61679_2.png) [@vova](https://community.auth0.com/u/vova)\
**Post date:** [January 30, 2025, 7:54am UTC](https://community.auth0.com/t/triggers-postlogin-exports-onexecutepostlogin-not-reflect-custom-data-not-working/169295/5 "2025-01-30T07:54:27Z")

</div>

Thank you for response, we manage to get claims but now **org\_id** dissappeared from token ;(

Q: To get org\_id on the acces token need any specific configuration/scope/audience\_permissions or any or this is should be a default behaviour?

---

<div class="post-metadata">

**Author:** ![vova](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/vova/32/61679_2.png) [@vova](https://community.auth0.com/u/vova)\
**Post date:** [January 30, 2025, 3:50pm UTC](https://community.auth0.com/t/triggers-postlogin-exports-onexecutepostlogin-not-reflect-custom-data-not-working/169295/6 "2025-01-30T15:50:33Z")

</div>

Thank you for your response!

We managed get custom claims but we faced with additional problem:

We have a regular Login flow with Select Organization.

1. User click on login then we have default Auth0 popup screen user enter user/pass and moved to selected organizations on default Auth0 select

2. After select organization moved to callback function getToken and proceed. All working good BUT:  
ISSUE: After initial login we don’t see on an access token the org\_id.  
But if user make switch organization by example below and pass in authorizationParams organizationId then access token include the org\_id but after initial login auth0Client!.loginWithRedirect() and default select organization flow by autQuesionh0 the access token not include org\_id.  
Q: What are we missing? Is it the correct process?

For internal switch account:  
auth0Client!.getTokenWithPopup({  
authorizationParams: {  
organization: orgId,  
},  
}

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [February 13, 2025, 3:51pm UTC](https://community.auth0.com/t/triggers-postlogin-exports-onexecutepostlogin-not-reflect-custom-data-not-working/169295/7 "2025-02-13T15:51:19Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
