开发者

Invalid 'client_id' when using fb:registration XFBML tag (FB.getSession incompatible with OAuth2)

I am trying to use the fb:registration XFBML tag. For the most part it seems to work; however, when I click the 'X' in the name field and then click 'Log Out' I get the error message

Invalid 'client_id'.

Although this error occurs, it seems the actual log-out process was successful; if I manually refresh the page I get the form in its logged-out state. I tried getting around this issue by subscribing to auth.logout events and reloading the page, but the error prevents the events from being triggered until after a page reload.

Using firebug, I have found that the actual javascript error is FB.getSession incompatible with OAuth2 and it is called on line 9 of connect.facebook.net/en_US/all.js. I am not calling anything involving sessions, so I am not really sure why this is happening.

I have tried using firefox, chrome, and safari, and all three experience the problem. Additionally, on safari and chrome I also get the same error when I try to login with the registration plugin. If I manual开发者_StackOverflow中文版ly refresh the error goes away and the login process is successful, just like with logout.

I am running this locally while in development, and so I made a facebook app just for testing with the site URL and domain referencing localhost. I am not in sandbox mode, and I am loading the js sdk like this:

<div id="fb-root"></div>
<script src="{$pageProtocol}connect.facebook.net/en_US/all.js"></script>
<script>
    FB.init({
    appId: {$facebookAppId},
    cookie: true,
    xfbml: true,
    status: true,
    channelUrl: '{$pageProtocol}{$webhost}/{$channel}',
    oauth: true
});

(This is called from a smarty template; I have looked at the generated source and all of the {$var} bits get replaced correctly.)

Here is my xfbml tag:

<fb:registration
redirect-uri="http://localhost:8888/join?with=facebook&done=true" 
fields='[{"name":"name"},
     {"name":"email"},
     {"name":"city", "description":"City", "type":"select", "options":{
        "_98":"Albany / Capital Region",
        "_3":"Albuquerque",
        "_99":"Allentown / Reading"
            }
     }
fb_only = true
>
</fb:registration>

(I shortened the list of cities above.)

So if anyone can figure out what I am doing wrong please let me know.

Pictures:

from this modal: http://i.stack.imgur.com/sVN1E.png

click Log Out and you get: http://i.stack.imgur.com/eiLwY.png

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜