# Next.js App Router (Auth0Client): getAccessToken returns encrypted JWE (alg: dir) instead of JWT (RS256) despite correct Audience

**URL:** <https://community.auth0.com/t/next-js-app-router-auth0client-getaccesstoken-returns-encrypted-jwe-alg-dir-instead-of-jwt-rs256-despite-correct-audience/196450>\
**Category:** Get Help\
**Tags:** login-experience, new-universal-login-experience\
**Created:** [January 21, 2026, 7:03pm UTC](https://community.auth0.com/t/next-js-app-router-auth0client-getaccesstoken-returns-encrypted-jwe-alg-dir-instead-of-jwt-rs256-despite-correct-audience/196450 "2026-01-21T19:03:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![GuiEzz](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/guiezz/32/76273_2.png) [@GuiEzz](https://community.auth0.com/u/GuiEzz)\
**Post date:** [January 21, 2026, 7:03pm UTC](https://community.auth0.com/t/next-js-app-router-auth0client-getaccesstoken-returns-encrypted-jwe-alg-dir-instead-of-jwt-rs256-despite-correct-audience/196450/1 "2026-01-21T19:03:24Z")

</div>

Hi everyone,

I am facing a persistent issue integrating a **Next.js 15+ (App Router)** frontend with a **Python (FastAPI)** backend.

**The Problem:** Even though I have configured the `audience` correctly in my `Auth0Client` instantiation, the `auth0.getAccessToken()` method in my Next.js API route returns an **encrypted token** (`alg: dir`, JWE) instead of the expected **signed JWT** (`alg: RS256`).

My Python backend rejects this token because it expects a standard RS256 Access Token to validate against the JWKS.

**My Stack:**

- **SDK:** `@auth0/nextjs-auth0` (Latest version using App Router setup)

- **Frontend:** Next.js 15 (App Router)

- **Backend:** Python / FastAPI

- **Flow:** Authorization Code Flow

**Configuration:**

1. **Dashboard Settings:**

2. **Next.js Implementation (`src/lib/auth0.ts`):** I am instantiating the client manually to use in the App Router:

3. **The Proxy Route (`src/app/api/proxy/route.ts`):**

4. **The Auth Route (`src/app/api/auth/[auth0]/route.ts`):**

**What I have verified (Debugging):**

1. **Manual CURL Test (Success):** If I request a token manually using `client_credentials` via terminal:

2. **Browser Network Tab:** When checking the `/authorize` request initiated by the Next.js app, I suspect the `audience` parameter might not be passing through correctly, causing Auth0 to issue an opaque/encrypted session token instead of an API Access Token.

**The Question:** Why does `@auth0/nextjs-auth0` return an opaque/encrypted JWE (`alg: dir`) even when:

1. `audience` is set in `authorizationParams`.

2. JWE is disabled in the API settings in the Dashboard.

3. I am requesting a token for a Custom API.

How can I force the SDK to retrieve the decrypted RS256 Access Token so I can pass it to my external backend?

Any help is appreciated.

---

<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:** [January 22, 2026, 6:48pm UTC](https://community.auth0.com/t/next-js-app-router-auth0client-getaccesstoken-returns-encrypted-jwe-alg-dir-instead-of-jwt-rs256-despite-correct-audience/196450/3 "2026-01-22T18:48:31Z")

</div>

Hi @GuiEzz

Welcome to the Auth0 Community!

Can you try to go to the Auth0 Dashboard-\> Settings (Tenant setting)-\> API Authorization Settings-\> Default Audience -\>" Set it as same as your api audience“.

Let me know if this does the trick to you or not!

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:** [February 5, 2026, 6:49pm UTC](https://community.auth0.com/t/next-js-app-router-auth0client-getaccesstoken-returns-encrypted-jwe-alg-dir-instead-of-jwt-rs256-despite-correct-audience/196450/4 "2026-02-05T18:49:11Z")

</div>

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