# Auth0 Userinfo endpoint returns empty object

**URL:** <https://community.auth0.com/t/auth0-userinfo-endpoint-returns-empty-object/131410>\
**Category:** JWT.io\
**Created:** [April 6, 2024, 9:47pm UTC](https://community.auth0.com/t/auth0-userinfo-endpoint-returns-empty-object/131410 "2024-04-06T21:47:54Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ilokhvytska](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ilokhvytska/32/56229_2.png) [@ilokhvytska](https://community.auth0.com/u/ilokhvytska)\
**Post date:** [April 6, 2024, 9:47pm UTC](https://community.auth0.com/t/auth0-userinfo-endpoint-returns-empty-object/131410/1 "2024-04-06T21:47:54Z")

</div>

Hi, I have fetched an access token, but when I try to call userinfo endpoint with it - it returns empty object.  
Tenant name: dev-1y03nqe5vd3rtzha  
I used api request to fetch access token.  
Audience - [https://dev-1y03nqe5vd3rtzha.us.auth0.com/userinfo](https://dev-1y03nqe5vd3rtzha.us.auth0.com/userinfo)  
OpenID Connect (okta) Enterprise Connections.  
Code:

```auto
{
        "client_id": app_config["auth0_client_id"],
        "connection": app_config["auth0_connection_name"],
        "redirect_uri": os.environ["AUTH0_REDIRECT_URI"],
        "state": request.session.get("state", "/"),
        "response_type": "code",
        "scopes": "openid profile email",
        "audience": app_config["auth0_audience"],
    }

```

Token:

```auto
payload = {
        "grant_type": "authorization_code",
        "code": code,
        "redirect_uri": os.environ["AUTH0_REDIRECT_URI"],
        "scopes": "openid profile email",
        "client_id": app_config["auth0_client_id"],
        "client_secret": app_config["auth0_client_secret"],
        "audience": app_config["auth0_audience"],
    }
    exchange = requests.post(
        f"https://{os.environ['AUTH0_DOMAIN']}/oauth/token",
        headers=headers,
        data=payload,
    )

```

I tried with and without audience, but the result is the same.

---

<div class="post-metadata">

**Author:** ![ilokhvytska](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ilokhvytska/32/56229_2.png) [@ilokhvytska](https://community.auth0.com/u/ilokhvytska)\
**Post date:** [April 8, 2024, 1:58pm UTC](https://community.auth0.com/t/auth0-userinfo-endpoint-returns-empty-object/131410/2 "2024-04-08T13:58:31Z")

</div>

The issue was fixed. In okta we have scopes, But in auth0 it is scope.

---

<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:** [April 8, 2024, 8:41pm UTC](https://community.auth0.com/t/auth0-userinfo-endpoint-returns-empty-object/131410/3 "2024-04-08T20:41:49Z")

</div>

Hey there @ilokhvytska welcome to the community!

Good to know you were able to get this sorted, and thanks for following up with the solution 🙂

---

<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:** [April 22, 2024, 8:42pm UTC](https://community.auth0.com/t/auth0-userinfo-endpoint-returns-empty-object/131410/4 "2024-04-22T20:42:13Z")

</div>

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