Menu

Switch to the dark mode that's kinder on your eyes at night time.

Switch to the light mode that's kinder on your eyes at day time.

Switch to the dark mode that's kinder on your eyes at night time.

Switch to the light mode that's kinder on your eyes at day time.

in ,

If you care about user privacy, do NOT use Facebook JS SDK, Hacker News

If you care about user privacy, do NOT use Facebook JS SDK, Hacker News


                          

            Originally posted on                             dev.to                     

        

Social Login buttons like the ubiquitousLogin with Facebook / Google / Twitter /…button is convenient for users as they don’t have to go through a lengthy registration process and create yet another username / password. And without a proper password manager (which probably 99% users don’t use), they tend to reuse the same password which is bad in terms of security!

However behind the scene, some SDKs (I’m looking at you Facebook!) Inject an iframe in your website to display theContinue as {MyName}orLogin with Facebookbutton. Loading this iframe allows Facebook to know that this specific user is currently on your website. Facebook therefore knows about user browsing behavior without user’s explicit consent. If more and more websites adopt Facebook SDK then Facebook would potentially have user’sfull browsing history! And as with “With great power comes great responsibility”, it’s part of our job as developers to protect users privacy even when they don’t ask for.

Loading this iframe allows Facebook to know that this specific user is currently on your website

The iframe is actually injected in a second script loaded by thehttps://connect.facebook.net/en_US/sdk.js:

So what should we do to provide thisLogin with Facebookbutton to our users? The good news is this is actually easy as Facebook implements OAuth2 / OpenID standard so you can use any OAuth2 / OpenID library to add the Facebook login button. You can also add other login providers like Google, Github, Apple… at the same time as those are also OAuth2 / OpenID compliant.

Here are some ressources to implement OAuth2 / OpenID in your app for different languages ​​/ frameworks:

If you happen to use Flask (Python), I have written an article on dev.to on how to implement OAuth2 / OpenID into a Flask application:https://dev.to/simplelogin/create-a-flask-application-with-sso-login-f9m

If you really need Facebook SDK, please ask user consent before loading Facebook SDK or only load the SDK when user clicks on theLogin with Facebookbutton.

        

            Written by                             Son Nguyen Kim                     

    

Brave Browser
Read More
Payeer

What do you think?

Leave a Reply

Your email address will not be published. Required fields are marked *

GIPHY App Key not set. Please check settings

Jofra Archer: England bowler subjected to 'racial insults' during New Zealand defeat – BBC News, BBC News

Jofra Archer: England bowler subjected to 'racial insults' during New Zealand defeat – BBC News, BBC News

The AMD Ryzen Threadripper 3960X and 3970X Review: 24 and 32 Cores on 7nm, Hacker News

The AMD Ryzen Threadripper 3960X and 3970X Review: 24 and 32 Cores on 7nm, Hacker News

Back to Top
close

Log In

Forgot password?

Forgot password?

Enter your account data and we will send you a link to reset your password.

Your password reset link appears to be invalid or expired.

Log in

Privacy Policy

To use social login you have to agree with the storage and handling of your data by this website. %privacy_policy%

Add to Collection

No Collections

Here you'll find all collections you've created before.