# Backend GO tutorial for API not working

**URL:** <https://community.auth0.com/t/backend-go-tutorial-for-api-not-working/83856>\
**Category:** Get Help\
**Tags:** go\
**Created:** [May 21, 2022, 7:37am UTC](https://community.auth0.com/t/backend-go-tutorial-for-api-not-working/83856 "2022-05-21T07:37:08Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![christheoreo](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/christheoreo/32/33549_2.png) [@christheoreo](https://community.auth0.com/u/christheoreo)\
**Post date:** [May 21, 2022, 7:37am UTC](https://community.auth0.com/t/backend-go-tutorial-for-api-not-working/83856/1 "2022-05-21T07:37:08Z")

</div>

Using the following tutorial (and the correct details) I can not get the JWT to validate successfully.

I get the following error: `Encountered error while validating JWT: jwt invalid: could not parse the token: square/go-jose: compact JWS format must have three parts`

My svelte frontend calls `getTokenSilently()` before making the request and I can see in the headers that it is passing the token in the header.

Could someone else see if the tutorial works for them? I am using go 1.17 and gorilla mux.

---

<div class="post-metadata">

**Author:** ![christheoreo](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/christheoreo/32/33549_2.png) [@christheoreo](https://community.auth0.com/u/christheoreo)\
**Post date:** [May 21, 2022, 7:37am UTC](https://community.auth0.com/t/backend-go-tutorial-for-api-not-working/83856/2 "2022-05-21T07:37:55Z")

</div>

Sorry! forgot to post the url : [Go tutorial](https://auth0.com/docs/quickstart/backend/golang/01-authorization)

---

<div class="post-metadata">

**Author:** ![lihua.zhang](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/lihua.zhang/32/39683_2.png) [@lihua.zhang](https://community.auth0.com/u/lihua.zhang)\
**Post date:** [May 26, 2022, 7:21pm UTC](https://community.auth0.com/t/backend-go-tutorial-for-api-not-working/83856/4 "2022-05-26T19:21:35Z")

</div>

Hi @christheoreo ,

Welcome to the Auth0 Community!

Have you verified if the token is valid in [jwt.io](http://jwt.io)?

I found [this](https://community.auth0.com/t/what-does-jwt-must-have-3-parts-mean/7228/6) topic with a similar error. Could you please check if the audience id in your project matches the API audience id? Thanks!

---

<div class="post-metadata">

**Author:** ![christheoreo](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/christheoreo/32/33549_2.png) [@christheoreo](https://community.auth0.com/u/christheoreo)\
**Post date:** [May 26, 2022, 7:36pm UTC](https://community.auth0.com/t/backend-go-tutorial-for-api-not-working/83856/5 "2022-05-26T19:36:01Z")

</div>

Hi there - I realised that the error was with my SPA config. I have flagged this post for deletion when I found this out.  
Please can you close this for me?

But, thank you for spending the time to look at this for me 🙂

Chris

---

<div class="post-metadata">

**Author:** ![lihua.zhang](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/lihua.zhang/32/39683_2.png) [@lihua.zhang](https://community.auth0.com/u/lihua.zhang)\
**Post date:** [May 26, 2022, 8:12pm UTC](https://community.auth0.com/t/backend-go-tutorial-for-api-not-working/83856/6 "2022-05-26T20:12:21Z")

</div>

@christheoreo , thank you for the updates! Glad to know that you have found the solution 👍 .  
I will mark it as closed.

---

<div class="post-metadata">

**Author:** ![lihua.zhang](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/lihua.zhang/32/39683_2.png) [@lihua.zhang](https://community.auth0.com/u/lihua.zhang)\
**Post date:** [May 26, 2022, 8:12pm UTC](https://community.auth0.com/t/backend-go-tutorial-for-api-not-working/83856/7 "2022-05-26T20:12:32Z")

</div>


