Should we use a rule or a hook for inject custom claim into access token?

and

both show additions to the access token… which is the recommended path? using a rule or a hook to add a custom claim to the access token?

Hi @tommy.chheng thanks for reaching out to the Auth0 Community! :tada:

My suggestion would be to stick with Rules as they’re a bit more flexible but I’m not entirely sure of your use-case so I hesitate to advise too strongly. The Community Engineer Dan Woda has a great post about some of the functional differences between Rules and Hooks which might help you to determine where your code is best run.

If you can go into your use-case a bit more I may be able to point you in the right direction.

Best,
Colin

3 Likes

It sounds like using rules would be better here.

This is for adding claims for login not just registration(which seems hooks might be better for)

1 Like

Hey there!

As this topic is related to Rules - Hooks - Actions and Rules & Hooks are being deprecated soon, I’m excited to let you know about our next Ask me Anything session in the Forum on Thursday, January 18 with the Rules, Hooks and Actions team on Rules & Hooks and why Actions matter! Submit your questions in the thread above and our esteemed product experts will provide written answers on January 18. Find out more about Rules & Hooks and why Actions matter! Can’t wait to see you there!

Learn more here!

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