Can't login to Discourse ID with Facebook

I saw the banner on meta.discourse.org saying that my Facebook social login would be removed, recommending that I switch to Discourse ID. So, I clicked the link to Discourse ID and tried Sign in with Facebook, and it failed.

It looks like your Facebook settings are incorrect. Since login with Facebook doesn’t work yet, I think y’all should extend the November 30 deadline.

Feature Unavailable

Facebook Login is currently unavailable for this app, since we are updating additional details for this app. Please try again later.

2 Likes

Thanks for the report, Dan. I was able to log in using my Facebook account, but I see that App Review processes have changed, we need to provide some details on how we use Facebook’s AI. That is now done and we are waiting for review. Our Facebook app doesn’t do anything special, it only enables login via Facebook, but nonetheless, Meta (Facebook) needs to review. Hopefully they do this soon.

We will look into extending the deadline for this here on meta depending on how quickly that review goes through.

2 Likes

A common gotcha with Facebook Login is that it will work for users who are listed on Facebook’s admin settings as “developers” of the Facebook app, but not work for the general public.

I believe you would be able to reproduce the problem by following Facebook’s guide to testing Facebook Login.

1 Like

Good suggestion, thank you. I just did that and logged in with a throwaway account (that isn’t admin or developer on the app). Saw this screen:

1 Like

It’s working a little bit better now, but still not quite working. I think you’ve set the redirect URL to the wrong URL.

To repro:

If I follow those steps, I get sent to the homepage of id.discourse.com, I don’t get redirected to meta. I get logged in to ID and shown the ID homepage.

Unless, :thinking: there’s something lingering from a previous meta login attempt for you… Can you repro this on a different browser?

I’m on macOS 26.1. I repro the bug in Chrome 142.0, but not in Safari 26.1.

In Chrome Dev Tools, here’s what I see, with a few sensitive bits (code and state parameters) replaced with REDACTED below:

And then I end up at https://meta.discourse.org/auth/failure?message=csrf_detected&strategy=discourse_id 200 OK :roll_eyes:

3 Likes

Thanks, I can reproduce under certain conditions, I think I can see what is happening.

When a user starts an authentication from meta, we store a value for destination_url on the ID instance so that after authentication, the user can be taken back to where they were. But when the authentication isn’t completed within a short amount of time (it fails or user abandons auth), that destination_url is not cleaned up, it stays in the user’s browser session. The next time the user tries to log in, ID tries to redirect to that URL, but since it has an old code/state combination from the original auth flow, the redirect results in the “Sorry, the authorization timed out” error.

It should not redirect at all after a short amount of time, we need to make sure that the destination_url value gets cleaned up after 10 mins, I believe the code/state combo for authentication is only valid for 10 minutes, need to double check.

3 Likes