Facebook Login Button with show-faces="true" ignores registration-url - facebook

Not sure if this is a bug or if I'm missing something in the docs, but when I set show-faces="true" for the Facebook Login Button plugin on my website, it seems to stop paying attention to the registration-url parameter.
This one works as expected:
<fb:login-button registration-url="http://mysite.com/my_registration/"></fb:login-button>
Result:
if user is not logged in to FB, will display "Login". When clicked,
will prompt user to login. Once user logs in, if they are not registered with my site, will redirect to http://mysite.com/my_registration/. If they have already registered, will just close the auth dialog.
if user is logged in to FB, but not registered with my site, will display "Register". When clicked, will immediately redirect to http://mysite.com/my_registration.
if user is logged in to FB and already registered, will display "Login" but won't do anything when clicked.
All of this is fine and good. But, when I add show-faces="true" like so:
<fb:login-button registration-url="mysite.com/my_registration" show-faces="true"></fb:login-button>
Result:
the faces show up, so that's good. However...
if user is not logged in to FB, will display "Login". When clicked, will prompt user to login. Once user logs in, if they are not yet registered with my site, it will register them, but it will not redirect to the url specified by registration-url.
if user is logged in to FB, but not registered with my site, will display "Login" (instead of "Register" like the example above). When clicked, again, does not redirect to the registraiton-url.
if user is logged in to FB and already registered, it will show the faces, but it will not display the login button.
I haven't been able to find anything to explain the behavior. Anybody got any ideas or links? Thanks in advance.

Related

Linkedin Add to Profile button is not working if not logged in

If user is not loggedin, addtoprofile is directing to a blank page instead of loginpage. Is this the intended behaviour?
[Sample link](https://www.linkedin.com/profile/add?startTask=CERTIFICATION_NAME&name=Test%20Certificate&organizationName=LinkedIn&issueYear
=2018&issueMonth=2&expirationYear=2020&expirationMonth=5&certUrl=https%3A%2F%2Fdocs.
microsoft.com%2Fen-us%2Flearn%2Fcertifications%2Fd365-functional-consultant-sales&certId=1234)
Addtoprofile Documentation

FB Comments - not logged in

I am trying to switch from Disqus to Facebook comments, but I have issues with the comment widget.
Here is the page: http://www.czechgamer.com/hledani.php?tag=z-domova#4
The issue is that even though I am logged in to Facebook, the comment box on the page doesn't show me as logged in. I have "Log In to Post" there button but in fact, can't do anything other than to click on the default avatar picture, which opens new window - a facebook page - where I am logged in. But on my page, whatever I try, I am still not logged in...
What am I doing wrong?
Thank you,
Robert

after login redirect does not work facebook cakephp

I am integrating webtechnick facebook plugin , my cake version is 2.3.1. When I click Facebook login button, the fb window appears, and when I type my fb email and password it disappears, but does not refresh the page, I have specified the redirect page like
public function afterFacebookLogin() {
$this->redirect ( '/posts' );
}
The interesting thing, that when after this, I one time manually refresh the page, it already redirects to /posts page and also I can see that the user is logged in.
THanks

Logging in through Facebook, if not registered, should redirect to registration page

My site has the option of registering with and without facebook. When you register with facebook though, extra information is needed. This is fine, as I use fb:registration and specify extra fields.
However, the problem is, when a user comes to the site and hasn't registered, sees the facebook login button and clicks it, the link brings them to facebook to login and the app is registered and bypasses the registration form I have.
I there a way to redirect a non-registered user that is not logged in with facebook to a registration page instead of adding the app?
You can add the registration-url parameter to the login button as documented in the Login + Registration Flows section.
<fb:login-button
registration-url="yoururl" />
This isn't documented so I don't know if it will continue to work but if your using the HTML5 version of the login button then you can use:
<div class="fb-login-button" data-registration-url="yoururl">Login with Facebook</div>
Not 100% sure i understood you but..
Going on the assumption that you only want users who have an active FB browser session and have authorized the use of your application with their account to see your login button/a particular page you could try this right after your FB.init:
FB.getLoginStatus(function(response) {
if(notLoggedIntoYourSite && response.status != 'connected') {
// Redirect user or hide login button
}
})
Ref: http://developers.facebook.com/docs/reference/javascript/FB.getLoginStatus/

FB.Event.subscribe and login-button

On my page I have the FB login button code. A user is able to join my site by authorizing it with Facebook, by pressing the FB login button. My site lets users log out and many of them like to do that.
After I authorize my FB account for the site, log out of my site, I can't login any more because the session event never fires (unless I de-authorize it). I press the FB Login button a white page opens, then closes right away, and nothing happens. This seems to be because the FB session doesn't change (it already existed) so the event is never fired. So I'm wondering if there's a way around this aside from hiding FB's login button and making my own if their session exists. I tried "auth.login" but that doesn't fire either.
Button:
<fb:login-button perms="email,user_about_me,user_birthday">Login with Facebook</fb:login-button>
Event:
FB.Event.subscribe('auth.sessionChange', function (response) {
document.location.href = "/FacebookLogin.aspx";
});
Steps to reproduce:
Click FB login and authorize app (in this case my site). User is redirected to my FB login page and an account on my site is created. The user is now logged into my site.
Logout of my site using my sites logout button
Click the FB login button to log back into site. This is where the user should be redirected back to that same page from step 1 so they can be logged into the site.
All that happens in step 3 is a white page pops up for a couple seconds and then closes. The site is already authorized and the session event isn't fired.
This also happens if I authorize with one browser and then go back with a different browser. Just get the popup, it closes and nothing happens. I must be missing something important.
I had the same problem but, after a while, i solved it doing this:
function after_login_button(){
FB.getLoginStatus(function(response) {
if (response.status=="connected") {
//User logged in! Do your code here
}
}, true);
}
You also need to call the onlogin event on the login-button:
<fb:login-button onlogin="after_login_button()" perms="email,user_about_me,user_birthday">Login with Facebook</fb:login-button>
This worked for me =).
PS - By the way, I'm using OAuth 2.0 and you should migrate your application to it too because in the developers zone, they say:
"Remember that all apps must migrate to OAuth 2.0 by October 1".
Sorry for eventual english errors =S
Please make sure that you are doing FB.Event.subscribe within
window.fbAsyncInit = function() {
FB.init({
......
)};
FB.Event.subscribe('auth.login', function(response){
.....
)};
};
I had the same problem. After I put it inside the fbAsyncInit, it started accepting the events "auth.login"..
Hope this will work for you.