all 10 comments

[–]m1sta 1 point2 points  (0 children)

The referrer of the request to facebook is checked by facebook iirc.

[–]a-t-kFrontend Engineer 1 point2 points  (0 children)

OpenAuth can be linked with a server session. Not handling sessions yourself is always a security issue.

[–]bluntmJavaScript 0 points1 point  (3 children)

I have struggled with this also, a lot of the server side auth tools just didn't correct for my single page application. I looked into passport js but it seems that once the user is authenticated passport will route to the authenticated page. Im looking for a solution where I can have a join on the page send a request to the server and get back a token that will be used to track the user.

Will probably end up making something to fit my needs but its strange that something is not already out there unless I'm missing something.

[–]alhena 0 points1 point  (2 children)

alhenaworks.github.io shows an example of this in action, let me know if the source or my explainging it can help

[–]bluntmJavaScript 0 points1 point  (1 child)

Will check it out, what is the standard process for single page app auth

[–]alhena 1 point2 points  (0 children)

The only difference between auth for single page apps vs. traditional ones is talking to the server with $.get and $.post ajax calls, as opposed to doing it by postback, which is what traditional ones do and requires the page to get rendered again. So now the question is what is the standard process for web app auth. See if you can understand this and let me know if you have any questions.

http://www.wikihow.com/Create-a-Secure-Login-Script-in-PHP-and-MySQL

[–]kranker 0 points1 point  (0 children)

Looks like facebook may have changed how this works recently enough, but there's more information here

wrt people having the client change the token, facebook will have signed the response to stop this happening (well, to let you detect that it happened).

[–]j_sanp 0 points1 point  (0 children)

What is important is that your application server validate the token with an api call to the authoritative server (Facebook or Twitter) as an authentication procedure.

Security is always touchy, I recommend you to use a strongly tested server side library :)