Rules not firing during authorization code grant type

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

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

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

1 Like

Found the issue! :slight_smile:

My code was buggy. :slight_smile:

1 Like

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

Sure!

The problem was with “configuration.NAMESPACE”.

It had a value of “abc.com” when really it should be “http://abc.com”. :slight_smile:

1 Like

Gotchya! Thanks for sharing it!

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