# NextJS & Deprecation of the Fixed size Authorization Code and Access Tokens

**URL:** <https://community.auth0.com/t/nextjs-deprecation-of-the-fixed-size-authorization-code-and-access-tokens/80875>\
**Category:** Get Help\
**Tags:** opaque-access-token, deprecation, nextjs\
**Created:** [March 31, 2022, 4:25am UTC](https://community.auth0.com/t/nextjs-deprecation-of-the-fixed-size-authorization-code-and-access-tokens/80875 "2022-03-31T04:25:50Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![jordie](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jordie/32/36283_2.png) [@jordie](https://community.auth0.com/u/jordie)\
**Post date:** [March 31, 2022, 4:25am UTC](https://community.auth0.com/t/nextjs-deprecation-of-the-fixed-size-authorization-code-and-access-tokens/80875/1 "2022-03-31T04:25:50Z")

</div>

We are getting the notifications regarding the deprecation of fixed length tokens and migration to Authorization Code and Access Token Variable Size. [Deprecations and Migrations](https://auth0.com/docs/troubleshoot/product-lifecycle/deprecations-and-migrations)

We are using nextjs-auth0 package: [GitHub - auth0/nextjs-auth0: Next.js SDK for signing in with Auth0](https://github.com/auth0/nextjs-auth0)

I’m unclear on what we need to do in order to prepare for this change. Is there config change we need to make?

We are using an older version of the package, I can not see any mention in the changelog regarding updates for this specific issue, so I’m not sure if upgrading would help? I know someone will say “upgrading is always recommended”, problem is the package was rewritten at one point so it’s not just a quick update, there’s work required around migrating to the new version. I’d like to know if we put in this effort will it fix this deprecation issue? Or is it based on config we’re putting in?

Please include the following information in your post:

- **Which SDK this is regarding:** nextjs-auth0
- **SDK Version:** 0.15.0
- **Platform Version:** Node 14.19.1

---

<div class="post-metadata">

**Author:** ![krasimir](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/krasimir/32/21949_2.png) [@krasimir](https://community.auth0.com/u/krasimir)\
**Post date:** [April 1, 2022, 5:05am UTC](https://community.auth0.com/t/nextjs-deprecation-of-the-fixed-size-authorization-code-and-access-tokens/80875/2 "2022-04-01T05:05:17Z")

</div>

I want to double this one. In the notification I’m reading

> 1. **Modify each identified application** that relies on fixed-size Access Token and Authorization Code credentials so that those applications will accept the new variable size values.

What exactly needs to be modified in those apps?

---

<div class="post-metadata">

**Author:** ![jordie](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jordie/32/36283_2.png) [@jordie](https://community.auth0.com/u/jordie)\
**Post date:** [April 5, 2022, 4:43am UTC](https://community.auth0.com/t/nextjs-deprecation-of-the-fixed-size-authorization-code-and-access-tokens/80875/3 "2022-04-05T04:43:50Z")

</div>

Deadline is nearing, it’d be great to get some official advice on this.

---

<div class="post-metadata">

**Author:** ![cookson.lance](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/cookson.lance/32/33715_2.png) [@cookson.lance](https://community.auth0.com/u/cookson.lance)\
**Post date:** [April 5, 2022, 4:21pm UTC](https://community.auth0.com/t/nextjs-deprecation-of-the-fixed-size-authorization-code-and-access-tokens/80875/4 "2022-04-05T16:21:57Z")

</div>

It looks like it is a toggle under the advanced settings of your dashboard, you need to scroll down to the migrations section and disable the fixed-length toggle. Would have been helpful if that had been included in the migration documentation.

> [@Opaque Access Token and Authorization Code Fixed Length Announcement](https://community.auth0.com/t/opaque-access-token-and-authorization-code-fixed-length-announcement/71908):
>
> Hello everyone, we wanted to bring visibility to the fact that beginning April 12, 2022, access token and authorization codes will be issued with varying lengths to support [OAuth specification RFC6749](https://datatracker.ietf.org/doc/html/rfc6749) to avoid clients making assumptions about authorization code and access token values. Currently, the access token and authorization code sizes are fixed. The current size of the authorization code is shorter than what some security practitioners recommend. Through this change, Auth0 provides a str…

---

<div class="post-metadata">

**Author:** ![jordie](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jordie/32/36283_2.png) [@jordie](https://community.auth0.com/u/jordie)\
**Post date:** [April 5, 2022, 11:39pm UTC](https://community.auth0.com/t/nextjs-deprecation-of-the-fixed-size-authorization-code-and-access-tokens/80875/5 "2022-04-05T23:39:50Z")

</div>

> [@cookson.lance](#):
>
> It looks like it is a toggle under the advanced settings of your dashboard, you need to scroll down to the migrations section and disable the fixed-length toggle. Would have been helpful if that had been included in the migration documentation.

Thanks. I was aware of this, but not certain if when I toggle it whether the nextjs library will just work fine or not. Or if there is a particular version we need to be on or a config value we need to set/change.

---

<div class="post-metadata">

**Author:** ![jordie](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jordie/32/36283_2.png) [@jordie](https://community.auth0.com/u/jordie)\
**Post date:** [April 6, 2022, 7:36am UTC](https://community.auth0.com/t/nextjs-deprecation-of-the-fixed-size-authorization-code-and-access-tokens/80875/6 "2022-04-06T07:36:36Z")

</div>

FYI, a response was made here:

> <https://github.com/auth0/nextjs-auth0/issues/636>
>
> \### Description
> 
> I posted a thread on the auth0 community as suggested but the…re's been no response from auth0 or package developers. So this doesn't match any of the Issue types but if you're gonna push people to the auth0 community you should at least be active there.
> 
> We are using this package and are getting deprecation notices in our auth0 logs.
> 
> Please can you make this clear: Is this package ready for the deprecation of the fixed size Authorization Code and Access Tokens? Is it all versions of the package which work or is there a particular version required? Or is there some configuration option we need to check/change to handle it?
> 
> Thread: 
> https://community.auth0.com/t/nextjs-deprecation-of-the-fixed-size-authorization-code-and-access-tokens/80875

> Hi - thanks for raising this.

> Some SDKs, including this one, store the Access Token (encrypted) in a cookie - so a larger Access Token will mean a larger cookie. If you already specify an `audience` - then the cookie size will not change, if you don’t then the Access Token will increase (it will go from an opaque id to a JWT, which can be roughly 1kb larger). If you are in the unlikely position of already being close to the maximum header size (16kb in Node \>12) with your other cookies, a larger session cookie could potentially take you over that limit.

> But on the whole, we don’t expect this package, or any of our SDKs, to be affected by the size of the Authorization Code or the Access Token. You can verify this by toggling on the migration in your development tenant and confirming it locally.

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [April 6, 2022, 1:04pm UTC](https://community.auth0.com/t/nextjs-deprecation-of-the-fixed-size-authorization-code-and-access-tokens/80875/7 "2022-04-06T13:04:16Z")

</div>

Thanks for sharing that with the rest of community!

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [July 28, 2022, 1:09pm UTC](https://community.auth0.com/t/nextjs-deprecation-of-the-fixed-size-authorization-code-and-access-tokens/80875/8 "2022-07-28T13:09:19Z")

</div>


