# Go server - need help to verify Auth0 token from React (frontend) and get the userId

**URL:** <https://community.auth0.com/t/go-server-need-help-to-verify-auth0-token-from-react-frontend-and-get-the-userid/99927>\
**Category:** JWT.io\
**Tags:** golang, react\
**Created:** [February 7, 2023, 6:46pm UTC](https://community.auth0.com/t/go-server-need-help-to-verify-auth0-token-from-react-frontend-and-get-the-userid/99927 "2023-02-07T18:46:48Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![oded1](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/oded1/32/44426_2.png) [@oded1](https://community.auth0.com/u/oded1)\
**Post date:** [February 7, 2023, 6:46pm UTC](https://community.auth0.com/t/go-server-need-help-to-verify-auth0-token-from-react-frontend-and-get-the-userid/99927/1 "2023-02-07T18:46:48Z")

</div>

Hi,

Our setup is a React app on the frontend which uses ‘@auth0/auth0-spa-js’ library to connect the user to our Auth0 account.

On the backend we have a Go server which exposes our company API services.

My goal is to have the client pass an “Authorization” token which can be verified by our Go backend server - this will help us block non-authenticated users. Also, we want to be able to parse the userID out of that Auth token so we can provide a “tailor made” response for the specific user.

I tried to define our backend as a “custom API” on Auth0 dashboard. And also use an access token to send to our backend:

const accessToken = await auth0Client.getTokenSilently({audience: ‘[http://koala-backend.cluster.koalaops.com/koala](http://koala-backend.cluster.koalaops.com/koala)’});

However, I didn’t manage to verify this token on the Go server OR get the user ID from the auth-token. I followed these instructions:

> **[Auth0 Go API SDK Quickstarts: Add authorization to a Go API](https://auth0.com/docs/quickstart/backend/golang/interactive)**
>
> This tutorial demonstrates how to add authorization to a Go API.

Can you please help?

---

<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:** [February 8, 2023, 10:23pm UTC](https://community.auth0.com/t/go-server-need-help-to-verify-auth0-token-from-react-frontend-and-get-the-userid/99927/3 "2023-02-08T22:23:55Z")

</div>

Hi @oded1,

Welcome to the Auth0 Community!

> [@oded1](#):
>
> However, I didn’t manage to verify this token on the Go server OR get the user ID from the auth-token.

What was happening? Were you able to get a token successfully? If so, can you please provide an example token? Additionally, could you provide more context on what is happening; i.e. errors, code snippets, etc.

---

<div class="post-metadata">

**Author:** ![oded1](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/oded1/32/44426_2.png) [@oded1](https://community.auth0.com/u/oded1)\
**Post date:** [March 26, 2023, 7:07am UTC](https://community.auth0.com/t/go-server-need-help-to-verify-auth0-token-from-react-frontend-and-get-the-userid/99927/4 "2023-03-26T07:07:31Z")

</div>

Hi Dan, thank you for getting back to me. We had to move into other priorities. I should get back to this task soon and will update here if needed. Thank you for trying to help

---

<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:** [March 27, 2023, 1:36pm UTC](https://community.auth0.com/t/go-server-need-help-to-verify-auth0-token-from-react-frontend-and-get-the-userid/99927/5 "2023-03-27T13:36:58Z")

</div>

Sounds good, let me know.

---

<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:** [August 23, 2023, 2:48pm UTC](https://community.auth0.com/t/go-server-need-help-to-verify-auth0-token-from-react-frontend-and-get-the-userid/99927/6 "2023-08-23T14:48:43Z")

</div>

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