Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+3 votes
1.4k views
in Plugins by
Anyone using Open Login plugin and getting the following error? What would be a good way to fix this?

PHP Fatal error:  Uncaught Hybrid_Exception: You cannot access this page directly. in /var/www/html/qa/qa-plugin/open-login/Hybrid/Endpoint.php:211\nStack trace:\n#0 /var/www/html/qa/qa-plugin/open-login/Hybrid/Endpoint.php(117): Hybrid_Endpoint->authInit()\n#1 /var/www/html/qa/qa-plugin/open-login/Hybrid/Endpoint.php(51): Hybrid_Endpoint->processAuthStart()\n#2 /var/www/html/qa/qa-plugin/open-login/Hybrid/Endpoint.php(72): Hybrid_Endpoint->__construct(Array)\n#3 /var/www/html/qa/qa-plugin/open-login/qa-open-login.php(137): Hybrid_Endpoint::process()\n#4 /var/www/html/qa/qa-include/qa-page.php(102): qa_open_login->check_login()\n#5 /var/www/html/qa/qa-include/qa-page.php(822): qa_check_login_modules()\n#6 /var/www/html/qa/qa-include/qa-index.php(194): require('/var/www/html/q...')\n#7 /var/www/html/qa/index.php(27): require('/var/www/html/q...')\n#8 {main}\n\nNext Hybrid_Exception: Endpoint: Error while trying to init Hybrid_Auth: You cannot access this page directly. in /var/www/html/qa/qa-plugin/open-login/Hybrid/Endpoint.php:217\nStack  in /var/www/html/qa/qa-plugin/open-login/Hybrid/Endpoint.php on line 217
Q2A version: 1.8
by
edited

I gave this as answer but am unable to reproduce this so I think this is an unrelated intermittent issue. Summarising it here in case it helps anyone.

It happened to me when trying to use the Facebook login if the redirect URI that the website was using was not exactly the same as the one configured in Facebook Login Settings 'Valid OAuth redirect URIs' (in https://developers.facebook.com/apps...). Later on trying to reproduce, I got an OAuth error from Facebook instead.

Q2A computes the redirect URI using the 'Preferred site URL' setting on the 'Administration Centre - General' page.

Using the above setting, Open Login's configuration does give you the exact URI to configure on Facebook, see below:

Callback URL/Redirect URL (to use when registering your application with Facebook): 

https://example.com/?hauth.done=Facebook

A difference of even a 'www' in the actual redirect URI and what is configured on Facebook gave this exception.


Preferred site URL: https://example.com/

Actual redirect URI when trying to use Facebook login:
https://www.facebook.com/dialog/oauth?client_id=0123456789&redirect_uri=https%3A%2F%2Fexample.com%2F%3Fhauth.done%3DFacebook&etc.etc.

In this case, Facebook Login's 'Valid OAuth redirect URIs' must be set to:

https://example.com/?hauth.done=Facebook


Preferred site URL: https://www.example.com/
Actual redirect URI when trying to use Facebook login:

https://www.facebook.com/dialog/oauth?client_id=0123456789&redirect_uri=https%3A%2F%2Fwww.example.com%2F%3Fhauth.done%3DFacebook&etc.etc.

In this case, Facebook Login's 'Valid OAuth redirect URIs' must be set to:

https://www.example.com/?hauth.done=Facebook

by
Anyone using this plugin and not having this issue? This link is related but not sure what exactly is happening in Q2A
https://stackoverflow.com/questions/21961139/you-cannot-access-this-page-directly-hybrid-auth

Please log in or register to answer this question.

...