Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
228 views
in Technique[技术] by (71.8m points)

fbml - Facebook API's fb:registration returning "Invalid 'client_id'" when not connected to Facebook

I'm trying to use Facebook's registration tool for my website. I would like to allow Facebook users to login seamlessly to my website, but also non-Facebook users to create an account through that unified UI.

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

What am I doing wrong?

Thanks very much for your help.

You'll find below the HTML code rendered 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>
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

You might have to configure your application to let users other than the developers to access the app. I had a hard time finding it, but if I remember well, it was a matter of sandboxing the app or not.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...