# User endpoint in ManagementAPI not returning idp tokens

**URL:** <https://community.auth0.com/t/user-endpoint-in-managementapi-not-returning-idp-tokens/117447>\
**Category:** Get Help\
**Tags:** users, management-api\
**Created:** [September 29, 2023, 8:37pm UTC](https://community.auth0.com/t/user-endpoint-in-managementapi-not-returning-idp-tokens/117447 "2023-09-29T20:37:00Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![brandon.knox](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/brandon.knox/32/50998_2.png) [@brandon.knox](https://community.auth0.com/u/brandon.knox)\
**Post date:** [September 29, 2023, 8:37pm UTC](https://community.auth0.com/t/user-endpoint-in-managementapi-not-returning-idp-tokens/117447/1 "2023-09-29T20:37:00Z")

</div>

I have users that use the OKTA Enterprise Connection to login to certain applications. I need to populate the user token with the OKTA Groups that user is assigned to. When they change I expect to they would change in Auth0. So I am following the excepted solution provided here [Get/map claims from Okta - Enterprise Connection](https://community.auth0.com/t/get-map-claims-from-okta-enterprise-connection/43981) .

The solution requires in a login action getting the users idp access token from the management api and calling the okta user info endpoint. The issue is that when I call [get user](https://auth0.com/docs/api/management/v2/users/get-users-by-id) in management api no access token is provided in the response. My JWT token contains the scopes read:users, read:user\_idp\_tokens.

According to the documentation that should be all that is need to get the users idp access token. Why is it that when I call /api/v2/users/{user id} no idp access token is returned?

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [October 4, 2023, 7:28pm UTC](https://community.auth0.com/t/user-endpoint-in-managementapi-not-returning-idp-tokens/117447/3 "2023-10-04T19:28:01Z")

</div>

Hi @brandon.knox,

I was able to set up an Okta connection and tested it to get the IdP access tokens. After a request to the get user endpoint with the appropriate token and scopes, I see the Okta access token in the identities array.

Here’s an example of that I see:

```auto
{
  "created_at": "2023-10-04T19:22:34.059Z",
  "email": "xxx",
  "email_verified": true,
  "family_name": "x",
  "given_name": "xxx",
  "identities": [
    {
      "user_id": "trial-xxx|xxx",
      "access_token": "xxx",
      "provider": "okta",
      "connection": "trial-xxx",
      "isSocial": false
    }
  ],
  "name": "xxx",
  "nickname": "xxx",
  "picture": "xxx",
  "updated_at": "2023-10-04T19:23:58.881Z",
  "user_id": "xxx",
  "last_ip": "xxx",
  "last_login": "xxx",
  "logins_count": 1
}

```

---

<div class="post-metadata">

**Author:** ![brandon.knox](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/brandon.knox/32/50998_2.png) [@brandon.knox](https://community.auth0.com/u/brandon.knox)\
**Post date:** [October 5, 2023, 9:23pm UTC](https://community.auth0.com/t/user-endpoint-in-managementapi-not-returning-idp-tokens/117447/4 "2023-10-05T21:23:14Z")

</div>

Thank you for the reply. I noticed that I had switched the user mapping to the OKTA template and that seemed to be removing it. When I created a new connection and used the default mapping it came across.

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [October 6, 2023, 1:53pm UTC](https://community.auth0.com/t/user-endpoint-in-managementapi-not-returning-idp-tokens/117447/5 "2023-10-06T13:53:59Z")

</div>

Perfect, thanks for the update!

---

<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:** [October 20, 2023, 1:54pm UTC](https://community.auth0.com/t/user-endpoint-in-managementapi-not-returning-idp-tokens/117447/6 "2023-10-20T13:54:39Z")

</div>

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