MrSwitch / hello.js

A Javascript RESTFUL API library for connecting with OAuth2 services, such as Google+ API, Facebook Graph and Windows Live Connect
https://adodson.com/hello.js/
MIT License
4.64k stars 547 forks source link

Force Facebook re-authentication asking for entering email #532

Open hengfengli opened 6 years ago

hengfengli commented 6 years ago

Hi,

Currently, when the user has already logged into Facebook and hello('facebook').login({ force: true }) is called, the login window only asks for re-entering the password (not for email). I am wondering if there is a way to ask users to re-enter both email and password for re-authentication.

I tried to use hello.utils.iframe(''https://www.facebook.com/logout.php'), but it throws

Refused to display 'https://www.facebook.com/home.php' in a frame because it set 'X-Frame-Options' to 'deny'.

It seems that Facebook doesn't allow to use iframe.

Is there any way to ask users for re-entering both emails and passwords? or a way to log out the user from the Facebook's website?

Cheers.

jmgamboa commented 6 years ago

If you have an authenticated session with the service provider, and in this case, Facebook, Oauth will use that user's email of that authenticated session. The user, needs to log out of their current session on facebook. And only then after, can visit your app and manually enter their e-mail and password