Facebook Connect Plugin for aMember now available

Discussion in '3rd Party Service Providers' started by robw, Jun 10, 2010.

  1. AdamCapriola

    AdamCapriola New Member

    Joined:
    Jul 10, 2010
    Messages:
    27
    Would this integrate with Disqus too?

    I use Disqus for commenting on my blog and it would be cool if they were logged into that too when they register an account w/ amember.

    That's the only thing standing between my site and total integration w/ Amember right now... it doesn't look like there is any disqus integration (I don't even know if it's possible).
  2. robw

    robw CGI-Central Partner

    Joined:
    Dec 18, 2007
    Messages:
    287
    Hi Adam,

    You would need a separate plugin to integrate disqus to aMember.

    The Facebook plugin uses standard aMember hooks to automatically log you in to aMember if you are already logged in to Facebook. So if you had a disqus plugin for aMember, then yes, it would integrate.

    Cheers
    Rob
  3. glrfcentral

    glrfcentral New Member

    Joined:
    Mar 19, 2007
    Messages:
    27
    website field login code w/ fcb connect

    Hi Rob,

    I have read your posts here and reviewed the web page blurb about the plugin.

    I understand we can place facebook connect button on the default website login page but can you help us with the code Alex provides to login directly from our website pages?

    I would like to feature the facebook connect button there as well.

    I will pm you our website so you can see what I mean but I wanted to make a post on here so your reply would be helpful to everyone.

    Thanks,

    Brian
  4. robw

    robw CGI-Central Partner

    Joined:
    Dec 18, 2007
    Messages:
    287
    Hi Brian,

    Adding a Facebook login Button to your non-aMember pages ...

    Yes, it is possible - here are some instructions to get you started, but please note that I can't support this 'addition' as it is integration outside the core plugin. This is just for your guidance on how you could do it.

    NB: Make a backup of any file you edit ;)

    1) Edit your page (or wordpress header template) and add the following just after the <body> tag, changing the bits in red as appropriate:

    Code:
    <div id="fb-root"></div>
    <script type="text/javascript">
    	
    	window.fbAsyncInit = function() {
    	FB.init({appId: '[COLOR="red"]YOURFBAPPID[/COLOR]', status: true, cookie: true,
    			 xfbml: true});
    	
    	FB.Event.subscribe('auth.sessionChange', function(response) {
    		if (response.session) {
    		  // A user has logged in, and a new cookie has been saved
    		  document.location.href = "http://[COLOR="red"]YOURDOMAIN[/COLOR]/[COLOR="red"]amember[/COLOR]/login.php?amember_redirect_url="+document.location.pathname;
    		} else {
    		  // The user has logged out, and the cookie has been cleared
    		  document.location.href = "http://[COLOR="red"]YOURDOMAIN[/COLOR]/[COLOR="red"]amember[/COLOR]/logout.php";
    		}
    	});
    	};
      (function() {
    	var e = document.createElement('script');
    	e.type = 'text/javascript';
    	e.src = document.location.protocol +
    	  '//connect.facebook.net/en_GB/all.js';
    	e.async = true;
    	document.getElementById('fb-root').appendChild(e);
      }());
    
    </script>
    2) Edit the <html> tag on your page (or your page header template if wordpress) to include the FB namespace (the bit in blue) so it looks something like this:

    Code:
    <html xmlns="http://www.w3.org/1999/xhtml" [COLOR="blue"]xmlns:fb="http://www.facebook.com/2008/fbml"[/COLOR]>
    3) Stick this login button wherever you want it to appear on your page/sidebar:

    Code:
    <fb:login-button size="small" autologoutlink="true"></fb:login-button>
    Using it with the code Alex supplies, would look like this:

    Code:
    <?php
    session_start();
    if ($au=$_SESSION['_amember_user']){ // user is logged-in
    print "<font color=#ffffff>Hello $au[login] !</font><br>";
    print "<a href='/amember/logout.php'><font color=#ffff99>Logout</a>";
    } else { // user is not logged-in
    print "<form method=post action='/amember/login.php'>
    <font color=#ffffff>Username: </font><input type=text name=amember_login size=9><br>
    <font color=#ffffff>Password: </font><input type=password name=amember_pass size=9><br>
    <input type=submit value='Login'>
    </form>[COLOR="red"]<br/><fb:login-button size=\"small\" autologoutlink=\"true\"></fb:login-button>[/COLOR]";
    print "<a href='/amember/signup.php'><font color=#ffffff>Register</font></a><br/><a href='/amember/member.php'><font color=#ffffff>Forgot password?</font></a>
    ";
    }
    ?>
    NB: When inserting this code into a php print or echo statement (as in the Alex login example above), you need to backslash (ie: \ ) all the double quotes (ie: " ) in the code (ie: \" ) otherwise php will throw you a parse error - this is because the double quote is being used by php to mark the start and end of the text to print.

    Cheers
    Rob

    Ps - You can also "pimp" your facebook button by setting the size (small, medium, large), button text, and make the button an auto account creation one (set your own domain and path)

    For example:

    Code:
    <fb:login-button [COLOR="brown"]size="medium"[/COLOR] [COLOR="blue"]perms="email,publish_stream" onlogin='document.location.href="http://[COLOR="red"]YOURDOMAIN[/COLOR]/[COLOR="red"]amember[/COLOR]/plugins/protect/fb_connect/signup.php";'[/COLOR]>[COLOR="green"] Order via Facebook[/COLOR] </fb:login-button>
    Pps - If you decide to pimp button with the auto-create option, make sure the auto create option is active in the plugin config too ;-)

    Ppps - Remember, when inserting this fb tag into a php print or echo statement, you need to backslash (ie: \ ) all the double quotes (ie: " ) in the code (ie: \" ).
  5. glrfcentral

    glrfcentral New Member

    Joined:
    Mar 19, 2007
    Messages:
    27
    Some questions about the facebook and openid login

    Hi Rob,

    Your sales page hints at this but I need you to connect the dots slowly and painfully, I'm afraid.

    For our existing members, how do they enable Facebook connect? What happens to members who may be logged in to Facebook already? We have all sorts of members, some of whom are smart internet folk and some of whom, for wont of a better word, are distracted.

    Scenario 1: User A happens to be logged in to Facebook already. The user, by various means, either clicking on a link we posted on our Facebook page, or by opening a new browser tab, goes to our site. They log in. Are they now connected? Or do they need to click on the icon that says "Connect with Facebook?"

    Scenario 2: User B gets to the login page on our site, clicks on the icon that says "Connect with Facebook." What happens then? Is he/she taken to the Facebook page where it shows the example you have on your sales page that says "Rob Woodgate, you have successfully logged in to Facebook ...?" If so, then is the text that follows, which is displayed in red and says "now please log on to your account on our site ..." an active link to our website login page? Does it open a new tab window? What I want to avoid is any confusion by our existing members that they need to create a new account on our website. Or will they need to open a new browser tab and enter the website address in the url? With some of the distracted folk, they may inadvertently click on a bookmark or use the existing browser window to visit our website page and that may close the Facebook application thereby severing the linking of the accounts.

    One further question with Scenario 2: can we amend the text that shows up in the Facebook entry described above so we can change the language from 'our site' to our organization name? Also, does this entry appear in someone's wall, for their entire friends to see? If so, that would violate our privacy goals for our members.

    Scenario 3: A Facebook user forgets their password or changes it. Do they need to go through another connect procedure?

    Scenario 4: Some of our users visit our website at internet cafes provided for the athletes at the competitions. We have found that members who logged in to aMember and then closed their browser but did not log out would be still be logged in if the browser was relaunched. Taking this idea a bit further, if a users logs in to facebook and then jumps over to our website by opening another browser tab, and then closes the browser tab for our website but then logs out of their Facebook account, are they now logged out of aMember? And taking that bit of logic further still, if the user logs out of their Facebook while the user maintains the tab to our website, are they suddenly logged out of aMember?

    Scenario 5: A connected user logs into Facebook, then heads over to our website, and finds they are logged in. Great. Now, they click on the tab we feature at the top of our website page that says logout. If we have not enabled the logout out of Facebook simultaneous feature, can the user jump over to our website again, and find the autologin feature still works?

    Scenario 6: What do you mean by "Options to force the member to accept the 'enhanced' email and publish story permissions as part of connecting or to offer them at first connect?" What is enhanced? What are publish story permissions?

    Scenario 7: For our expired subscription members, what happens when they log in to Facebook and then jump to our website? Are they instantly taken to the main xxx.com/amember/member.php page, where they can add a new product subscription? Or is the Facebook connect severed until they manually log in to our website and renew one of the product subscriptions?

    Thanks so much for your patient review of these questions.

    Cheers,

    Brian
  6. robw

    robw CGI-Central Partner

    Joined:
    Dec 18, 2007
    Messages:
    287
    No problem...

    When an existing member visits your login page they can enable facebook connect by simply clicking on the Facebook login button. Here's how the process works:

    1. They click the Facebook button
    2. Facebook asks them to login (if not already) and then asks them to grant permission to connect to your site.
    3. Assuming they do, they get automatically taken back to your aMember login page, and the connect button is replaced with the "Joe Bloggs, you have successfully logged in to Facebook ...?" type message which informs them that they've successfully authorised the connection at Facebook, and that they now need to login to their account on your site to complete the connection (and this is a one time thing).
    4. They login to your site, and the connection is complete.

    They would need to click the 'Connect with Facebook' button - this is because Facebook require explicit permission (step 2 above) before sharing the login status with a third party website.

    The person is automatically returned to your aMember login page (step 3 above) and given the "now please login" message there as part of the process.

    In the current version you can edit the text in the login.fb_connect.inc.html file of the plugin.

    No. Once connected, Facebook only shares the login status (logged in/not logged in) with aMember, and aMember lets the person in based on this information. aMember doesn't get the Facebook username/password, so there's nothing for it to update.

    The answer is 'possibly' or 'no difference' to what already happens. If they logout of Facebook then the plugin won't log them back in if they revisit your site. But if they are already logged in to aMember, then they will still get access until the aMember session expires or the browser is fully closed down.

    Yes. If your feature tab uses the aMember logout function (/amember/logout/php) then clicking this will log the member our of aMember, but NOT Facebook (unless you set the option to force Facebook logout). So if they then go back to your membership area, they'll be automatically logged back in if they are still logged in to Facebook.

    Like any Facebook application, when a person connects via Facebook, they are told the permissions they will need to give in order to connect. By default, the permission to access their email address and to publish stories to their wall are not mandatory - this option forces the user to grant these permissions as a condition of connecting.

    Facebook calls these 'enhanced' permissions, because they are over and above the 'basic' information which all apps need (name, picture, friends etc).

    The connection persists, so they will be automatically logged in to their account, and taken to whatever page any other expired member would get.

    For example, if they tried to login to a protected page, they might get the "access to this area is not allowed, please visit the member account page to add/renew subscription" message, or they may be taken straight to the /amember/member.php page if they went straight to the login page and not via a protected page.
  7. glrfcentral

    glrfcentral New Member

    Joined:
    Mar 19, 2007
    Messages:
    27
    Rob -

    Thanks for the patient reply. I feel confident that our users' privacy will be safeguarded and the functionality is intuitive enough that our members won't go on a spree of reregistrations.

    I just purchased the 'Super Size' bundle ... and printed the receipt. Now 10 minutes later still no email with details of how to download the plugin. How long, in your experience, does the system back end take, to send it out?

    Cheers,

    Brian
  8. robw

    robw CGI-Central Partner

    Joined:
    Dec 18, 2007
    Messages:
    287
    Hi Brian - have PM'd you - hopefully you've got the info ok now.
  9. glrfcentral

    glrfcentral New Member

    Joined:
    Mar 19, 2007
    Messages:
    27
    Installation brickwall

    We already have a facebook account.

    Per Facebook Connect Notes v1.3,

    Step 3 - entered url for facebook application. logged in; presented with three windows:

    type in Site name - did it; used a name that made sense for us
    type in Site URL - per your notes, entered {$config.root_url}
    locale drop down menu - selected default display
    clicked Create application button

    error message returned: "URL must point to a directory (i.e., end with a '/') or a dynamic page (i.e., have a '?')." Sure I could try our own url but I don't want to create an application with Facebook since in my experience trying to undo stuff with Facebook is next to impossible.

    Now I am dead in the water until you're back online.

    [Edit]

    To use my time efficiently, I installed the the OpenID plugin. More issues, alas.

    Super urgent - the OpenID login features for the login.html page are showing the text and the boxes but no images. Change file permissions? How can that be when the images did appear on the signup page after I added the code but then decided to delete the code on the signup page.

    Other notes: your readme.txt file that comes with both the facebook connect and the open id plugin, when opened in Notepad, becomes a huge long 3 line string that is unmanageable to read. So I copied and pasted the text into MS Word. Quel disastre for the coding. Had to rely on the instructions in the acp plugin notes. Even so, you have a typo THERE as well as in the read me txt for the OpenID plugin: See Step 8:a->b->c refers to uploading the login.html page instead of what I think you meant, the signup.html page.

    Other feedback: I decided to forego adding the OpenID code to the signup page because it is always present, right? So a new user, who is 'distracted' will click on the images (which appear just fine, btw, on the signup page when I first added the code, and be taken to one of the openid properties, login, and then I assume, be brought back but without an explanation, they will think this is a viscious circle, right? Or this there language that appears on their return trip that tells them specifically to create the aMember account? Bottom line: will the OpenID signup.html message with all the images, appear on their second return registration?

    If so, I am fearful that those 'utterly distracted' internet users will be thoroughly confused and give up.

    Brian
  10. glrfcentral

    glrfcentral New Member

    Joined:
    Mar 19, 2007
    Messages:
    27
    and even more problems with OpenID

    More issues: I have two ids: an admin with our amember site and then a personal one. I installed the OpenID plugin, went to our website, clicked on a protected page, moused over the blank box on the login page, and read the code at the base of the screen until it said Yahoo and clicked on it.

    The page took me to Yahoo and asked if I wanted to use the single connect. I clicked agree and was taken back to the login page for our website where it asked me to login.

    Next, I was taken to our default landing page inside our protected folders. I nav'd around to see that all our plugins were working properly, which they were, and then I clicked the logout link at the top of our page.

    Using the bookmark buttons on my browser, I clicked on our website and was taken to our logged out default landing page and I was asked to login normally without the help of OpenID seamless login. Meanwhile I am still logged in to yahoo.

    Is this a safety measure, a cache problem, a cookie problem, ?

    As you are getting the gist, I am advocating for our members ... selfishly because I don't want them emailing me complaining that this doesn't work or that doesn't work ...

    Thanks,
  11. glrfcentral

    glrfcentral New Member

    Joined:
    Mar 19, 2007
    Messages:
    27
    both plugins now disabled.

    header.html for openid code removed

    login.html for openid code removed.

    sorry Rob, but I can't leave this broken functionality open while our members are logging in and using the site.

    will wait to hear from you. sorry for the headache you will undoubtedly feel as you sip your morning cuppa.

    Brian
  12. glrfcentral

    glrfcentral New Member

    Joined:
    Mar 19, 2007
    Messages:
    27
    working through the Facebook Connect instructions

    For those of you who are accustomed to reading the readme.txt files that come along with a software program, script, or plugin, you should read this post.

    The brickwall that I first encountered in trying to install Facebook Connect was that after I downloaded and unzipped the plugin, I opened the readme.txt file with notepad and found it to be a huge long string of text lines. So I copied and pasted the text into an MS Word document and that's where the problem began. All the html coding was jumbled.

    So I urge you to forego the readme.txt file as a direct reference and instead log in to your aMember admin panel, click on Setup/Configuration and after enabling your fb_connect plugin, click on it at the top of the panel.

    It should then say:
    "aMember Pro Configuration : fb_connect
    Facebook Connect"

    Without doing anything, scroll down and read the installation instructions posted. That's where I found the problem I encountered in trying to create a Facebook application. After I had printed the 5-page word document, it told me to create a facebook application and the instructions said:
    "NB: Site URL is {$config.root_url}
    When I tried to enter that in the Facebook application page, I got an error. But in the aMember admin panel installation instructions, it shows the correct Site URL you are supposed to use. HUGE Difference!

    Other notes for installers who have never encountered a Facebook Application page:

    First: The installation instructions, step 4.b says to "Click the 'Connect' Tab" ... there is no connect tab to be found anywhere. Instead, click on the 'Web Site' tab and go from there.

    Second: In the Advanced Notes/Troubleshooting section of the installation instructions, section 3.c and 3.d, I could find no evidence of a 'Connect URL' so what I did was to just double check the 'Web Site' tab and the 'Site URL' setting to ensure it matched what was shown in the installation instruction.

    Third: In the installation instructions, section 8.d, there is a typo. Instead of reading:
    "Upload /amember/templates/login.html to your server."

    I believe it should read:
    "Upload /amember/templates/signup.html to your server."

    Hope this is use to others.

    Brian
  13. robw

    robw CGI-Central Partner

    Joined:
    Dec 18, 2007
    Messages:
    287
    Hi Brian (and other customers) - if you need support for the plugin please email me directly via the plugin website as I don't check this forum every day and don't get email notifications for some reason. Feedback and general questions that don't need immediate answer - no problem here.


    Brian - you beat me too it - your woes were caused by reading the readme from outside aMember. As you realised, the readme file tells you to read step 3 onwards from within the setup screen of aMember. If you do this, the readme will show you the correct URL to use in your facebook application.

    The OpenId plugin works slightly differently to the facebook one in that they don't get auto logged in as soon as they hit the login page - they have to click the relevant icon (eg yahoo). This is just part of openid.

    Finally, thanks for the heads up that Facebook had changed the names of some of the settings (grrr) and the other typos in the readme. Will update.

    Cheers
    Rob
  14. glrfcentral

    glrfcentral New Member

    Joined:
    Mar 19, 2007
    Messages:
    27
    understanding the openid functionality

    Hi Rob,

    I'm posting this on the forum so that everyone has the benefit of understanding the slightly different functionality of OpenID.

    If I understand this correctly, the OpenID connection, to work each and every time, means the user has to click the displayed button, and then they are sent to say the yahoo page where they must click 'agree' and then they will go to default landing page in our website? Is that right?

    So it is always a two-step process, whereas facebook is just do it once and forget about it?

    Thanks,

    Brian
  15. robw

    robw CGI-Central Partner

    Joined:
    Dec 18, 2007
    Messages:
    287
    Hi Brian,

    Yes, because of the way that OpenID works, it is not possible to automatically log the member in as soon as they land on your login page, as we can for Facebook. Instead, they must click the button for their chosen OpenID provider to start the process.

    For most OpenID providers, the first time they use an OpenID provider, they are asked to authenticate and state whether the connection is a 'one time' or 'remembered' one. If they choose the 'remember' option, then subsequent times they click the button, they will be automatically logged in to your site.

    So, the very first time they use the OpenID option, it is the two step process, like the Facebook plugin. After that, it is a simple one click on the button (vs Facebook 'no click' login).

    The key benefit to OpenID is that a person only needs to know their OpenID login - and that will get them into all the OpenID enabled sites they use (including your aMember site) without needing to remember a dozen different login details.

    Most people only have a handful of passwords they reuse over and over, so OpenID also provides customer reassurance that they are not giving out one of their passwords to a site they may not be familiar with and that they won't have the hassle of changing passwords on many sites.

    Cheers
    Rob

    Ps - I think maybe I'll make some screencast videos at some point to illustrate the login flows - this might help people see what happens before they buy. Alternatively, feel free to create an account on this site and see for yourself (it's one of our live sites, but you can create an account for free and get access to some golf videos).

  16. dennisjade

    dennisjade New Member

    Joined:
    Sep 29, 2010
    Messages:
    1
    I try the FB plugin but it doesn't post to wall when a FREE subscription is choosen. It works fine after a successfull paypal payment or CC payment is made. But doesn't works with FREE suscription where no payment is needed.

    Any clue on this?
  17. CrackBaby

    CrackBaby Member

    Joined:
    Aug 22, 2006
    Messages:
    154
    I would like to talk to anyone that is a customer and has this plugin installed on their website. Please send me a PM

    Thanks
  18. CrackBaby

    CrackBaby Member

    Joined:
    Aug 22, 2006
    Messages:
    154
    After talking to a few customers of this plugin, I feel it is a great idea but over priced since it does not always work and you cannot customize some of the postings.

    For my line of business I would love to show someone signed up however I would not want to show every purchase or better yet what they purchased.

    Will to explore it more if the price dropped or they had a way to set up a test plugin.
  19. robw

    robw CGI-Central Partner

    Joined:
    Dec 18, 2007
    Messages:
    287
    @dennisjade - By 'Free Subscription', do you mean the product given by the 'Facebook Product Subscription' option as part of the auto-account creation?

    @crackbaby - when you say, 'it does not always work', what do you mean specifically?

    Messages are not customisable because Facebook have a pretty strict policy on what and when you can post to people's walls... if it were customisable and you got your website locked out because you put something that Facebook didn't like, the plugin would be useless to you...

    Thanks for the 'choose which ppurchases cause message' idea - will look to add this to a future release.

    Cheers
    Rob

    Ps - Value is a very funny thing - this plugin is priced around the same as many others, and for the ROI it can generate is actually very cheap. Especially if you factor the cost to get a developer to write it for you and provide free updates ;-)
  20. CrackBaby

    CrackBaby Member

    Joined:
    Aug 22, 2006
    Messages:
    154
    robw,

    They did not go into detail on what did not work all the time. I talked to two people that just completely removed it because "it did not work correctly or as they thought"

    I am sure for people just wanting to advertise someone signed up or made a purchase at a subscription website the value is great the ROI (Return on Investment) is like you said it is. However for some of the products I sell I cannot justify the cost as I don't know how well it will be liked or used by my members, future members.

    For me it is more about a want than a need. Yes it is cool and it shows you are staying with the times, but if it does not get used to pay for itself. Like I said before I would want to choose which products are displayed on facebook. I would want to say "jonnhy b just signed up at domain.com for free" but I would not want to show every purchase.

    Again like I said it is more of a want over a need. I want to test it out and maybe have it on my site but I do not need it. I will not go into your pricing, I just wish amember sold it so I can have a lifetime subscription of $30 to $40 for this type of plugin, after all in today's economy well you get the point.

Share This Page