# Raw ID token returning undefined

**URL:** <https://community.auth0.com/t/raw-id-token-returning-undefined/50476>\
**Category:** Get Help\
**Tags:** auth0-react, id\_token\
**Created:** [September 25, 2020, 8:17pm UTC](https://community.auth0.com/t/raw-id-token-returning-undefined/50476 "2020-09-25T20:17:17Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![gokulnarayan09](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/gokulnarayan09/32/24209_2.png) [@gokulnarayan09](https://community.auth0.com/u/gokulnarayan09)\
**Post date:** [September 25, 2020, 8:17pm UTC](https://community.auth0.com/t/raw-id-token-returning-undefined/50476/1 "2020-09-25T20:17:17Z")

</div>

> Moved from a private thread for visibility

I am having 2 applications under one tenant. I need to call an API of one application when I am authenticated to the other one. How can I get the access token of the former when I am logged into the latter. I need the JWT access token to get the data into the second applications dashboard. But the data can only be called by the other applications api which requires and access token.

I am facing one more issue. The user object that is available in useAuth0 hook is not getting updated with user parameters and is remaining as undefined even after successfully authenticating. Do I need to call any function after calling **loginWithRedirect**.

---

<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:** [September 25, 2020, 8:19pm UTC](https://community.auth0.com/t/raw-id-token-returning-undefined/50476/3 "2020-09-25T20:19:39Z")

</div>

> [@gokulnarayan09](#):
>
> I am having 2 applications under one tenant. I need to call an API of one application when I am authenticated to the other one. How can I get the access token of the former when I am logged into the latter. I need the JWT access token to get the data into the second applications dashboard. But the data can only be called by the other applications api which requires and access token.

Why can’t you call the API directly with the access token you have? I’m not sure I understand the issue here fully.

> [@gokulnarayan09](#):
>
> I am facing one more issue. The user object that is available in useAuth0 hook is not getting updated with user parameters and is remaining as undefined even after successfully authenticating. Do I need to call any function after calling **loginWithRedirect**.

This sounds like an async issue. Can you post the code you are using here?

---

<div class="post-metadata">

**Author:** ![gokulnarayan09](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/gokulnarayan09/32/24209_2.png) [@gokulnarayan09](https://community.auth0.com/u/gokulnarayan09)\
**Post date:** [September 26, 2020, 5:18am UTC](https://community.auth0.com/t/raw-id-token-returning-undefined/50476/4 "2020-09-26T05:18:34Z")

</div>

I have two applications here, and I want to call thingsboard API(Which only works if I have the thingsboard accesstoken which we get after authenticating) when I am in Davas. Basically to fetch some data into davas.

 ![Screenshot from 2020-09-26 10-41-35](https://global.discourse-cdn.com/auth0/original/3X/8/8/8891c319afa6dc0bec00dd2aa2348903f5c01330.png)

Case 2:

 ![login](https://global.discourse-cdn.com/auth0/original/3X/c/c/cc22b5d483103ad09db8848e5afcf206786e99bd.png) ![Screenshot from 2020-09-26 10-50-49](https://global.discourse-cdn.com/auth0/original/3X/0/a/0a72803ff268b0c348f5699d7c5bf657b85c7c6b.png)

---

<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 13, 2020, 9:20pm UTC](https://community.auth0.com/t/raw-id-token-returning-undefined/50476/5 "2020-10-13T21:20:26Z")

</div>

Sorry for the delayed response.

Are you not requesting an access token for the thingsboard API from the davas app? You should have the thingsboard API identifier as the audience in the request from davas.

---

<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 28, 2020, 4:51pm UTC](https://community.auth0.com/t/raw-id-token-returning-undefined/50476/6 "2020-10-28T16:51:59Z")

</div>


