Forums

#1 2009-11-03 05:06:51

daniel lam
Member
Registered: 2009-11-03
Posts: 19

Cannot get sample authentication to work PLEASE HELP

Hi All,

Sorry in advance for having silly mistakes in my codes.. I just couldn't get a simple authentication to work.

I followed and referenced on examples in wikis, trying to let people login to my website with their facebook accounts.



In the following Scenario 1, result is as expected.
                     -----------------
Pre-conditions:
- All cookies have been cleared
- User not logged in to my webiste
- User not logged in to facebook

Action:
- User clicks on facebook login button (fb:login-button),

Result:
- facebook pop-up appears and asks user to login with facebook account. Great.


In the following Scenario 2, result is no good, PLEASE HELP!!
                     -----------------

Pre-conditions:
- All cookies have been cleared
- User not logged in to my webiste
- User HAS LOGGED IN TO FACEBOOK

Action:
- User clicks on facebook login button (fb:login-button),

Result:
- there is no pop-up. No error messages. Nothing. HEEEEELPPPP!!!

- Firebug shows the following messages in console

    reference to undefined property this._handlers[_L0]
    FB.subclass('FB.XdComm.Server','FB.Class...(_L0,function(_L2,_L3){_L1(_L2);});}});\n

    reference to undefined property window.event
    FB.subclass('FBIntern.Utility','FB.Class...te('src',_L4);_L5.appendChild(img);}});\n

    deprecated arguments usage
    FB.subclass('FBIntern.Utility','FB.Class...te('src',_L4);_L5.appendChild(img);}});\n


Here is my test.php

Code:

<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml">
<head>
</head>

<body>
        <script src="http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php" type="text/javascript"></script>
        <fb:login-button></fb:login-button>
        <script type="text/javascript">
                FB.init("MY API", "xd_receiver.htm");
        </script>
</body>
</html>

Here is my xd_receiver.htm

Code:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
        <head><title>xd</title></head>
        <body><script src="http://static.ak.facebook.com/js/api_lib/v0.4/XdCommReceiver.js" type="text/javascript"></script></body>
</html>

Last edited by daniel lam (2009-11-03 14:30:29)

Offline

 

#2 2009-11-09 07:23:16

daniel lam
Member
Registered: 2009-11-03
Posts: 19

Re: Cannot get sample authentication to work PLEASE HELP

Ok, I have figured it out, looks like I should have been thrown all the docs. I had the issue above because I was expecting test.html from one of the wiki page to always show "authorize?" pop-up if user is logged-in to Facebook. I was wrong.

I have documented more details in here for those who are as confused as I was...
http://allaboutlamp.com/2009/11/why-doe … -not-work/

After reading so much updated and outdated, well-written and badly-written docs on the web, I couldn't help writing a beginner's guide to authentication myself, hope it will help some new comers..
http://allaboutlamp.com/2009/11/how-doe … tion-work/

Last edited by daniel lam (2009-11-09 07:24:11)

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2005 Rickard Andersson