Hi,
I added debug flags, die("message"), which were not triggered but I later found out this was with Facebook which does not use that callback function.
Okay, I am now only focussing on 3 providers: Twitter, Facebook and Google.
The status of each is as follows.
Twitter: No Issues at all.
Facebook: Ultimately works but very slow. Takes about 30 seconds to complete.
Google: 504 Timeout error 99 times out of 100.
Facebook does not use the callback function and leaving this aside for now.
Twitter does use this function but works perfectly well. Google, and presumably, Yahoo, VK etc, all use this but invariably timeout.
The delay experienced with the others only happen AFTER this callback function is called.
So, if when i add a 'die("message")' flag to the beginning of the callback function and click the button, it is hit immediately for Twitter, Google, Yahoo, VK etc. So the issue is not the provider authenticating and returning to my site but with what happens afterwards while running the callback function for the other providers apart from Twitter.
By moving the "die" flag down the function code, I have found that the delay kicks in while running "$provider->client->authenticate();".
Tracking through the code led me to the authenticate function in "/components/com_jfbconnect/libraries/authentication/oauth2base.php"
A "die" flag at the beginning of that function is called immediately, so no delays up to calling that function and the delay comes in around Line 87 when running "$response = $this->http->post($this->getOption('tokenurl'), $data);"
A look at the developer console shows that a GET request of the form:
"
accounts.google.com/o/oauth2/auth?respon...approval_prompt=auto"
The delay seems to happen in waiting for a response to this call.
Actually, when I make that request directly into my browser I end up waiting forever. (I know this can't handle it perhaps, but expect some immediate error to show that the provider has received and perhaps rejected the browser call).
Wonder whether you can give me some insights on what to further look into given this information.
The interesting thing is why this doesn't affect Twitter given that it runs through the same functions. Facebook is clear as it uses a different approach. Is there something to change with the affected providers to make them consistent with Twitter's outcome?