如何询问电子邮件id&每次登录facebook时的密码

How to ask email-id & password every time for facebook login?

本文关键字:登录 facebook 密码 电子邮件 何询问 id amp      更新时间:2023-09-26

我已经写了这个firebase登录代码,用于在表单上使用与facebook的连接。我的问题是,当我在同一浏览器上进行另一次连接时,它会自动获得accessToken&上次登录的id。我想让它要求电子邮件id&密码任何时候或有一个确认,这确实是他们的脸书帐户。我该怎么做?

var ref2 = new Firebase("https://<db-name>.firebaseio.com/users/" + $scope.phone);
        //var msg = {};
        var auth = new FirebaseSimpleLogin(ref, function(error, user) {
          if (error) {
            // an error occurred while attempting login
            console.log('an error occurred:');
            console.log(error);
          } else if (user) {
            // user authenticated with Firebase
            console.log('logged in:');
            console.log(user);
            msg = {
              username: $scope.username,
              accessToken: user.accessToken,
              id: user.id
            };
            //$scope.messages.$add(msg);
            ref2.set(msg);
          } else {
            // user is logged out
            console.log('logged out');
          }
        }); // Note: Attach this to a click event to permit the pop-up to be shown
        auth.logout();
        auth.login('facebook');

这是Facebook的一项功能,如果cookie在上次登录时可用,它将在不提示登录的情况下发出oauth令牌。当您注销应用程序时,您需要明确注销Facebook;让您的应用程序始终向您请求用户名密码。

关于此链接的更多讨论,请点击此处:Facebook Oauth注销