Facebook API fb: registration returns "Invalid" client_id "when not connected to Facebook

I am trying to use the Facebook registration tool for my site. I would like Facebook users to be able to easily connect to my website, as well as non-Facebook users, to create an account through this unified interface.

I use a tag <fb:registration>for this purpose. If I already connected to Facebook when I came to the page, everything works as expected (the form is filled with information from my Facebook account). But if I'm not connected to Facebook, the following error: Invalid 'client_id'..

What am I doing wrong?

Many thanks for your help.

Below you will find the HTML code displayed from the server:

<!doctype html>
<html xmlns:fb='http://www.facebook.com/2008/fbml'>
<head id='head'>
<title>MyWebSite - Signup</title>
<link rel='stylesheet' type='text/css' href='/client/Core.css'/>
<script language='JavaScript' type='text/javascript' src='/client/jQuery.js'></script>
<script type='text/javascript'>
function initialize() {
 $.getScript('client/Core.js');
 $.getScript(document.location.protocol + '//connect.facebook.net/en_US/all.js');
}

window.fbAsyncInit = function() {
 FB.init({
  appId   : 123456789, // replaced here by my App ID
  session : {},
  status  : true,
  cookie  : true,
  xfbml   : true
 });
 FB.Event.subscribe('auth.login', function() {
  window.location.href = 'DoLogin';
 });
};
</script>
</head>
<body onload='initialize();'>
<span id='fb-root'></span>
<fb:registration 
    fields='[{"name":"name"},{"name":"first_name"},{"name":"last_name"},{"name":"email"},{"name":"location"},{"name":"gender"},{"name":"password","view":"not_prefilled"},{"name":"captcha"}]' 
    redirect-uri='http://172.16.100.31/DoSignup'
    width='600'
    fb_only='false'
    allowTransparency='true'>
</fb:registration>
</body>
</html>
+5
6

, , , , . , , .

+12

, , . script

<script src="http://connect.facebook.net/en_US/all.js#appId={YOUR_APP_ID}&xfbml=1"></script>

<fb:registration 
  fields="name,birthday,gender,location,email" 
  redirect-uri="https://developers.facebook.com/tools/echo/"
  width="530">
</fb:registration>

, JavaScript SDK

<script src="http://connect.facebook.net/en_US/all.js"></script>
<script>
  FB.init({
    appId  : 'YOUR APP ID',
    status : true, // check login status
    cookie : true, // enable cookies to allow the server to access the session
    xfbml  : true  // parse XFBML
  });
</script>

#appId={YOUR_APP_ID}&xfbml=1 script .

+2

Facebook, , "123456789" AppID .

0

- , :

Facebook XFBML http://developers.facebook.com/docs/plugins/registration/ {YOUR_APP_ID} {1234123434534} ( - ), , . ( , JSON , ).

, , , , .

0

For testing, set YOUR_APP_IDto113869198637480

0
source

In my case, I showed the fb registration link without first logging into the user account. After scratching my head for a long time, I asked the user to log into facebook before submitting the registration form. The error came to my pleasure.

0
source

All Articles