# api.idToken empty object in Post Login Action

**URL:** <https://community.auth0.com/t/api-idtoken-empty-object-in-post-login-action/185008>\
**Category:** Get Help\
**Tags:** identifier-first, login-experience\
**Created:** [April 4, 2025, 8:38am UTC](https://community.auth0.com/t/api-idtoken-empty-object-in-post-login-action/185008 "2025-04-04T08:38:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![stephen.graham](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/stephen.graham/32/70809_2.png) [@stephen.graham](https://community.auth0.com/u/stephen.graham)\
**Post date:** [April 4, 2025, 8:38am UTC](https://community.auth0.com/t/api-idtoken-empty-object-in-post-login-action/185008/1 "2025-04-04T08:38:47Z")

</div>

Hi,  
I’m trying to get the user token in the Post Login Action to pass it to my server via a sendRedirectTo.

Apparently it is available in api.tokenId, but this is an empty object “{}”.

Is there something I can call to get it? I’ve tried the /userinfo call via axios as I’m not sure how to directly call it on the API. I’m passing my accessToken (which works on other calls to the /api/v2/…) but I’m getting a 401 Unauthorized error.

Any help would be appreciated.  
Cheers,  
Stephen

---

<div class="post-metadata">

**Author:** ![nik.baleca](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/nik.baleca/32/68749_2.png) [@nik.baleca](https://community.auth0.com/u/nik.baleca)\
**Post date:** [April 4, 2025, 8:44pm UTC](https://community.auth0.com/t/api-idtoken-empty-object-in-post-login-action/185008/3 "2025-04-04T20:44:29Z")

</div>

Hi @stephen.graham

Unfortunately, the `idToken` cannot be retrieved within an action. You can read on how an `idToken` is retrieved [here](https://auth0.com/docs/secure/tokens/id-tokens/get-id-tokens).

Otherwise, I would advise to return the idToken of an user via the [Get Token flow](https://auth0.com/docs/api/authentication/resource-owner-password-flow/get-token) through the Resource Owner Password Flow of our Authentication API.

This will help you retrieve the `Access Token`, `IdToken` and `Refresh Token` of the specific user sessions.

If you have any other questions, feel free to let me know by leaving a reply!

Kind Regards,  
Nik

---

<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 18, 2025, 8:45pm UTC](https://community.auth0.com/t/api-idtoken-empty-object-in-post-login-action/185008/4 "2025-04-18T20:45:22Z")

</div>

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