# Access token giving unauthorized in backend

**URL:** <https://community.auth0.com/t/access-token-giving-unauthorized-in-backend/109227>\
**Category:** Get Help\
**Tags:** login-experience, new-universal-login-experience\
**Created:** [June 14, 2023, 1:08pm UTC](https://community.auth0.com/t/access-token-giving-unauthorized-in-backend/109227 "2023-06-14T13:08:30Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![vishal.agarwal](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@vishal.agarwal](https://community.auth0.com/u/vishal.agarwal)\
**Post date:** [June 14, 2023, 1:08pm UTC](https://community.auth0.com/t/access-token-giving-unauthorized-in-backend/109227/1 "2023-06-14T13:08:30Z")

</div>

I am trying to setup social login. I have a react app, mobile app and backend in Laravel. We have setup the Auth0 SDKs in both the react and mobile app but the access token received after the login is giving unauthorized error in the backend side.

Frontend app is sending the access token in header as authorization bearer but auth0 middleware is treating it as invalid. Please help.

---

<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 14, 2023, 6:43pm UTC](https://community.auth0.com/t/access-token-giving-unauthorized-in-backend/109227/2 "2023-06-14T18:43:55Z")

</div>

Hey there @vishal.agarwal!

> [@vishal.agarwal](#):
>
> Frontend app is sending the access token in header as authorization bearer but auth0 middleware is treating it as invalid. Please help.

Are you able to decode the access token at [jwt.io](http://jwt.io) and share (redacting any sensitive info) here?

Thanks!

---

<div class="post-metadata">

**Author:** ![vishal.agarwal](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@vishal.agarwal](https://community.auth0.com/u/vishal.agarwal)\
**Post date:** [June 15, 2023, 5:11am UTC](https://community.auth0.com/t/access-token-giving-unauthorized-in-backend/109227/4 "2023-06-15T05:11:00Z")

</div>

I tried decoding it at [jwt.io](http://jwt.io)

It is giving invalid signature for the access\_token but it successfully decodes the id\_token.

---

<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:31pm UTC](https://community.auth0.com/t/access-token-giving-unauthorized-in-backend/109227/5 "2023-06-15T20:31:29Z")

</div>

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).

---

<div class="post-metadata">

**Author:** ![vishal.agarwal](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@vishal.agarwal](https://community.auth0.com/u/vishal.agarwal)\
**Post date:** [June 16, 2023, 6:16am UTC](https://community.auth0.com/t/access-token-giving-unauthorized-in-backend/109227/6 "2023-06-16T06:16:53Z")

</div>

Thank you so much. It really helped and worked fine.

Now the second issue I am facing is:

We have created a native application for mobile, an SPA application for react frontend and a regular web application for backend. But I can only define single clientId in the Laravel backend. So, do we really need 3 applications or am I doing something wrong?

---

<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:** [June 30, 2023, 6:17am UTC](https://community.auth0.com/t/access-token-giving-unauthorized-in-backend/109227/7 "2023-06-30T06:17:35Z")

</div>

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