# Auth Server and Audience Base URL can be the same?

**URL:** <https://community.auth0.com/t/auth-server-and-audience-base-url-can-be-the-same/127829>\
**Category:** Get Help\
**Tags:** clients, management-api\
**Created:** [February 20, 2024, 10:57am UTC](https://community.auth0.com/t/auth-server-and-audience-base-url-can-be-the-same/127829 "2024-02-20T10:57:07Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![aamuzakii](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/aamuzakii/32/54973_2.png) [@aamuzakii](https://community.auth0.com/u/aamuzakii)\
**Post date:** [February 20, 2024, 10:57am UTC](https://community.auth0.com/t/auth-server-and-audience-base-url-can-be-the-same/127829/1 "2024-02-20T10:57:07Z")

</div>

I’m currently investigating a legacy project and came across an unusual snippet where the authentication server base URL and the audience base URL are identical. My understanding is that this is typically not allowed unless we are self-hosting Auth0, which is not an option in this case. Are there any scenarios where the provided code could be valid?

```auto
export async function getOauthToken(): Promise<Objects.Auth0TokenPayload> {
    const options = {
        method: 'POST',
        url: 'https://' + authvalues.DOMAIN + '/oauth/token',
        headers: { 'content-type': 'application/json' },
        json : true,
        body: {
            client_id : authvalues.API_CLIENTID,
            client_secret : authvalues.API_CLIENTSECRET,
            audience : 'https://' + authvalues.DOMAIN + '/api/v2/',
            grant_type : 'client_credentials',
        },
    };

    const resp = request.post(options) as unknown;

```

 ![image](https://global.discourse-cdn.com/auth0/original/3X/8/d/8ddb016efafa2c784d43d40b5d6d6215f8d5d386.png)

More clue: nodejs that serve an angular front end (run in same port)

Thank you for your assistance.

---

<div class="post-metadata">

**Author:** ![ty.frith](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ty.frith/32/58484_2.png) [@ty.frith](https://community.auth0.com/u/ty.frith)\
**Post date:** [February 24, 2024, 1:15am UTC](https://community.auth0.com/t/auth-server-and-audience-base-url-can-be-the-same/127829/3 "2024-02-24T01:15:18Z")

</div>

Hey @aamuzakii welcome to the community!

> [@aamuzakii](#):
>
> My understanding is that this is typically not allowed unless we are self-hosting Auth0, which is not an option in this case. Are there any scenarios where the provided code could be valid?

This looks to me like code to obtain a [management API access token](https://auth0.com/docs/secure/tokens/access-tokens/get-management-api-access-tokens-for-production) for which is it valid as far as I can tell.

---

<div class="post-metadata">

**Author:** ![aamuzakii](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/aamuzakii/32/54973_2.png) [@aamuzakii](https://community.auth0.com/u/aamuzakii)\
**Post date:** [February 24, 2024, 2:27pm UTC](https://community.auth0.com/t/auth-server-and-audience-base-url-can-be-the-same/127829/4 "2024-02-24T14:27:55Z")

</div>

Thanks, I just realize it. We cannot create API with identifier pointing to auth0 domain, but there’s already existing API using such identifier, i.e. the Managemen API

---

<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:** [March 9, 2024, 2:28pm UTC](https://community.auth0.com/t/auth-server-and-audience-base-url-can-be-the-same/127829/5 "2024-03-09T14:28:42Z")

</div>

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