# How does the auth0-nextjs withMiddlewareAuthRequired function work?

**URL:** <https://community.auth0.com/t/how-does-the-auth0-nextjs-withmiddlewareauthrequired-function-work/128535>\
**Category:** Get Help\
**Tags:** authentication-sessions, sessions\
**Created:** [February 28, 2024, 8:53pm UTC](https://community.auth0.com/t/how-does-the-auth0-nextjs-withmiddlewareauthrequired-function-work/128535 "2024-02-28T20:53:34Z")\
**Posts on this page:** 1\
**Showing post:** 3

<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 28, 2024, 11:22pm UTC](https://community.auth0.com/t/how-does-the-auth0-nextjs-withmiddlewareauthrequired-function-work/128535/3 "2024-02-28T23:22:34Z")

</div>

Hey again @Outbound5070 !

As far as I can tell what you are looking for isn’t supported:

> [@React native + nextjs + auth0](https://community.auth0.com/t/react-native-nextjs-auth0/100945/6):
>
> I got an answer: The Auth0 Next.js SDK is intended for web login and it uses cookie-based authentication and authorization instead of a token-based approach. Therefore, calling a protected Next.js API from another client is not supported.

---

_[View the full topic](https://community.auth0.com/t/how-does-the-auth0-nextjs-withmiddlewareauthrequired-function-work/128535)._
