Sign in with facebook (OAuth): how to and threats
Many websites provide possibility to authorize with OAuth protocol (e.g. using facebook account).
How to
In ASP.NET application it is very easy to implement. Check this 3 minutes long screencast by Scott Hanselman.
In Rails it is a little bit more complex, but also not big deal. There is nice Rails cast #360 about it (12 minutes).
Threats
However it is good to know what data we are providing when we click 'Login with facebook'. I implemented facebook auth with omniauth-facebook library (according to above rails cast). I was surprised when I look at the source code.
This is auth data available for developer, when we sign in with facebook:
We provide our email(!), timezone and even location! Actually I was not aware of that. I thought facebook provides just basic info like name and photo.
We should think twice before we sign in to some website with OAuth. Especially due to providing our email address. Malicious websites can use it for sending spam.