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?
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;
More clue: nodejs that serve an angular front end (run in same port)
Thank you for your assistance.