# Native Android PKCE returns wrong access-token audience despite explicit audience and active user-delegated grant

**URL:** <https://community.auth0.com/t/native-android-pkce-returns-wrong-access-token-audience-despite-explicit-audience-and-active-user-delegated-grant/205173>\
**Category:** Get Help\
**Tags:** pkce\
**Created:** [November 9, 2026, 8:35am UTC](https://community.auth0.com/t/native-android-pkce-returns-wrong-access-token-audience-despite-explicit-audience-and-active-user-delegated-grant/205173 "2026-11-09T08:35:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![cattleweight-auth](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/cattleweight-auth/32/81635_2.png) [@cattleweight-auth](https://community.auth0.com/u/cattleweight-auth)\
**Post date:** [November 9, 2026, 8:35am UTC](https://community.auth0.com/t/native-android-pkce-returns-wrong-access-token-audience-despite-explicit-audience-and-active-user-delegated-grant/205173/1 "2026-11-09T08:35:28Z")

</div>

Hello Auth0 Community,

I’m investigating unexpected access token audience behavior in a native Android application using Auth0 Authorization Code Flow with PKCE (S256).

The application needs separate access tokens for two custom APIs.

For illustration, their identifiers are:

- API A: `https://api.example.com`

- API B: `https://consumer-api.example.com`

All identifiers above are placeholders.

**Configuration**

- Application type: Native, first-party

- Both APIs are registered as Resource Servers

- Signing algorithm: RS256

- API Access Policy: Per-app authorization

- The Native application has an active user-delegated access entry for API B

- API B defines no custom permissions; the dashboard displays 0/0 permissions granted

- No custom Post Login Actions or claim mappings

- Tenant Default Audience is empty

- Callback URLs and identity-provider connections are configured

**Observed behavior**

The application explicitly requests API B using the `audience` parameter in `/authorize`, together with the correct client ID, redirect URI, scopes, state, nonce, and PKCE challenge.

The authorization completes successfully and the code is exchanged at `/oauth/token`.

However, the returned access token does not contain API B’s audience.

The JWT signature, issuer, subject, and expiration were successfully checked. The application rejects the token because the audience does not match the requested API.

The same behavior was reproduced after rebuilding the application and repeating the authorization.

**Questions**

1. Under Per-app authorization, is an active user-delegated client grant with zero custom API permissions sufficient to obtain an access token for that API?

2. Is there an additional API Access Policy or Native application setting required for Auth0 to honor the requested audience?

3. If Authorization Code + PKCE completes successfully but the access token has a different audience, what is the recommended way to diagnose whether the result is caused by the grant policy, an OAuth request parameter, or token issuance behavior?

4. Should the `audience` be specified only in `/authorize`, or can including it again in `/oauth/token` affect the resulting access token?

We want to preserve least-privilege access and avoid adding unnecessary scopes, enabling unrestricted access, or changing the tenant-wide Default Audience.

Any guidance on the relevant configuration or a reliable diagnostic procedure would be appreciated.

Thank you!

---

<div class="post-metadata">

**Author:** ![nik.baleca](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/nik.baleca/32/68749_2.png) [@nik.baleca](https://community.auth0.com/u/nik.baleca)\
**Post date:** [November 9, 2026, 2:59pm UTC](https://community.auth0.com/t/native-android-pkce-returns-wrong-access-token-audience-despite-explicit-audience-and-active-user-delegated-grant/205173/3 "2026-11-09T14:59:32Z")

</div>

Hi @cattleweight-auth

Welcome to the Auth0 Community!

You are asking why an Authorization Code Flow with PKCE request from a native Android application returns an access token whose audience does not match API B, even though the `audience` parameter is sent to `/authorize`, and whether the Per-app authorization grant, an API Access Policy setting, or the `/oauth/token` request is responsible.

> **1. Under Per-app authorization, is an active user-delegated client grant with zero custom API permissions sufficient to obtain an access token for that API?**

**No.** Under Auth0’s **Per-app authorization** policy, an active client grant with zero permissions (`scope: []`) and `allow_all_scopes: false` (the default dashboard behavior when 0 permissions are selected) is treated by the token issuance engine as having **no authorized access to that Resource Server**.

- When an application requests an `audience` for which it has no authorized scopes under Per-app authorization, Auth0 drops or ignores the requested audience rather than failing the authentication request.

- It falls back to issuing a baseline access token for the `/userinfo` endpoint (typically an opaque token, or a JWT with `aud: "https://<your-tenant>.auth0.com/userinfo"`).

- **Least-Privilege Fix:** You do not have to switch to unrestricted access or change the tenant default audience. You have two supported options:

```auto
     PATCH /api/v2/client-grants/{client_grant_id}
     Content-Type: application/json

     {
       "allow_all_scopes": true
     }

```

` This authorizes the app to receive access tokens for that audience even if the API defines no custom permissions.`

1. **Define a baseline/default scope:** Add at least one permission on API B (e.g., `read:profile` or a base API access scope) and grant that permission to the Native Application in the dashboard.

* * *

> **2. Is there an additional API Access Policy or Native application setting required for Auth0 to honor the requested audience?**

**No additional global or Native application settings are required.**

Auth0 will honor the requested audience in Authorization Code + PKCE provided that:

1. **The Client Grant exists and permits access:** It links `client_id` (Native app) and `audience` (API B) and has either `allow_all_scopes: true` or at least one granted scope.

2. **String exactness:** The `audience` parameter sent in `/authorize` matches the API Identifier registered in **Applications \> APIs** character-for-character (case sensitivity, protocol `https://`, and any trailing slashes).

* * *

> **3. Recommended diagnostic steps**

To isolate whether the issue stems from grant policy, request parameters, or token issuance:

1. **Inspect the Client Grant record via Management API:**  
Call the Management API to inspect the grant object directly:

2. **Inspect the returned Access Token’s** `aud` claim:

3. **Inspect Auth0 Tenant Logs** (`Monitoring > Logs`):

* * *

> **4. Should** `audience` **be specified only in** `/authorize`, **or can including it again in** `/oauth/token` **affect the resulting access token?**

- `audience` must be specified in `/authorize`.

- **Including it in** `/oauth/token` has no effect.

In the OAuth 2.0 Authorization Code Flow with PKCE, the authorization code (`code`) is an opaque, short-lived reference bound on the server side to all parameters negotiated during `/authorize` (including `client_id`, `redirect_uri`, user identity, authorized scopes, and the target `audience`).

When your application posts to `/oauth/token` with `grant_type=authorization_code`, Auth0 issues tokens based strictly on the parameters bound to the code. Repeating or adding `audience` to the `/oauth/token` POST body is ignored and cannot alter or override the audience assigned to the grant.

Kind Regards,  
Nik

---

<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:** [November 19, 2026, 3:00pm UTC](https://community.auth0.com/t/native-android-pkce-returns-wrong-access-token-audience-despite-explicit-audience-and-active-user-delegated-grant/205173/4 "2026-11-19T15:00:20Z")

</div>

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