# Best way for back-end service to verify token passed from Single Page Application

**URL:** <https://community.auth0.com/t/best-way-for-back-end-service-to-verify-token-passed-from-single-page-application/9585>\
**Category:** Get Help\
**Tags:** single-page-applicat\
**Created:** [February 24, 2018, 3:34pm UTC](https://community.auth0.com/t/best-way-for-back-end-service-to-verify-token-passed-from-single-page-application/9585 "2018-02-24T15:34:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![brianbitawesome](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@brianbitawesome](https://community.auth0.com/u/brianbitawesome)\
**Post date:** [February 24, 2018, 3:34pm UTC](https://community.auth0.com/t/best-way-for-back-end-service-to-verify-token-passed-from-single-page-application/9585/1 "2018-02-24T15:34:08Z")

</div>

We are using ReactJS and Auth0, which works great. Post authentication, SPA is passing id-token and access-token to backend service. Which endpoint should the backend service hit to verify these tokens are legit, also, should the backend service want more info regarding the user, how should it get it?  
Thanks!

---

<div class="post-metadata">

**Author:** ![richard.dowinton](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/richard.dowinton/32/16150_2.png) [@richard.dowinton](https://community.auth0.com/u/richard.dowinton)\
**Post date:** [February 27, 2018, 7:12pm UTC](https://community.auth0.com/t/best-way-for-back-end-service-to-verify-token-passed-from-single-page-application/9585/2 "2018-02-27T19:12:57Z")

</div>

You should send the access token via the `Authorization` request header whenever you make a request to your backend that requires authorization. Your backend should [verify the token](https://auth0.com/docs/api-auth/tutorials/verify-access-token) and use the `scopes` attribute to determine whether to allow access to a particular resource.

You can pass the access token to the [userinfo](https://auth0.com/docs/api/authentication#get-user-info) endpoint to retrieve the user profile. Keep in mind that you will need to make sure you requested the `profile` scope when you first requested the tokens otherwise the information will come back empty.

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [July 25, 2019, 10:18am UTC](https://community.auth0.com/t/best-way-for-back-end-service-to-verify-token-passed-from-single-page-application/9585/3 "2019-07-25T10:18:58Z")

</div>


