# Get Access Token error

**URL:** <https://community.auth0.com/t/get-access-token-error/128178>\
**Category:** Get Help\
**Tags:** configuration, application\
**Created:** [February 23, 2024, 5:35pm UTC](https://community.auth0.com/t/get-access-token-error/128178 "2024-02-23T17:35:50Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![gperezcidra](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/gperezcidra/32/74566_2.png) [@gperezcidra](https://community.auth0.com/u/gperezcidra)\
**Post date:** [February 23, 2024, 5:35pm UTC](https://community.auth0.com/t/get-access-token-error/128178/1 "2024-02-23T17:35:50Z")

</div>

I have a NextJS app that I’ve integrated with Auth0. I was retrieving an access token without issue when the user logs in using the getAccessToken async function from @auth0/nextjs-auth0 that I have as a call using a local route that I’ve created. However, recently I’ve been getting an error message now. I am using the free version and I’ve changed some settings in relation to MFA but since reverted the settings back to the original since I’ve got this message. I’ve also tried a different tenant altogether and changed the env vars to reflect the new app and still getting the same error message. I’ve also made changes in my repo but have tried different branches prior to the changes with the same result. I’m not sure what the cause is. Would anything have any idea? The error message is as follows:

```auto
{
    "digest": "DYNAMIC_SERVER_USAGE"
}

```

---

<div class="post-metadata">

**Author:** ![ty.frith](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ty.frith/32/58484_2.png) [@ty.frith](https://community.auth0.com/u/ty.frith)\
**Post date:** [February 23, 2024, 5:45pm UTC](https://community.auth0.com/t/get-access-token-error/128178/2 "2024-02-23T17:45:18Z")

</div>

Hey there @gperezcidra welcome to the community!

I just did some searching internally and wasn’t able to come up with anything related to that error 😕 I did stumble across this stackoverflow post which leads me to believe it might have more to do with NextJS than Auth0:

> <https://stackoverflow.com/questions/75051613/digest-dynamic-server-usage-nextjs-13>

---

<div class="post-metadata">

**Author:** ![gperezcidra](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/gperezcidra/32/74566_2.png) [@gperezcidra](https://community.auth0.com/u/gperezcidra)\
**Post date:** [February 23, 2024, 6:15pm UTC](https://community.auth0.com/t/get-access-token-error/128178/3 "2024-02-23T18:15:42Z")

</div>

Hey @ty.frith, I appreciate your warm welcome and contribution to my question. I’m going to try out the solution that they posted in that Stack Overflow article and let you know how it goes. Thanks!

---

<div class="post-metadata">

**Author:** ![gperezcidra](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/gperezcidra/32/74566_2.png) [@gperezcidra](https://community.auth0.com/u/gperezcidra)\
**Post date:** [February 23, 2024, 6:47pm UTC](https://community.auth0.com/t/get-access-token-error/128178/4 "2024-02-23T18:47:39Z")

</div>

Hi @ty.frith, that was the solution after all. The user in the article suggested to add `export const dynamic = "force-dynamic";` it to the top root layout page. However, I had to also add it to the API route in relation to the access token retrieval call that I’m making to Auth0 from that route as well and it is now responding back with the access token on the server app as well. Thank you so much!

---

<div class="post-metadata">

**Author:** ![ty.frith](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ty.frith/32/58484_2.png) [@ty.frith](https://community.auth0.com/u/ty.frith)\
**Post date:** [February 23, 2024, 9:45pm UTC](https://community.auth0.com/t/get-access-token-error/128178/5 "2024-02-23T21:45:44Z")

</div>

Hey @gperezcidra that’s great to know, thanks for sharing with the rest of the community! 🙂

---

<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:** [March 8, 2024, 9:45pm UTC](https://community.auth0.com/t/get-access-token-error/128178/6 "2024-03-08T21:45:48Z")

</div>

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