achedeuzot / ueberauth_auth0

Auth0 OAuth2 strategy for Überauth.
https://hexdocs.pm/ueberauth_auth0
MIT License
71 stars 46 forks source link

"Unauthorized" error when authenticating via Auth0 #1

Closed jellybob closed 8 years ago

jellybob commented 8 years ago

My Phoenix application is failing in the auth callback because the only response I can get from Auth0's token endpoint is "Unauthorized". I can use the same client ID/secret in Ruby's OAuth2 library, so I'm pretty confident its not a configuration issue. I also see the same behaviour when I try using the underlying Elixir OAuth2 library from an Elixir console.

Is this something you've seen before? I'm pretty stumped at this point, but would love to be able to use this library.

sntran commented 8 years ago

Is there a way you can reproduce the issue with a small example? This library is very simple and just uses OAuth2, and I did not have any issue.

I would definitely love to work with you to trace the issue out.

jellybob commented 8 years ago

https://github.com/jellybob/traverse/tree/auth0-debugging/web is the code I'm working with. There's basically nothing there at the moment other than ueberauth, and enough Javascript to trigger the Auth0 dialog.

sntran commented 8 years ago

Would you mind double checking the following:

jellybob commented 8 years ago

Done - http://localhost:4000/auth/auth0/callback was already in the call back list, but I've added the root as well now. Nothing was in CORS.

sntran commented 8 years ago

My initial debug shows two things:

sntran commented 8 years ago

Hi @jellybob ,

I have pushed a patch to use the new oauth2 version. Please give it a try.

jellybob commented 8 years ago

Thanks, just updated and its working now :)