# Use of the Management API and My Own REST API

**URL:** <https://community.auth0.com/t/use-of-the-management-api-and-my-own-rest-api/81030>\
**Category:** Get Help\
**Tags:** jwt, auth0\
**Created:** [April 3, 2022, 6:43pm UTC](https://community.auth0.com/t/use-of-the-management-api-and-my-own-rest-api/81030 "2022-04-03T18:43:45Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![buildthenbless](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/buildthenbless/32/33467_2.png) [@buildthenbless](https://community.auth0.com/u/buildthenbless)\
**Post date:** [April 3, 2022, 6:43pm UTC](https://community.auth0.com/t/use-of-the-management-api-and-my-own-rest-api/81030/1 "2022-04-03T18:43:45Z")

</div>

I currently use the auth0-spa-js library and authentication works great. Once I get the AccessToken I want to pass this to my own PHP Rest API I manage. Within my REST API I am attempting to use the Auth0 PHP SDK to verify the token is valid. Check link below for reference.

I think I answered my own question here [php - Auth0 "The JWT string must contain two dots" - Stack Overflow](https://stackoverflow.com/questions/71713845/auth0-the-jwt-string-must-contain-two-dots), in that, I need to pass an audience. That’s why my token isn’t valid.

My question for this topic is… what do I pass as the audience? In the Auth0 dashboard I see the Management API, that has the “Identifier” I could use as audience parameter. But I also want to only verify the token on other requests within my REST API that won’t necessarily be interacting with the Management API. I only want to use the Management API to create, edit, delete users. I tried passing audience as “undefined” but token still had empty payload and the PHP SDK threw exception.

Thanks for the help!

---

<div class="post-metadata">

**Author:** ![buildthenbless](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/buildthenbless/32/33467_2.png) [@buildthenbless](https://community.auth0.com/u/buildthenbless)\
**Post date:** [April 4, 2022, 4:08pm UTC](https://community.auth0.com/t/use-of-the-management-api-and-my-own-rest-api/81030/2 "2022-04-04T16:08:33Z")

</div>

I’ve tried adding a custom API to the Auth0 dashboard that uses my REST API url, and used the identifier as the audience parameter on the client side and still produces an invalid token.

---

<div class="post-metadata">

**Author:** ![buildthenbless](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/buildthenbless/32/33467_2.png) [@buildthenbless](https://community.auth0.com/u/buildthenbless)\
**Post date:** [April 4, 2022, 4:57pm UTC](https://community.auth0.com/t/use-of-the-management-api-and-my-own-rest-api/81030/3 "2022-04-04T16:57:39Z")

</div>

Found that it was the audience parameter, I needed to add it to the getTokenSilently() too. Also needed to add it to PHP SDK decode audience parameter.

---

<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:** [April 28, 2022, 11:19am UTC](https://community.auth0.com/t/use-of-the-management-api-and-my-own-rest-api/81030/4 "2022-04-28T11:19:35Z")

</div>

Thanks for sharing it with the rest of community!

---

<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:** [April 28, 2022, 11:19am UTC](https://community.auth0.com/t/use-of-the-management-api-and-my-own-rest-api/81030/5 "2022-04-28T11:19:39Z")

</div>


