Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+2 votes
3.3k views
in Q2A Core by
I am using q2a open login plugin for my q2a site to activate open-login with facebook and google plus. In earlier I worked in " http://myq2asite.com/subdomain/index.php " as test purpose. And I give this Url as the redirect URL on both facebook application and google project.

But yesterday the pack get inserted into root directory for the site launch. So now site will get on directly " http://myq2asite.com/ " without use of subdomain. So the same time I edited the redirect URL with new URL on both facebook app and google project.

Here the problem begins

facebook redirected into : - > http://myq2asite.com/index.php?provider=Facebook&code=5# [not working] . So I checked with that code . code=5 means authentication failed

Google plus rediected into :-> http://myq2asite.com/index.php?qa=login&login=googleplus&to=index.php?qa=users. And also the page showing some fatal error.

The error is :

    Notice: Undefined variable: adapter in /home/name/public_html/qa-plugin/q2a-open-login-master/qa-open-login.php on line 120

    Fatal error: Call to a member function logout() on a non-object in /home/name/public_html/qa-plugin/q2a-open-login-master/qa-open-login.php on line 120

I didn't get any Idea for these issue. Is there any need to create a new apllication with new URL.??? Or any other solution

Please help me asap.

Thanks in advance
Q2A version: version 1.6.3
by
anyone please help me

1 Answer

0 votes
by
1) first of all check if the  "Preferred Site URL" of your q2a site is correct :
Admin---> General
Now it should be equal to = http://myq2asite.com
 
2) On your facebook App, Settings. check that you have :
App Domains = myq2asite.com
Website --> Site URL = http://myq2asite.com
 
3) Try to insert this line :
error_log(print_r('****** qa-open-login.php::check_login EXCEPTION ! : '.$e, TRUE));
 
just ***before*** this line :
 
clear completely your browser cache, retry to login and check the message on your error log file
by
is there any error log file exist for q2a. Nothing shows as any error code=5. authentication failed. How can overcome this
by
You have to check your webserver's error log file. Inserting the line above you'll have more infos
by
okay. Let me check
by
[24-Oct-2014 11:48:52 Etc/GMT] ****** qa-open-login.php::check_login EXCEPTION ! : exception 'Exception' with message 'Authentication failed! Facebook returned an invalid user id.' in /home/name/public_html/qa-plugin/q2a-open-login-master/Hybrid/Providers/Facebook.php:91
Stack trace:
#0 /home/name/public_html/qa-plugin/q2a-open-login-master/Hybrid/Endpoint.php(175): Hybrid_Providers_Facebook->loginFinish()
#1 /home/name/public_html/qa-plugin/q2a-open-login-master/Hybrid/Endpoint.php(56): Hybrid_Endpoint::processAuthDone()
#2 /home/name/public_html/qa-plugin/q2a-open-login-master/qa-open-login.php(141): Hybrid_Endpoint::process()
#3 /home/ame/public_html/qa-include/qa-page.php(106): qa_open_login->check_login()
#4 /home/name/public_html/qa-include/qa-page.php(782): qa_check_login_modules()
#5 /home/name/public_html/qa-include/qa-index.php(175): require('/home/name/...')
#6 /home/name/public_html/index.php(31): require('/home/name/...')
#7 {main}

Next exception 'Exception' with message 'Authentication failed! Facebook returned an invalid user id.' in /home/name/public_html/qa-plugin/q2a-open-login-master/Hybrid/Auth.php:147
Stack trace:
#0 /home/name/public_html/qa-plugin/q2a-open-login-master/Hybrid/Auth.php(39): Hybrid_Auth::initialize(Array)
#1 /home/name/public_html/qa-plugin/q2a-open-login-master/qa-open-login.php(91): Hybrid_Auth->__construct(Array)
#2 /home/name/public_html/qa-include/qa-page.php(106): qa_open_login->check_login()
#3 /home/name/public_html/qa-include/qa-page.php(782): qa_check_login_modules()
#4 /home/name/public_html/qa-include/qa-index.php(175): require('/home/name/...')
#5 /home/name/public_html/index.php(31): require('/home/name/...')
#6 {main}
by
Put this file :
https://www.dropbox.com/s/lcqrny34hkcwe89/testcurl.php?dl=0
in your docroot.
Invoke it from your browser :
http://myq2asite.com/testcurl.php
and post here the results you see (on your browser)
by
errno = 7
Failed to connect to 2a03:2880:20:4f06:face:b00c:0:1: Network is unreachable
http_code = 0
by
It looks like you cannot make outbound calls on https with PHP/CURL.
You should check with your hosting provider, probably they are blocked by a firewall.
by
In my error log file showing : Invalid IPv6 configuration on server, Please disable or get native IPv6 on your server.
by
What did your hosting provider say when you contacted it ?
by
Not contacted to the hosting provider yet. Is this issue basically a server issue?
by
Yes, read my previous comment
by
Okay. And also the googlePlus showing an popup . And asking permission for offline acess after clicking ok .

Showing some error


Notice: Undefined variable: adapter in /home/site/public_html/qa-plugin/q2a-open-login-master/qa-open-login.php on line 120

Fatal error: Call to a member function logout() on a non-object in /home/site/public_html/qa-plugin/q2a-open-login-master/qa-open-login.php on line 120

How can fix this issue
by
I also checked the qa-open-login.php file and there is the 119th line sticked with the error code 6 (User profile request failed) or
 7 (User not connected to the provider)

if($e->getCode() == 6 || $e->getCode() == 7) {
                     error_log($e);
                     $adapter->logout();
                   
                }
by
If you cannot make outbound calls (see testcurl.php), that's the main issue you have to solve.
The other could be minor bugs in the error management.
If you cannot run successfully the testcurl.php,

-----> contact your hosting provider
by
With the testcurl.php, check also if you can make outboud calls with *http*.
For instance you can change this line :
 $url = 'https://graph.facebook.com/';
to :
 $url = 'http://www.google.com/';
and invoke again the testcurl.php.
If also this invocation fails, you have to tell your hosting provider that also the outbound *http* calls are blocked (and not only the *https* ones).
Ask your hosting provider to allow your website to make them.
by
edited by
Got this

When $url = 'https://graph.facebook.com/';

errno = 7
Failed to connect to 2a03:2880:20:4f06:face:b00c:0:1: Network is unreachable
http_code = 0

and  $url = 'http://www.google.com/';
errno = 7
Failed to connect to 2607:f8b0:4009:803::1014: Network is unreachable
http_code = 0
by
ok, you are in a "box" :-)
You cannot make even http invocations.
Ask your hosting provider as above
by
But using phpinfo()

I got Curl enabled

cURL Information     7.24.0
by
Yes curl is enabled. But it cannot "go out"
...