Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

[SOLVED] Facebook login - ValidateRequired

edited February 2011 in Vanilla 2.0 - 2.8
Hi everyone,

When I try to login to forum using facebook, I get this error:


It is not a bonk error, so I really don't know what to do.
Below are my API details:


Thank you very much if you can help, as I am really desperate....


  • Options
    Nobody ?
  • Options
    Anybody ? :(
  • Options

  • Options
    I have de same problem
  • Options
    Hello, dear friends. I had the same problem and found that bug is hidden here in the file class.facebook.plugin.php inside of GetProfile function at this line:

    $Contents = file_get_contents($Url);
    The problem mostly is not in vanilla forum, but in PHP configuration. It should be built with OpenSSL support to transfer data via https protocol ($Url in this case points to https facebook site). But this function is deprecated and it's bit strange why developers use it instead of curl functions. Moreover there are a lot of curl calls in this file. Because of that on some configurations this bug exists, on others don't.

    To make it work correctly, try to change this line to:

    $Contents = $this->file_get_contents_curl($Url);
    Of course, my dear friends, you have to add the function file_get_contents_curl inside of the file. Put the following code after the GetProfile function:

    function file_get_contents_curl($url) { $ch = curl_init($url); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); //Set curl to return the data instead of printing it to the browser. curl_setopt($ch, CURLOPT_URL, $url); $data = curl_exec($ch); curl_close($ch); return $data; }
    It should work now! I hope you'll enjoy vanilla forums.

    If it doesn't work, please ensure that OpenSSL feature is enabled for cURL.
  • Options
  • Options
    Hi Alibaba31337,

    I am trying your solution.

    Where exactly did you place the second part of the code ?

    Is it under: "$Contents = $this->file_get_contents_curl($Url);" ?

    As you can see I am not a developer :)

  • Options
    edited February 2011
    second part of the code you just can place after GetProfile function, after the closing curly bracket ("}"). Something like:
    function GetProfile { // some code goes here, where you have to change the line } // <-- closing curly bracket of GetProfile function // second part of the code function file_get_contents_curl($url) { // bla-bla }
  • Options
    Alibaba31337 !

    YOU ARE A LEGEND !!!!!!!! YOU ARE MY HERO !!!!!

    I have been waiting for this solution for a while, Thank you so much !

    P.S.: It will be great if in the next Update of Vanilla forum will include Alibaba's Code !
  • Options
    I'll mark your P.S. as a suggestion for next release, might be a bugfix by then, but we'll see. I'll close this thread now :-)

    There was an error rendering this rich post.

This discussion has been closed.