Flow for FB authentication to Discourse site in FB app


(Charles Walter) #1

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.


(Jeff Atwood) #2

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


(Neil Lalonde) #3

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.


(Charles Walter) #4

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 ;).


(Charles Walter) #5

@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?


(Robin Ward) #6

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!


(Charles Walter) #7

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


(Robin Ward) #8

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.


(Charles Walter) #9

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:



(Robin Ward) #10

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


(Charles Walter) #11

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


(Robin Ward) #12

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!)


(Charles Walter) #13

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: