# Extract id\_token in my react app

**URL:** <https://community.auth0.com/t/extract-id-token-in-my-react-app/109119>\
**Category:** Get Help\
**Tags:** login-experience, new-universal-login-experience\
**Created:** [June 13, 2023, 11:01am UTC](https://community.auth0.com/t/extract-id-token-in-my-react-app/109119 "2023-06-13T11:01:12Z")\
**Posts on this page:** 1\
**Showing post:** 5

<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:** [June 15, 2023, 8:37pm UTC](https://community.auth0.com/t/extract-id-token-in-my-react-app/109119/5 "2023-06-15T20:37:48Z")

</div>

> [@vishal.agarwal](#):
>
> Technicially, I should use access\_token only but I am not able to figure out why id\_token is working and access\_token is treated as unauthorized by the auth0 middleware in the laravel backend.

Thanks for confirming - You should definitely be using the access token against your backend. I believe the issue is related to the access token being opaque as I mentioned here:

> [@Access token giving unauthorized in backend](https://community.auth0.com/t/access-token-giving-unauthorized-in-backend/109227/5):
>
> Hey @vishal.agarwal thanks for confirming - My guess is that your token is missing an audience claim and is thus [opaque](https://community.auth0.com/t/why-is-my-access-token-not-a-jwt-opaque-token/31028).

Once you include an [audience param](https://auth0.github.io/auth0-react/interfaces/AuthorizationParams.html#audience) (`AuthorizationParams` in auth0-react) in the request to get tokens the middleware should be able to verify the access token successfully. The audience is just the API identifier you use when [registering an API](https://auth0.com/docs/get-started/auth0-overview/set-up-apis) in your Auth0 dashboard.

---

_[View the full topic](https://community.auth0.com/t/extract-id-token-in-my-react-app/109119)._
