# Rules not firing during authorization code grant type

**URL:** <https://community.auth0.com/t/rules-not-firing-during-authorization-code-grant-type/66057>\
**Category:** Get Help\
**Tags:** rules\
**Created:** [July 13, 2021, 10:38am UTC](https://community.auth0.com/t/rules-not-firing-during-authorization-code-grant-type/66057 "2021-07-13T10:38:53Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![jesum](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jesum/32/27831_2.png) [@jesum](https://community.auth0.com/u/jesum)\
**Post date:** [July 13, 2021, 10:38am UTC](https://community.auth0.com/t/rules-not-firing-during-authorization-code-grant-type/66057/1 "2021-07-13T10:38:53Z")

</div>

Hi there

As the topic says, my rules are not firing when the authorization code grant type is running. I have a web application that my team is writing and we are doing testing. We have configured it to use authorization code grant type. My rules will insert custom claims into the JWT token. I’m not seeing ANY of the claims appearing.

I have 2 rules. One of my rule is this:

function (user, context, callback) {  
user.email = user.email || {};  
context.accessToken[configuration.NAMESPACE + “/email”] = user.email;  
return callback(null, user, context);  
}

Simple and sweet. “configuration.NAMESPACE” has a value of “[http://abc.com](http://abc.com)”

The JWT returned does not contain this claim at all. Help?

---

<div class="post-metadata">

**Author:** ![john.gateley](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/john.gateley/32/10879_2.png) [@john.gateley](https://community.auth0.com/u/john.gateley)\
**Post date:** [July 13, 2021, 1:03pm UTC](https://community.auth0.com/t/rules-not-firing-during-authorization-code-grant-type/66057/2 "2021-07-13T13:03:22Z")

</div>

HI @jesum

Use the Realtime Webtask Logs Extension and put console.log statements in.

The rules are firing, but something else may be going on. The extension will help debug.

John

---

<div class="post-metadata">

**Author:** ![jesum](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jesum/32/27831_2.png) [@jesum](https://community.auth0.com/u/jesum)\
**Post date:** [July 13, 2021, 10:54pm UTC](https://community.auth0.com/t/rules-not-firing-during-authorization-code-grant-type/66057/3 "2021-07-13T22:54:19Z")

</div>

Found the issue! 🙂

My code was buggy. 🙂

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [July 14, 2021, 12:14pm UTC](https://community.auth0.com/t/rules-not-firing-during-authorization-code-grant-type/66057/4 "2021-07-14T12:14:24Z")

</div>

Can you share what was it, for the benefit of others in community?

---

<div class="post-metadata">

**Author:** ![jesum](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jesum/32/27831_2.png) [@jesum](https://community.auth0.com/u/jesum)\
**Post date:** [July 14, 2021, 1:28pm UTC](https://community.auth0.com/t/rules-not-firing-during-authorization-code-grant-type/66057/5 "2021-07-14T13:28:07Z")

</div>

Sure!

The problem was with “configuration.NAMESPACE”.

It had a value of “[abc.com](http://abc.com)” when really it should be “[http://abc.com](http://abc.com)”. 🙂

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [July 14, 2021, 1:53pm UTC](https://community.auth0.com/t/rules-not-firing-during-authorization-code-grant-type/66057/6 "2021-07-14T13:53:34Z")

</div>

Gotchya! Thanks for sharing it!

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [July 29, 2021, 8:22am UTC](https://community.auth0.com/t/rules-not-firing-during-authorization-code-grant-type/66057/7 "2021-07-29T08:22:00Z")

</div>

Closing this one if you have any additional questions down the road feel free to create another topic!

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [July 29, 2021, 8:22am UTC](https://community.auth0.com/t/rules-not-firing-during-authorization-code-grant-type/66057/8 "2021-07-29T08:22:03Z")

</div>


