# "unauthorized (Access denied.)" after login

**URL:** <https://community.auth0.com/t/unauthorized-access-denied-after-login/73911>\
**Category:** Get Help\
**Tags:** blog, nextjs, login, auth0\
**Created:** [November 29, 2021, 12:30pm UTC](https://community.auth0.com/t/unauthorized-access-denied-after-login/73911 "2021-11-29T12:30:56Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![rizwan](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rizwan/32/13599_2.png) [@rizwan](https://community.auth0.com/u/rizwan)\
**Post date:** [November 29, 2021, 12:30pm UTC](https://community.auth0.com/t/unauthorized-access-denied-after-login/73911/1 "2021-11-29T12:30:56Z")

</div>

Hi, I’ve followed the steps in the blog article [Using Next.js and Auth0 with Supabase](https://auth0.com/blog/using-nextjs-and-auth0-with-supabase/) to set up Auth0 with a nextjs.

I’ve set up an application in Auth0 as per the article and the nextjs app. Everything is working up until when I log in. I can successfully authenticate with a username/password but then I get an “unauthorized (Access denied.)” error on the callback. If I look in the logs I see the following error

```auto
"connection": "Username-Password-Authentication",
  "error": {
    "message": "Access denied.",
    "oauthError": "unauthorized",
    "type": "oauth-authorization"
  },

```

Are there any extra steps that need to be completed or have I misconfigured something?

Thanks

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [November 29, 2021, 10:54pm UTC](https://community.auth0.com/t/unauthorized-access-denied-after-login/73911/3 "2021-11-29T22:54:24Z")

</div>

Hi @rizwan,

Welcome to the Auth0 Community!

Do you have any rules, actions, or hooks running that could be returning this error?

---

<div class="post-metadata">

**Author:** ![rizwan](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rizwan/32/13599_2.png) [@rizwan](https://community.auth0.com/u/rizwan)\
**Post date:** [November 30, 2021, 3:34pm UTC](https://community.auth0.com/t/unauthorized-access-denied-after-login/73911/4 "2021-11-30T15:34:16Z")

</div>

Thanks Dan!

It looks like I had a rogue sample rule setup, removing this solved the problem. 🦸‍♂️

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [November 30, 2021, 4:22pm UTC](https://community.auth0.com/t/unauthorized-access-denied-after-login/73911/5 "2021-11-30T16:22:49Z")

</div>

Great! Thanks for following up!

---

<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:** [December 15, 2021, 4:23pm UTC](https://community.auth0.com/t/unauthorized-access-denied-after-login/73911/6 "2021-12-15T16:23:32Z")

</div>

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