Flow for FB authentication to Discourse site in FB app

Has anyone tried the flow of logging into their forums from within the fb app using fb authentication?

Not sure if this can be improved, but it wasnt really clear how to proceed after authenticating. Perhaps there’s a way to detect user is in FB app and show a button to reload previous page?

The back button at top just takes be back to FB. The back button on bottom just takes me to previous page unauthenticated.

This is a quirk of iOS as I recall. Refreshing the page or refreshing the previous page might work. @neil may remember this.

If I remember correctly, in Safari iOS that dialog would be in its own tab. Closing the tab would show that you have been logged in to Discourse. But it looks like the Facebook app’s web browser doesn’t have tabs.


Yeah! I wonder how other websites have worked around this. I will keep an eye out. Seems ironic that the FB app makes it difficult for websites to use FB authentication!

Next time you click on a link from your FB feed, see if they have FB authentication to see what happens ;).

1 Like

@codinghorror @neil

I tried FB login on the New York Times website today from within the iOS Facebook app browser, and did not run into the issue that we have with Discourse.

Perhaps someone can take a look at some point?

It looks like they aren’t popping up a window, so when we try to signal back to the application it is failing.

I did some testing today and am performing a redirect when the facebook browser is used instead of hanging on that page. It works for existing accounts but needs some additional work to support creating new logins. I will have to revisit to get that working, but at least you can log in smoothly now!


Thanks @eviltrout! Looking forward to seeing the changes. Will this be deployed to our community this week?

Update: I got the create account flow working too.

@charleswalter I’ll deploy your community right now and you should have access to it within a few minutes.


Thx @eviltrout

Though I was testing now and it doesnt seem to work if you try logging in from a topic page, which is what we generally try to promote. My experience is that the page hangs for a bit, tries to load, then redirects to homepage where it seems to continue to refresh

Perhaps it’s not worth the effort if Facebook makes it so conplicated :frowning:

Well I definitely don’t want to spend too much time on it, but I’ll see if it’s an easy fix.

1 Like

Yeah, maybe the simple / ironic solution is that we should disable FB login if we detect the FB browser!

What’s tricky about this for me is that you can’t make the facebook browser go to just any URL, so I don’t have any in my phone that go to our meta forum for a particular topic to test.

I could try on your forum maybe if you show me how to get facebook to link to a topic in the browser? (I’ll have to figure out spanish too!)

1 Like

We post a number of topics on our Facebook page. If you search Hello Foros from the FB app, you should find them.

Or simply post a Discourse topic on your own profile in private mode so that it only shows for you on your profile :slight_smile: