# Preventing a Multiple Audiences Array

**URL:** <https://community.auth0.com/t/preventing-a-multiple-audiences-array/75327>\
**Category:** Get Help\
**Tags:** jwt, api, scope, aws-credentials, audience\
**Created:** [December 22, 2021, 11:49am UTC](https://community.auth0.com/t/preventing-a-multiple-audiences-array/75327 "2021-12-22T11:49:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jakub.tkac](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jakub.tkac/32/33232_2.png) [@jakub.tkac](https://community.auth0.com/u/jakub.tkac)\
**Post date:** [December 22, 2021, 11:49am UTC](https://community.auth0.com/t/preventing-a-multiple-audiences-array/75327/1 "2021-12-22T11:49:03Z")

</div>

Hi,

We are currently developing a Vue SPA with help of the [Auth0 SPA js SDK](https://github.com/auth0/auth0-spa-js/), which requests access tokens and sends them to our API.

Our API utilizes AWS STS to receive short term credentials for accessing our data layer with a customer-scoped, dynamic policy, to shift the authorization out of the service development’s scope and increase the security level by ensuring tenant-isolation.  
AWS STS **accepts only a String** when requesting credentials with a WebIdentity.  
It all works perfectly fine, when requesting credentials with an access token from Auth0 with a single Audience String.

Unfortunately, as I understand the [documentation](https://auth0.com/docs/security/tokens/access-tokens/get-access-tokens#multiple-audiences), whenever the scope openid and an API audience is send to get an access token, it will always **return an Array.**  
And as the SPA SDK always sends the openid scope, we are a bit in a jam.

Is it possible to receive only a single audience in the token when using the SPA SDK?

Are there different workarounds or is our approach not suitable, maybe wrong?

Thank you!

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [December 23, 2021, 5:24pm UTC](https://community.auth0.com/t/preventing-a-multiple-audiences-array/75327/3 "2021-12-23T17:24:01Z")

</div>

Hi @jakub.tkac,

According to the following thread it looks like it is not possible.

> [@Access token has two audiences?](https://community.auth0.com/t/access-token-has-two-audiences/71041/3):
>
> Hey @woeterman94 , You cannot remove the /userinfo audience. It is included by default for all issued Access Tokens. If you specify an audience of your custom API identifier and a scope of openid, then the resulting access token’s aud claim will be an array rather than a string, and the access token will be valid for both your custom API and for the /userinfo endpoint. Other than in the use case of a single custom API as well as Auth0’s /userinfo endpoint, your access tokens will be unable to …

---

<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:** [January 7, 2022, 5:24pm UTC](https://community.auth0.com/t/preventing-a-multiple-audiences-array/75327/4 "2022-01-07T17:24:54Z")

</div>

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