I’m new here, so I think my problem should be simple to fix but I really don’t understand what is going on.
I followed tutorials to create a NestJs API, now I’m creating my front-end using React with
Once I’m login, the
Access Token I got by using the
getAccessTokenSilently() function seem to not be valid for my Custom API (401 Unauthorize). (edit: I send it has a
Bearer token etc, everything seem fine on this side)
When I use the
/oauth/token route to get a token, the token is valid on the Custom API so I think the probleme must come from some configuration or something I’ve missed.
So, Auth0 side I’ve :
- Front-react : the Application
- Back-nest : the API
I’ve nothing more to add right now, I’ve no special config or anything …
If you have any question, I will be glad to answer you !
Thanks for reading this, and thanks in advance to thoses that are gonna try to solve my mistery !
TOPIC CLOSE, I found my answer right after writing this post … I was searching since too long lol
I was missing the
audience parameter in my react app.
In addition, your client application must ensure that it performs an authorization request that states that it wants to receive an access token suitable to your API. It can do this by including an audience parameter where the value is the identifier you configured previously for the API.