Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Signup and Login are successful but receive unauthorized #1

Open
minicatsCB opened this issue May 11, 2023 · 2 comments
Open

Signup and Login are successful but receive unauthorized #1

minicatsCB opened this issue May 11, 2023 · 2 comments

Comments

@minicatsCB
Copy link

minicatsCB commented May 11, 2023

Hello, I am following the Angular By Authentication Example. Just downloaded the repo and checkout the basic-authentication branch. Also, I set the .env file with the properties described in the guide.

I start the app in local. Both signup and login work because I can see the new users in my OAuth account under https://manage.auth0.com/dashboard/eu/<domain>/users. However, when the app returns to http://localhost:4040/callback the app UI shows "Error Unauthorized". And I can see in the DevTools that the POST request to https://<domain>/oauth/token returned a 401. The payload seems OK but the response says
{"error":"access_denied","error_description":"Unauthorized"}`. See image:
image

The logs under https://manage.auth0.com/dashboard/eu/<domain>/logs show the successful login but immediately a Failed Exchange error:
image

The result is that I can't use the sample app at all.

@mregger
Copy link

mregger commented Jul 19, 2023

I've been dealing with the same issue both using this codebase and my own project. Did you get any luck solving it?

Edit: It seems like changing your application from a Single Page Application to a Regular Web Application does the trick. Not sure why

@minicatsCB
Copy link
Author

minicatsCB commented Jul 31, 2023

Hi! I could solve it by double checking the Application URIs under Applications > Applications section in Auth0 Dashboard. It worked with SPA mode selected. My config was the below (you choose the port number):

Application Login URI -> empty
Allowed Callback URLs -> http://localhost:4040/callback
Allowed Logout URLs -> http://localhost:4040
Allowed Web Origins -> http://localhost:4040

Let me know if you still have the same problem.
(sorry for the late reply)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants