# Custom claims for token issued with client\_credentials flow

**URL:** <https://community.auth0.com/t/custom-claims-for-token-issued-with-client-credentials-flow/19281>\
**Category:** Get Help\
**Tags:** client-grant-type, jwt, rules\
**Created:** [December 20, 2018, 9:49am UTC](https://community.auth0.com/t/custom-claims-for-token-issued-with-client-credentials-flow/19281 "2018-12-20T09:49:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![etwillbefine](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/etwillbefine/32/10134_2.png) [@etwillbefine](https://community.auth0.com/u/etwillbefine)\
**Post date:** [December 20, 2018, 9:49am UTC](https://community.auth0.com/t/custom-claims-for-token-issued-with-client-credentials-flow/19281/1 "2018-12-20T09:49:17Z")

</div>

Hey there,

Im not really sure if I’m right but the documentation is little bit unclear in my opinion.  
Do rules only apply for a connection when a user is authenticated?

“Adding custom claims” seems to require to write a rule. We do not want to add custom claims programmatically on our side.

My question is now: Is the user object simply null when a token is issued to a resource server?  
As far as I can see rules will not be applied tokens issued with client\_credentials grant type. Is that right? How do we add custom claims then to the access token?

Thanks for you help in advance.  
Best, Tim

---

<div class="post-metadata">

**Author:** ![etwillbefine](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/etwillbefine/32/10134_2.png) [@etwillbefine](https://community.auth0.com/u/etwillbefine)\
**Post date:** [December 20, 2018, 11:54am UTC](https://community.auth0.com/t/custom-claims-for-token-issued-with-client-credentials-flow/19281/2 "2018-12-20T11:54:49Z")

</div>

Found out its about using Hooks.  
I would not assume to use different tools for these differences.

Anyway. Maybe point that out under “Add custom claims” cause it was not easy to find it.

Best, Tim

---

<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:** [August 28, 2019, 2:52pm UTC](https://community.auth0.com/t/custom-claims-for-token-issued-with-client-credentials-flow/19281/3 "2019-08-28T14:52:22Z")

</div>

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