# Request data from /userinfo or /api/v2/users/ID

**URL:** <https://community.auth0.com/t/request-data-from-userinfo-or-api-v2-users-id/56827>\
**Category:** Get Help\
**Created:** [January 26, 2021, 7:01pm UTC](https://community.auth0.com/t/request-data-from-userinfo-or-api-v2-users-id/56827 "2021-01-26T19:01:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Stuzfuz](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/stuzfuz/32/12732_2.png) [@Stuzfuz](https://community.auth0.com/u/Stuzfuz)\
**Post date:** [January 26, 2021, 7:01pm UTC](https://community.auth0.com/t/request-data-from-userinfo-or-api-v2-users-id/56827/1 "2021-01-26T19:01:46Z")

</div>

Hi,

I have a fully working setup with Auth0+Spring Boot+Angular running.  
Now I am trying to get some more info from the logged in User in the Backend (Spring Boot).

**First I am trying to get the Bearer-Token:**  
Url: [https://xxx.xx.auth0.com/oauth/token](https://xxx.xx.auth0.com/oauth/token)  
Header(“content-type”, “application/json”)  
Body(“{"client\_id":"XXXX","client\_secret":"XXXXXXX”,"audience":"XXXXX","grant\_type":"client\_credentials"}")  
This is working and I am getting a long String seperated by dots as a Result (-\> TOKEN).

I am using this String as a Bearer-Token for the next Request.  
This could be either this Url: [https://XXX.xx.auth0.com/userinfo](https://XXX.xx.auth0.com/userinfo)  
or that:[https://XXX.xx.auth0.com/api/v2/users/ID](https://XXX.xx.auth0.com/api/v2/users/ID)  
with the Header:  
Header(“authorization”, "Bearer " + TOKEN)

Both Urls are resulting in unauthorized (Bad audience).

Can somebody please help me!

Best,  
Peter

---

<div class="post-metadata">

**Author:** ![stephanie.chamblee](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/stephanie.chamblee/32/26087_2.png) [@stephanie.chamblee](https://community.auth0.com/u/stephanie.chamblee)\
**Post date:** [January 26, 2021, 7:16pm UTC](https://community.auth0.com/t/request-data-from-userinfo-or-api-v2-users-id/56827/3 "2021-01-26T19:16:16Z")

</div>

Hi @Stuzfuz,

Welcome to the Community!

You may be getting this error because the application does not have a client-grant set up with the Management API. To see if this is the issue, go to APIs in your Auth0 dashboard and select “Auth0 Management API” and click on the “Machine to Machine Applications” tab. You can see which application are authorized from there.

Let me know if that solves the issue!

Thanks,

Stephanie

---

<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:** [February 10, 2021, 7:16pm UTC](https://community.auth0.com/t/request-data-from-userinfo-or-api-v2-users-id/56827/4 "2021-02-10T19:16:20Z")

</div>

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