Stuck at OAuth2 Facebook connector

Getting closer..... Now the error disappeared but this came after

"# Can’t connect securely to this page

This might be because the site uses outdated or unsafe TLS security settings. If this keeps happening, try contacting the website’s owner.

Your TLS security settings aren’t set to the defaults, which could also be causing this error.

Try this:

Well thank goodness you are past the first issue, so we are certainly getting closer.

Yes. The :80 added to url did some magic… But now I’m curious. Why is that?

I am unsure why it does that, but I can safely say it’s a configuration difference in the webserver rather than something Wappler is adding, because I used the same source files on 2 servers and one does that and the other does not.

It must be some server configuration, the redirect url is constructed within server connect, it gets the port number from the server and only adds it to the url if it is not on the default port. Somehow your server returns to php that it is running on port 80 while being accessed from https (default port is 443).

If you want to setup a php info test script and check it against my server which is working, my link is here https://www.learnwappler.com/test.php
Maybe do a search for TLS, and possibly something may be different.

I don’t think tls is the problem, you get the same error if you access the url in the browser https://liveworkoutpass.com:80/. Check with phpinfo() what php sees for port number.

1 Like

Please, can you quickly check if you see anything related to the issue? I’m not familiar with php configuration, I just did a quick research how to setup a info file. Here’s mine https://liveworkoutpass.com/phpinfo.php

Im not sure what access you have to your hosting server but here are the differences that seem relevant to me.


How to fix the problem on the other hand, well that I am not to sure of to be very honest.

EDIT: Maybe contact your hosting provider and ask them how you can fix this.
Lastly, please make sure to delete the php info file when you are done diagnosing the issue, im pretty sure that file gives some lovely info to a wouldbe script kiddie

Any scripts/guidance how should I formulate the message to my hosting support so they clearly understand what is going on? :slightly_smiling_face:

I use https://www.ecowebhosting.co.uk/ which curates the service from (https://www.20i.com/) as a reseller, same as Brian used in some tutorials. https://www.ecowebhosting.co.uk/web-hosting the ultimate package to be exact

I would send them a link to the phpinfo file, and just tell them you are trying to use the facebook API interface and your server while on a https ssl connection is reporting port 80 instead of port 443, and also appending :80 to the end of your domain name in your URL, which is causing the facebook API to fail.

Yes Brians server was the first time I ever came across the oddity to be honest, and i never really looked into it enough to resolve it. @Hyperbytes any ideas

At this rate, we could become a great “error scene investigators”. This feels like " wild-goose chase" operation :grinning: :grinning:

1 Like

It looks that the php is running behind a proxy, probably its running nginx in front and apache/php behind it.

You could try following, in dmxConnectLib/dmxConnect.php add following code at the beginning:

if (
  isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && 
  $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https'
) {
  $_SERVER['SERVER_PORT'] = 443;
  $_SERVER['HTTPS'] = 'true';
}

Can you be more specific? What this actually does? :slightly_smiling_face:
After <?php or in the first line of the file?121

put it after the define

Ok. Now the error message has changed it’s format.

Facebook has noticed that “my app product name” doesn’t use secure connection in file transfer.

You can log in to LWP Login with my facebook login until the app will update it’s security settings…

OMG… I can’t believe this is actually happening. How many security layers I have to pass until I get a DAMN fb login installed on my web app… :neutral_face:

666

I don’t know what it is with the server configuration. Lets just edit the Oauth2 class directly.

In the file dmxConnectLib/lib/oauth/Oauth2.php comment out or remove line 152.

$url .= ($https && $port == '443') || (!$https && $port == '80') ? '' : ':' . $port;

@psweb I think this is related to a setting i had in place “Force HTTPS” which appear to redirect any activity to http:// port 80 to https:// port 443

I think some systems detect this and register an issue and add :80 to the url

I have turned “Force HTTPS” off for your test server, would be interested to see if this is still the case