How does the Facebook Like button work?

I want to provide a simple piece of Javascript (or an iframe, I guess) that allows 3rd parties to embed functionality from my site in theirs. The user of said widget will be authenticated on our site already – so basically the Facebook Like button, or Facebook Connect, are the closest examples I could find.

Since Facebook has a few different buttons I’m struggling to understand exactly what they’re doing though. Is there a succinct (and technical – I’m a developer and want to build my own widget) explanation somewhere? I’m particularly focused on the security issues involved.

Here is a brief explanation of the facebook ‘like’ button and here is a tutorial on how to build a web widget. Finally here is a discussion on the security of web widgets.

I believe the Like button is using cookies to obtain your FB user information, that with additional attributes are then sent to a service endpoint.

As for security measures, an obvious would be to allow requests only from websites with given access keys.


The answers/resolutions are collected from stackoverflow, are licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0 .
Read More:   Vue.js v-html contenteditable prevent dom refresh to keep cursor / caret from jumping

Similar Posts