Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Try Vanilla Forums Cloud product

Ready to contribute?

Amazing! Sign our contributors' agreement and then join us on GitHub.

Facebook authorisation doesn't work.

After more than 20 attempts of integraition with facebook login I came to 2 (TWO) major issues:

  1. Your facebook plugin asks FB for publish_actions permition and your guides does not tell what you have to do to make it work, because pure clean and fresh vanilla instance when connecting to fresh APP makes FB to respond like that: "Submit for Login Review
    Some of the permissions below have not been approved for use by Facebook." - and there is actually nothing more in this note but I have found publish_actions in your script in scope section.

  2. Even I have tried so many times, every time exactly as your guides say. Even I have try to find solution here (change in code, replace plugin with the one on Github) etc. etc. There is always the same conlusion: UniqueID is required. !
    Settings (app id, secret key, app settings) are OK because if they were not I would not be able to go through FB auth and APP connection ... something is wrong later - when after sucesful connecting FB is sending me back and vanilla seems doesn't recognize facebook profile details.

R_J

Comments

  • Info from debug:

    Notice 1
    file_get_contents(): SSL operation failed with code 1. OpenSSL Error messages:
    error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed

    Notice 2
    file_get_contents(): Failed to enable crypto

    Notice 3
    file_get_contents(https://graph.facebook.com/me?access_token=EAAH.....D&fields=name,id,email): failed to open stream: operation failed

  • And it's not my server settings or connection issue because I've just tried the same with fresh MyBB instance, i've prepared new fb app, and FB login works there like a charm.

  • vrijvlindervrijvlinder Papillon-Sauvage MVP
  • @vrijvlinder said:
    Then go with MyBB if that works for you ...

    LOL... I have tried to describe my problem as good as I can and exclude if there are any server connection issues so I have just tried different script to check it... I need Vanilla because of it's simplicity.

    Looks like you have attitude problem buddy, I just hope you don't represent the level of support here.

  • whu606whu606 I'm not a SuperHero; I just like wearing tights... Moderator

    @Koriakin

    Pretty much everyone on here is a volunteer. vrijvlinder can come across as 'testy' at times, but overall, if someone can help with a problem they will.

    I don't use FB authorisation, so can't help.

    Hopefully, someone will be on to help you later.

    Koriakin
  • vrijvlindervrijvlinder Papillon-Sauvage MVP

    When people threaten to use some other software because one plugin does not work for them , that is an attitude problem. I simply stated the obvious , if mybb works like a charm then use that. There are at least 30 other discussions with people having the same problem. Maybe it does not work anymore. Maybe it's the settings. There are tutorials for js connect and solved discussions you can access. The level of support is based on the willingness of the user to search the forum for solutions.

  • R_JR_J Cheerleader & Troubleshooter Munich Moderator

    @vrijvlinder:
    Based on the description I would say there even has been quite a lot of research done!
    Installing another forum script for testing the Facebook settings is another effort that most of the users asking similar questions before haven't done.

    By the way: there is no connection between jsConnect and the Facebook plugin. You could have known that by doing a little research. ;)

  • whu606whu606 I'm not a SuperHero; I just like wearing tights... Moderator

    vrijvlinder

    I can see why you came to that conclusion, but as the OP has clarified, it was the wrong one.

    They were simply trying to clarify that it wasn't a server issue.

  • vrijvlindervrijvlinder Papillon-Sauvage MVP

    UniqueID is required. !

    This generally occurs when the Facebook app and the Vanilla plugin are not configured correctly. For security, only the registered callback URL is accepted as a redirect URL.

    This would generally be fixed by putting the correct URL in the Facebook app settings page.

  • KoriakinKoriakin New
    edited April 19

    @vrijvlinder it was not meant to be a threat, I was only anticipating questions.

    I'm not a coder, developer or any other software engineer, and my knowledge is in this matter limited... I know html, some basics of php and that's it. I can reshape script a little bit just to look at the end how I need, even to work like I need - if it's simple. But when it comes to technical issues I can only relly on complete, clearly described solutions because I'm not able to came up with my own.

    I have tried whatever I have found, here, on stackoverflow and few other websites.

    It's only 5 or 6 simple settings in FB app... come on... I was checking it thousands of times for any smallest mistakes

  • I have just noticed one more thing. I was installing Vanilla using Installatron, because my hosting gives me that possibility, now I'm trying to installit by my self. When i've uploaded untouched zip file with vanilla I have noticed small difference after unzipping. All files arr 666 and directories are 777, when after Installatron dirs were 755 and files were 644. My hosting does not allow me to open in browse file with 666 attributes is there any chance it maybe somehow connected?

  • vrijvlindervrijvlinder Papillon-Sauvage MVP
    edited April 19

    You should not need technical knowledge to get this to work. But also remember that facebook is the one who authorizes connections to Vanilla forums, and based on your issue, their end is having the problem. Maybe they can shed some light on why it is working with mybb and not with vanilla. In the link I posted is a way to find out what is happening.

    Otherwise try the support forum at the devs on facebook

    https://developers.facebook.com/docs/facebook-login

  • vrijvlindervrijvlinder Papillon-Sauvage MVP

    You should use an ftp client like Filezilla to upload the unzipped folders and overwrite the old installation.

    No folder should have permissions higher than 775 because 777 basically opens your files to get hacked.

    You should be able to browse all files in your root folder. It is possible your owner permissions are wrong and that needs to be fixed by your host. Owner permissions are not the same as chmod file read and write permissions.

    Try browsing your files via ftp client like Filezilla.

    Check the htaccess file to be correct, and you have rewrite urls enabled. You can post it here if in doubt.

  • I'm using TotalCommander as ftp client. I've sent there untouched original zip from here, uziped there and it came out from package like that - dirs 777 and files 666. I actually see something like that for the first time, it never happened before.

  • vrijvlindervrijvlinder Papillon-Sauvage MVP

    You should not upload zipped files. Download the Vanilla software from here, but not the beta make sure it's 2.3 and unzipp the vanilla folder and then upload it by overwriting the old installation except keep the config.php with the setup info from the old installation.

    I am not familiar with that ftp client. But it should work the same I presume.

  • KoriakinKoriakin New
    edited April 19

    @vrijvlinder Yeah I'll try that

    Also Facebook released yesterday new (2.9) API for all new apps

    PS. Just checked with one of my old apps API 2.3 and still the same.

  • @vrijvlinder did that, also tried the same with 2.4b1.

    Later I've tried to do it under different domain, completely from scratch... under different browsers, everytime between attempts I was clearing cookies etc. tried all php versions between 5.6 - 7.1.

    I presume this script is fine as it is, just "plug'n'play", and I like to think I'm not that dumb to tried so many times with no effect because of my mistake somwhere... it's so fu.ng simple that there is literally only 4 things crucial to work.

    At this point I'm 75% sure there are some weird circumstances on my host which are making it impossible.

    I've mentioned before about file permitions and that is actualy very strange. Everytime I'm installing any script, I always send it just as it came from developer in package - untouched, staright to server via ftp, and unpacking is done there via DirectAdmin or cPanel or whatever there is. It alwas worked for me better than sending it unpacked because: 1. Time, and 2. File permitions issues when sending it unpacked under windows.
    For some reason when I'm unpacking Vanilla it comes out with 777 dirs and 666 files. It doesn't happen with other scripts.
    There is something in my environment not compatible with Vanilla.
    I have no other host to try.

    Because I have totaly no progress in 3 days now, I need to give up this project.

    Later in free time I will make some other investigations, I will try do it with WAMP for example.

    Anyway thak you for now.

  • CaylusCaylus ✭✭

    @Koriakin said:
    After more than 20 attempts of integraition with facebook login I came to 2 (TWO) major issues:

    1. Your facebook plugin asks FB for publish_actions permition and your guides does not tell what you have to do to make it work, because pure clean and fresh vanilla instance when connecting to fresh APP makes FB to respond like that: "Submit for Login Review
      Some of the permissions below have not been approved for use by Facebook." - and there is actually nothing more in this note but I have found publish_actions in your script in scope section.

    FYI, I personally changed this configuration setting to exclude the publish_actions permission:

    $Configuration['Plugins']['Facebook']['Scope'] = 'email,publish_pages'

    Koriakin
  • @Caylus I did that shortly after I've found it ;)

    Caylus
  • AaronWebsteyAaronWebstey Headband Afficionado Cole Harbour, NS ✭✭✭
    edited April 20

    I don't have time to read all the back-and-forth and am not positive whether this got resolved or not, but I did get the UniqueID issue fixed on my forum. Found this:

    http://nutmedia.co.uk/snippets/vanilla-forums-facebook-login-uniqueid-required-issue-fix/

    In summary,

    go to plugins/Facebook/class.facebook.plugins.php find function getAccessToken() and change following part:

    if (strpos(val('content_type', $Info, ''), '/javascript') !== false) {
    $Tokens = json_decode($Contents, true);
    } else {
    parse_str($Contents, $Tokens);
    }
    

    To

    if (strpos(val('content_type', $Info, ''), '/json') !== false) {
    $Tokens = json_decode($Contents, true);
    } else {
    parse_str($Contents, $Tokens);
    }
    

    Oh and I actually used this in the end, slightly different from http://stackoverflow.com/questions/43380648/vanilla-forums-facebook-authentication-error-uniqueid-is-required

    For now I fixed the function getAccessToken() replacing this:

        if (strpos(val('content_type', $Info, ''), '/javascript') !== false) {
            $Tokens = json_decode($Contents, true);
        } else {
            parse_str($Contents, $Tokens);
        }
    

    with this:

        if (strpos(val('content_type', $Info, ''), '/javascript') !== false) {
            $Tokens = json_decode($Contents, true);
        } else if (strpos(val('content_type', $Info, ''), '/json') !== false) {
            $Tokens = json_decode($Contents, true);
        } else {
            parse_str($Contents, $Tokens);
        }
    
    vrijvlinderKoriakinsteam
  • vrijvlindervrijvlinder Papillon-Sauvage MVP

    @Koriakin said:
    @vrijvlinder did that, also tried the same with 2.4b1.

    No need to try out a Beta version at this time. It's only for developers. I said it several times I think..

    Later I've tried to do it under different domain, completely from scratch... under >different browsers, everytime between attempts I was clearing cookies etc. tried >all php versions between 5.6 - 7.1.

    It is not Vanilla that is the problem, it's the plugin.. If everything else works , then it's the plugin..

    I presume this script is fine as it is, just "plug'n'play", and I like to think I'm not >that dumb to tried so many times with no effect because of my mistake >somwhere... it's so fu.ng simple that there is literally only 4 things crucial to >work.

    But you failed to follow the installation instructions I gave you.I strictly said do not unpack the zip after upload. I said upload after unzipping. Can't know what you did wrong other than not follow instructions... making it hard to help you. It is not difficult if you follow instructions. The way you are doing it is wrong.

    At this point I'm 75% sure there are some weird circumstances on my host which >are making it impossible.

    It is possible that it could be your host, or it can be your doing. Hard to say.
    But if everything else works fine, then it's not your installation, it's the plugin.

    I've mentioned before about file permitions and that is actualy very strange. >Everytime I'm installing any script, I always send it just as it came from developer >in package - untouched, staright to server via ftp, and unpacking is done there >via DirectAdmin or cPanel or whatever there is.

    That is wrong. Doing that can mess up your installation by adding unwanted code.
    It is best to unzip and then upload.

    it alwas worked for me better than sending it unpacked because: 1. Time, and 2. File permitions issues when sending it unpacked under windows.

    I would use Filezilla then. I mean something is obviously wrong with the one you are using, because that never happens to me.

    For some reason when I'm unpacking Vanilla it comes out with 777 dirs and 666 >files. It doesn't happen with other scripts.
    There is something in my environment not compatible with Vanilla.
    I have no other host to try.

    If this is a free host then you might not be able to use Vanilla at all. But if you installed other software and it worked, then it may be the settings or something else. But we can't guess.

    Because I have totaly no progress in 3 days now, I need to give up this project.
    Later in free time I will make some other investigations, I will try do it with WAMP >for example.

    Ok Good luck, but I recommend you try this https://open.vanillaforums.com/discussion/comment/247087/#Comment_247087

  • KoriakinKoriakin New
    edited April 20

    @vrijvlinder

    No need to try out a Beta version at this time.

    I have tried it, I don't see reason why not to do it, since plugin is newer

    It is not Vanilla that is the problem, it's the plugin.. If everything else works , then it's the plugin..

    I have never stated it's Vanilla problem

    But you failed to follow the installation instructions I gave you.

    I think I was was clear enough when I wrote "I did that" but I will say it again: I did send all stuff like you said!

    The way you are doing it is wrong.

    That is wrong. Doing that can mess up your installation by adding unwanted code.
    It is best to unzip and then upload.

    Well I absolutely don't agree with you. In this way files and dirs come out exactly how the have been zipped by developer. I'm doing like that for about 15 years now and for the first time I see files comming out with full permit.
    By the way, you are using windows or linux (inculding mac) to send it?

    I would use Filezilla then. I mean something is obviously wrong with the one you are using, because that never happens to me.

    There is nothing wrong with TotalCommander, how even can it be if I don't even using it to open package, it's only to send it to host.

    If this is a free host then ...

    It's well paid service

    I've actualy tried already both ways.

  • vrijvlindervrijvlinder Papillon-Sauvage MVP
    edited April 20

    Uploading a zipped folder via an ftp client is wrong. Because in order to extract it then you need to use cpanel from the host. It's a waste of ftp. And you face the kind of issues with permissions.

    I prefer to know exactly what I am uploading and be able to not upload certain files which would get overwritten on my installation.

    You are free to do as you please and ignore my advice,My advice comes with some experience. But also know that I have successfully installed and updated several forums , maybe a dozen and helped other people in the hundreds to get their forum going. I have also written themes and plugins for this community, for four plus years. So before you discard what I have said, keep that in mind.

    Also Using a Beta version on a production site is wrong if you are not a developer. The plugins are the same ones. And if you want a plugin you can always get it from Github if indeed it is newer. Since it does not work either with 2.4 , then it's not newer. You tend to assume too much..

  • KoriakinKoriakin New
    edited April 20

    Uploading unziped files and folders, especialy using windows is wrong, because windows doesn't give a s.it about linux file permitions and after uploading you need to double check all of them.
    With unzipping files by cPanel or DirectAdmin there maybe only one problem - file ownage - but it's only when hosting isn't setup correctly. Beside that it's the quickest and safest method of uploading any script, because like I said files coming out that package are with oryginal permits.

    My expirence comes from a lot of websites (mainly joomla, phpbb, prestashop, opencart, webtrees etc) also successsfuly instaled. I've made few times joomla themes, I did not made any plugins, but I've tranaslated a lot of them. I do nto discard your knowledge about Vanilla because is for sure more superior than mine, but everything else is just your opinion.

    Using a Beta version on a production site is wrong... it's not newer. You tend to assume too much..

    Oh dear God... I'm TESTING what is working and how and are... compare FB plugin from 2.3 and 2.4, they where different enough to TRY...

  • vrijvlindervrijvlinder Papillon-Sauvage MVP

    Beside that it's the quickest and safest method of uploading any script, because like I said files coming out that package are with oryginal permits.

    There are no original permits. Not sure what you mean by that. There are hidden files that will be overwritten if not removed from the package, such as the htaccess file... your statement makes no sense practical or otherwise.

    Oh dear God... I'm TESTING what is working and how and are... compare FB plugin from 2.3 and 2.4, they where different enough to TRY...

    Ok so long as you know that you are on your own when using a Beta version. The support here is limited to stable versions we use in real time on real forums with real people. Some people might be testing it and might be able to help. However as with all Beta versions of any software, they are best not used in production scenarios.

    All of the advice you have gotten from me and the others, is based on 2.3. We wasted your time.

  • R_JR_J Cheerleader & Troubleshooter Munich Moderator

    What the hell is going on here?

    The best hints what fails were already given in the 1. comment (which could be counted as the opening post).

    All the rest seems to be silly noise.

    1. File upload? Why the heck should it matter how a file has been copied from A to B when it is obviously the same at A and B? (No, please! This is only a rhetorical question, really!)
    2. File permissions? 777/666 from security point of view that is not good. For testing that is optimal, since with this permissions it is granted that your problem has nothing to do with file permissions

    If anybody wants to drop a line concerning this two points, feel free, but since I would split such a comment into a new discussion, please do it by yourself.

    I think it is hard to follow the real problem when there is so much talk about not related "problems".


    @Koriakin: thanks for testing what you could think of before asking your question! I guess the most important hint what is going on here, has been posted by yourself in your very first comment.

    @Koriakin said:
    Info from debug:

    Notice 1
    file_get_contents(): SSL operation failed with code 1. OpenSSL Error messages:
    error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed

    Notice 2
    file_get_contents(): Failed to enable crypto

    Notice 3
    file_get_contents(https://graph.facebook.com/me?access_token=EAAH.....D&fields=name,id,email): failed to open stream: operation failed

    Notice 2 and 3 are simply follow ups of the first error (when "SSL operation failed", all the following communication with that server must fail, too)

    So we should focus on the first point. A look at Stack Overflow shows that this seems to be
    a) quite a common problem
    b) independent from the PHP script used
    c) connected somehow to curl

    If it is really independent from the PHP script, I'm not surprised that using Vanilla 2.3 or the beta version or any version of the Facebook plugin fail all the same. They are not the reason, the way the connection is established seems to be the reason - that is my best guess.

    If MyBB doesn't have that problem, it might because they send other curl headers or do not use curl at all - I don't know and I wouldn't investigate in that direction first.

    I think the best thing to do would go through some of the questions on Stack Overflow and try what has been advised there. From having a quick look at it, I would say that this answer is most promising.

    I respect the endurance you have shown by now and it would be great if you could keep on testing and reporting back!

    Koriakin
  • R_JR_J Cheerleader & Troubleshooter Munich Moderator

    Just one simple addition: if you ask questions here, you will get answers from the open source community. This is great for asking "how to"/"help" questions.

    If you think you have found an error/issue, the Vanilla developers are happy if you file an issue on GitHub and certainly they are thankful if you directly make a pull request ;)

    I have no experience with Facebook, but I thought I report that scope problem as an issue: https://github.com/vanilla/vanilla/issues/5458
    I would say that you really found something which could be improved! =)

    Koriakin
  • @R_J Well, I described what I've saw, and permitions were one of unusual things.

    Personaly I don't mind spliting this topic with @vrijvlinder , because clearly he doesn't get what I mean.

    I will still try whatever new I will find to make it work, because I love how simple Vanilla looks on mobile devices.

    I'm glad my effort may bring some improvements, but I'm sure I'm not the first one who found that ( @Caylus for example), but maybe I'm first who described it here.

    Caylus
Sign In or Register to comment.