-
Notifications
You must be signed in to change notification settings - Fork 271
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
isAuthenticated returning false after successful login #49
Comments
Hi @alicemao23 - thanks for raising your issue This library uses the Authorization Code Flow with PKCE (https://auth0.com/docs/flows/concepts/auth-code-pkce) so
You should get an From what I can see your config looks fine. If you have a running version of an app, or can share the code, I might be able to help you debug the issue. |
Hi @adamjmcgrath! Thanks for getting back. So the error is
I don't have a running version of the app right now, just started up and is trying to work out the authentication part. I could definitely share the code, I just don't know of a way of me sharing it safely without needing to share sensitive data like my client id. Do you have any suggestions? Thank you! |
Hi @alicemao23
I'm not sure what your issue might be, do you have any rules configured on your tenant perhaps? Do the other values you are sending in the If you feel able to share your code, or a sample app where I can reproduce the issue, I might be able to help. But from the information you've given me I wont be able to figure much out |
You could also try running the basic sample app in this repo: https://github.com/auth0/auth0-react/blob/master/CONTRIBUTING.md#local-development replacing our clientId and domain for yours and seeing if that works |
Hi @adamjmcgrath ,
I tried that. My management logs show Full Error stack:
|
Hi @puengel - thanks for your input Could you raise a separate issue and share all the information I need to reproduce the error you're seeing? |
Issue moved here #51 |
Hi @alicemao23 - let me know if you've had any luck fixing your issue. Another thing to check would be that you have "Allowed Web Origins" set correctly in your dashboard. And that your Auth0 Application in your dashboard is set to "Single Page Application" Let me know if either of those suggestions helps |
I am also experiencing this same issue. I cloned the sample app (https://github.com/auth0-samples/auth0-react-samples) and added a config file with my Auth0 application's When I start my react app and visit What is going on? How can I fix this? Is my application configured incorrectly in Auth0? |
I'm having this same issue over the last two days. Same behavior as mentioned above: the user is directed to the lock login page, redirected back to the app, user authentication is never returned. I checked Issue #51 , but we have no rules in our app so this would not apply to our situation.
This has been a very disappointing way of spending the holiday weekend. :( |
@avala-HFI we hired a consultant familiar with Auth0 to fix our application in the Auth0 dashboard - he hasn't gotten to me with the changes that he made to get it working, but as soon as I know I will post it here and submit a request to Auth0 to update their documentation for this SDK since their steps do not work OOB |
Hi @avala-HFI Could you check if you have "Allowed Web Origins" set to the origin of your webapp (eg http://localhost:3000)? Let me know if either of those suggestions helps
Thanks @mwarnerdotme! please let us know if there's anything we can do to improve our docs |
@mwarnerdotme you are my personal hero! I'm looking forward to hearing what your consultant finds! @adamjmcgrath, I have two applications that are both set to Single Page Application and the Allowed Web Origins are set to http://localhost:3000. |
Thanks for confirming @avala-HFI Can you share a link to one of these running apps or the code so I can run one myself and debug the issue? |
@adamjmcgrath I'll have something out later this afternoon. |
@adamjmcgrath I've created a fairly basic React-Express-Node app using the same Auth0 quickstart guide and Auth0 application settings as our private projects. In all cases using the Quickstart guide, I'm experiencing the exact same issue where isAuthenticated returning false. You can find the example project here. Please let me know if you need any additional information. |
@adamjmcgrath Hi everyone, actually I have found a workaround on this issue even though I'm not exactly sure why this was the way it was. I also cannot replicate it, so maybe this will help (fingers crossed). My tenant was configured to be SinglePageApplication with Token End Point Authentication to be I actually changed it to be a few other variations of values including Obviously the configurations above weren't valid, so I switched back to |
@alicemao23 @adamjmcgrath That worked! I first toggled our application to |
Ah, thanks @alicemao23 @avala-HFI! I'm not sure why both your tenants were incorrectly configured even though they were showing the correct configuration I've just tested this myself by creating a new SPA Application in the dashboard and it seems to be working now, but I'll keep an eye out to see if anyone else runs into this and raise it internally. Closing this issue, feel free to reopen if you run into this again |
I was facing the same issue, now fixed with the workaround @alicemao23 provided. Thanks. |
I have the same issue but @alicemao23's fix didn't work for me. Any updates on this? |
I faced the same issue and @alicemao23's fix worked for me as well. 👍 |
after trying lots of alternatives this one has worked for me. from application type drop down menu you have to select single page application and the problem you are facing will probably disppear |
Hi,
Its my first time using the auth0-react SDK. I've implemented the login flow using guide, and have configured my app on Auth0 with Social Connection to LinkedIn. First login, the user is redirected to the UniversalLogin when they can login through LinkedIn, but as the user is redirected back to the application, the isAuthenticated value still remains false, and I see the POST require to
oauth/token
returning 401 unauthorized. On the Auth0 dashboard it also showed a successful login attempt with the user account.I've provided the Auth0Provider with the appropriate props & values filled in of course,
Am I missing anything?
The request header for the failing
oauth/token
request includesgrant-type: authorization-code
, with the code values from successful login request. On the Auth0 documentation, it seems that client-side applications should only be usinggrant-type: implicit
. Could this be the issue? Is there any way to specific the request sent by the SDK tooauth/token
as grant-type=implicit? Any help in how to fix this issue is greatly appreciated 🙏🏼The text was updated successfully, but these errors were encountered: