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

Facebook OAuth not working #374

Closed
adrianhorning08 opened this issue Feb 4, 2022 · 8 comments
Closed

Facebook OAuth not working #374

adrianhorning08 opened this issue Feb 4, 2022 · 8 comments
Labels
bug Something isn't working For discussion To discuss during next Auth catchup p3 Priority 3 provider-related-bug Provider related bugs

Comments

@adrianhorning08
Copy link

adrianhorning08 commented Feb 4, 2022

Bug report

Describe the bug

When using Facebook OAuth to login with a test user (someone other than the admin who created the Facebook App), I am getting an error and unable to login.

Either I receive:
{ "message":"An invalid response was received from the upstream server" }

Or: "error=server_error&error_description=Error+getting+user+email+from+external+provider"

I know that the the issue with the latter error is a user not having an email address (#214 ), but if you create a test user in Facebook, they do have email addresses.

I have tested this with another Facebook account I have created that wasn't a "test user" per se, and same thing happened.

To Reproduce

You will have to create your own Facebook App. *You can see the error locally, so no need to deploy it yourself.

I just followed these guides to create a quick app and Facebook Login:
Next.js App
Facebook Login

So the steps would be...

  1. Create an app (I created a Next js one)
  2. Implement Facebook Login
  3. Login with your admin user. Everything should be fine.
  4. Try logging in with a test user by going to Roles > Test users > Create Test Users. Then try logging into your app with that test user.
  5. Should see an error.

Heres a loom video

Expected behavior

Should not see error and should redirect you to /accounts page. And when you revisit the home page, it should remember your session and not prompt you to login.

Screenshots

If applicable, add screenshots to help explain your problem.

System information

  • OS: macOS
  • Browser: chrome
  • Version of supabase-js: @supabase/supabase-js": "^1.30.0
  • Version of Node.js: v16.13.0

Additional context

@adrianhorning08 adrianhorning08 added the bug Something isn't working label Feb 4, 2022
@matepapp
Copy link

matepapp commented Feb 6, 2022

hey! same happens with Google provider in my case.

@awalias
Copy link
Member

awalias commented Feb 7, 2022

taking a look, thanks for the great repro steps and vid @adrianhorning08

@J0 J0 added the For discussion To discuss during next Auth catchup label Feb 7, 2022
@kangmingtay
Copy link
Member

hey @matepapp and @adrianhorning08, we have investigated the issue with this error { "message":"An invalid response was received from the upstream server" } and I am able to reproduce this error with Facebook logins using a test user, but it seems to work fine with the admin user as you suggested.

The reason this happens is because we started setting the tokens in the cookies as of this PR which resulted in the header size exceeding the limits enforced by the API gateway. We're working on a fix for this and will notify you guys once it's out!

@matepapp
Copy link

matepapp commented Feb 9, 2022

hey @kangmingtay,

thanks for the quick and detailed response and also for the investigation. take your time and let us know how it goes 💪

@kangmingtay
Copy link
Member

hey @matepapp and @adrianhorning08, could you please email support@supabase.com with your project reference and I'll fix the issue for your projects, thanks!

@adrianhorning08
Copy link
Author

@kangmingtay I actually switched to firebase for the auth 😅 Project was time sensitive. Thanks so much for investigating this.

@matepapp
Copy link

hey @kangmingtay, I didn't have a lot of time since my latest comment but I just checked in my side project, and seems like the issue got resolved 👍 I could log in & log out with Google without any issue. thanks for the help! I'll make sure to send an email in case it happens again.

@J0 J0 added the provider-related-bug Provider related bugs label Apr 19, 2022
@J0
Copy link
Contributor

J0 commented May 6, 2022

Hey all,

It seems like this issue has been resolved for now so we're going to close this issue. Feel free to let us know if you have any concerns or if you run into this issue again.

Thanks!

@J0 J0 closed this as completed May 6, 2022
@egor-romanov egor-romanov added the p3 Priority 3 label Jun 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working For discussion To discuss during next Auth catchup p3 Priority 3 provider-related-bug Provider related bugs
Projects
None yet
Development

No branches or pull requests

6 participants