# Add/Update Access Token Custom Claim WITHOUT flow/rule?

**URL:** <https://community.auth0.com/t/add-update-access-token-custom-claim-without-flow-rule/95790>\
**Category:** Get Help\
**Tags:** authentication-sessions, sessions\
**Created:** [December 6, 2022, 3:57pm UTC](https://community.auth0.com/t/add-update-access-token-custom-claim-without-flow-rule/95790 "2022-12-06T15:57:28Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![khawmingsheng](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/khawmingsheng/32/36488_2.png) [@khawmingsheng](https://community.auth0.com/u/khawmingsheng)\
**Post date:** [December 6, 2022, 3:57pm UTC](https://community.auth0.com/t/add-update-access-token-custom-claim-without-flow-rule/95790/1 "2022-12-06T15:57:28Z")

</div>

Hi, Currently im in a situation where **i need to update user’s custom claim in the access token**. The scenario **wont pass through any action/flow in auth0** , so I have no idea how to update the custom claim for the token. Need guidance about this, appreciate for any advice

---

<div class="post-metadata">

**Author:** ![rueben.tiow](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rueben.tiow/32/11646_2.png) [@rueben.tiow](https://community.auth0.com/u/rueben.tiow)\
**Post date:** [December 7, 2022, 1:10am UTC](https://community.auth0.com/t/add-update-access-token-custom-claim-without-flow-rule/95790/3 "2022-12-07T01:10:11Z")

</div>

Hi @khawmingsheng,

Thanks for reaching out to the Auth0 Community!

> [@khawmingsheng](#):
>
> Currently im in a situation where **i need to update user’s custom claim in the access token**.

I recommend reading our [Adding custom claims to tokens](https://community.auth0.com/t/adding-custom-claims-to-tokens/84590) FAQ which explains how to add custom claims to tokens.

If you have any questions about the implementation, please feel free to ask.

Thanks,  
Rueben

---

<div class="post-metadata">

**Author:** ![khawmingsheng](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/khawmingsheng/32/36488_2.png) [@khawmingsheng](https://community.auth0.com/u/khawmingsheng)\
**Post date:** [December 7, 2022, 1:44am UTC](https://community.auth0.com/t/add-update-access-token-custom-claim-without-flow-rule/95790/4 "2022-12-07T01:44:44Z")

</div>

Hi Rueben, the faq just show how to add it inside a flow, but im at the point where wont trigger any action/flow…

---

<div class="post-metadata">

**Author:** ![rueben.tiow](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rueben.tiow/32/11646_2.png) [@rueben.tiow](https://community.auth0.com/u/rueben.tiow)\
**Post date:** [December 9, 2022, 12:55am UTC](https://community.auth0.com/t/add-update-access-token-custom-claim-without-flow-rule/95790/5 "2022-12-09T00:55:36Z")

</div>

Hi @khawmingsheng,

Thank you for your reply.

I have tested it myself and was able to successfully trigger the Post-Login Action flow.

Could you please try using the built-in Actions debugger to see if the Action script has any issues?

 ![image](https://global.discourse-cdn.com/auth0/original/3X/9/9/99afc36bdcb182ea842435e02b88568afab71660.png)

I would also recommend using `console.log()` statements in your Action script with the [Real-time Webtask Logs Extension](https://auth0.com/docs/customize/extensions/real-time-webtask-logs) to track the state of your Action.

If you are still having issues, could you please share an example of your Action script with sensitive data removed with me?

Thanks,  
Rueben

---

<div class="post-metadata">

**Author:** ![khawmingsheng](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/khawmingsheng/32/36488_2.png) [@khawmingsheng](https://community.auth0.com/u/khawmingsheng)\
**Post date:** [December 18, 2022, 5:53pm UTC](https://community.auth0.com/t/add-update-access-token-custom-claim-without-flow-rule/95790/6 "2022-12-18T17:53:03Z")

</div>

Hi rueben, thanks for reply.  
You have misunderstood me. The scenrario is when the user **already logged in** , and been for awhile. so its way passed the “post login action” flow stage.  
what I need is a a way for user to update the token custom claim whenever they (e.g.: clicked a button).  
is there any way to achieve this?

---

<div class="post-metadata">

**Author:** ![rueben.tiow](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rueben.tiow/32/11646_2.png) [@rueben.tiow](https://community.auth0.com/u/rueben.tiow)\
**Post date:** [December 19, 2022, 8:00pm UTC](https://community.auth0.com/t/add-update-access-token-custom-claim-without-flow-rule/95790/7 "2022-12-19T20:00:22Z")

</div>

Hi @khawmingsheng,

Thank you for your reply and clarification.

What you have observed is an existing session with an old state. In this case, the session would need to be “refreshed” since the user that was previously (and still) logged in has an access token with the claims issued at the time of authentication.

For this, I recommend using reading our [Refresh Tokens](https://auth0.com/docs/secure/tokens/refresh-tokens) documentation get a new access token with the updated claims without user interaction.

Please let me know if you have any additional questions.

Thanks,  
Rueben

---

<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:** [January 2, 2023, 8:01pm UTC](https://community.auth0.com/t/add-update-access-token-custom-claim-without-flow-rule/95790/8 "2023-01-02T20:01:05Z")

</div>

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