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.

Facebook login 2015 version of Facebook Developer

I know the "Invalid redirect_uri" error has been asked and answered, but it seems Facebook Developer's
app pages have changed considerably from the responses not matching what is on the pages now.

I have tried the suggestions, using the same base url http:://www.ocala-living.com for
the website field and tried the uri redirected field and the app domain field.

And it is still not working for me.
I installed the vanilla forum in the directory http://www.ocala-living.com/forum and trying that url
hasn't helped any either.

Could someone upload what the current pages for Facebook Developer should look like for this to work?

Comments

  • rasteronrasteron forum.rastercode.com ✭✭
    edited March 2015

    have you tried adding a forward slash in your site url field? try both..

    http://www.ocala-living.com/
    http://www.ocala-living.com/forum/

  • Yes, but still getting the same response.

  • I changed Site Url to http://ocala-living.com/ and now get this error

    With http://www.ocala-living.com/ I was getting this error

    I really liked this forum platform, but I just can't seem to make this work.

  • vrijvlindervrijvlinder Papillon-Sauvage MVP

    You need to fix your pretty urls.

    Post the content of your htaccess file or make sure it is correct.

    Make sure you have the $Configuration for ReWriteUrl is TRUE in the config.php

  • edited March 2015
    # Original
    # If you modify this file then change the above line to: # Modified
    <IfModule mod_rewrite.c>
       RewriteEngine On
       # Certain hosts may require the following line.
       # If vanilla is in a subfolder then you need to specify it after the /. 
       # (ex. You put Vanilla in /forum so change the next line to: RewriteBase /forum)
       # RewriteBase /
       RewriteCond %{REQUEST_FILENAME} !-d
       RewriteCond %{REQUEST_FILENAME} !-f
       RewriteRule ^(.*)$ index.php\?p=$1 [QSA,L]
    </IfModule>
    

    After reading the htaccess file for the forum directory, I changed it to RewriteBase /forum
    but still not working.
    I don't see config.php in the forum directory. Is it in a sub-directory?

  • An update. I finally found config.php in the conf directory. RewriteUrl was set to false so I changed it to true
    $Configuration['Garden']['RewriteUrls'] = TRUE;

    And it is still not working. Everything was so plug and play with Vanilla Forums right up to this point. Now I am just ripping hair out.

  • vrijvlindervrijvlinder Papillon-Sauvage MVP

    Make sure there is not a hash(#) in front of ReWrite Base

    I am not sure what else except that site url for where you want the facebook app needs to be the one with forum at the end.

    http://www.ocala-living.com/forum

  • edited March 2015

    htaccess now looks like this
    # Modified
    # If you modify this file then change the above line to: # Modified

    RewriteEngine On
    # Certain hosts may require the following line.
    # If vanilla is in a subfolder then you need to specify it after the /.
    # (ex. You put Vanilla in /forum so change the next line to: RewriteBase /forum)
    RewriteBase /forum
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.*)$ index.php\?p=$1 [QSA,L]

    and the site url is http://www.ocala-living.com/forum

    I just don't know either. It just was not meant to work for me I guess.

  • Well found the following post on here. Someone really should put all this in a FAQ file. The information is so shattershot all over the place. What to try first, second, etc would be helpful.


    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.

  • rasteronrasteron forum.rastercode.com ✭✭

    I don't recall modifying my plugin file but good info though @ragtop1968 glad it works for you now.

  • Mine isn't working either. Tried all the processes listed above but still get this error

    Invalid Scopes: publish_stream. This message is only shown to developers. Users of your app will ignore these permissions if present. Please read the documentation for valid permissions at: https://developers.facebook.com/docs/facebook-login/permissions

  • AlvaroFGAlvaroFG New
    edited May 2015

    Seems like there is a new apps review process implemented by facebook, we need to ask facebook for permission to use "publish_stream". I wonder where I could disable it, since I don't need that permission.

  • I've found it!, @martin2008 add this to your config.php file

    $Configuration['Plugins']['Facebook']['Scope'] = Array('email','public_profile');

  • @AlvaroFG yea worked

Sign In or Register to comment.