# /userinfo endpoint does not contain custom claim

**URL:** <https://community.auth0.com/t/userinfo-endpoint-does-not-contain-custom-claim/138575>\
**Category:** Get Help\
**Tags:** custom-database-connections, connections\
**Created:** [July 10, 2024, 4:00pm UTC](https://community.auth0.com/t/userinfo-endpoint-does-not-contain-custom-claim/138575 "2024-07-10T16:00:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![admin76](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/admin76/32/72656_2.png) [@admin76](https://community.auth0.com/u/admin76)\
**Post date:** [July 10, 2024, 4:00pm UTC](https://community.auth0.com/t/userinfo-endpoint-does-not-contain-custom-claim/138575/1 "2024-07-10T16:00:05Z")

</div>

Or how can i test the /userinfo endpoint to see if my data is complete. I have added a custom claim in login flow adding api.idToken.setCustomClaim(‘test’, ‘test’). I seem to be not able to map this field to a platform where i use Auth0 SSO as auth provider and want to use the custom claims. The platform calls the /userinfo endpoint. I was wondering how can i debug this i tried to use the bearer token against /userinfo i got from M2M [https://xxx/oauth/token](https://xxx/oauth/token) POST call but its always unauthorized. I also checked the logs = monitoring for any trace of the /userinfo call. all to no avail - please help

---

<div class="post-metadata">

**Author:** ![ty.frith](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ty.frith/32/58484_2.png) [@ty.frith](https://community.auth0.com/u/ty.frith)\
**Post date:** [July 12, 2024, 1:00pm UTC](https://community.auth0.com/t/userinfo-endpoint-does-not-contain-custom-claim/138575/4 "2024-07-12T13:00:33Z")

</div>

Hey there @admin76!

> [@admin76](#):
>
> The platform calls the /userinfo endpoint. I was wondering how can i debug this i tried to use the bearer token against /userinfo i got from M2M [https://xxx/oauth/token](https://xxx/oauth/token) POST call but its always unauthorized.

The access token that is used to called `/userinfo` needs to be that of the user themself, not from an M2M application.

---

<div class="post-metadata">

**Author:** ![admin76](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/admin76/32/72656_2.png) [@admin76](https://community.auth0.com/u/admin76)\
**Post date:** [July 19, 2024, 6:03pm UTC](https://community.auth0.com/t/userinfo-endpoint-does-not-contain-custom-claim/138575/5 "2024-07-19T18:03:47Z")

</div>

Dont know where the comment went but i was able to get it working adding custom claims in login flow and using onExecuteCredentialsExchange hook. Thank you!

---

<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 2, 2024, 6:04pm UTC](https://community.auth0.com/t/userinfo-endpoint-does-not-contain-custom-claim/138575/6 "2024-08-02T18:04:33Z")

</div>

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