Hybrid Auth - "This page cannot be accessed directly" error

Speaking of Hybid Auth , I use Facebook to log in users, but I don’t know what I changed in the code, which forces the system to display “Unfortunately, this page cannot be accessed directly” .

I see that this is due to the $ _ SESSION ["HA :: CONFIG"] variable when the system checks if the Hybrid_Auth session already exists in the file hybridauth / hybridauth / index.php

Could you tell me how can I fix this?

+4
source share
4 answers

I am using the HybridAuth installer 2.0.11. While you are installing Hybrid Auth through /hybridauth/install.php, make sure that the HybridAuth endpoint URL contains a URL in the format http://domain.com , not http: //www.domain. com or some other subdomain Also make sure that you have the same URL format as your facebook twitter linkedin account.

+9
source

I ran into this problem when trying to log in using Firefox , and although hybridauth worked fine in all browsers, it didn't work in Firefox browsers. so if you are looking for an answer to

hybridauth firefox, you cannot directly access this page
.

the problem is that Firefox has a caching mechanism for redirecting pages, you can learn more about this topic in this thread firefox-5-caching-301-redirects

as a result, if you are trying to authenticate the user in the login page , and the cache headers for this page were in the 30x range (301-302-303-304 ...), Firefox is more likely to cache this page on the client side.

So, when a user tries to log in, the login page will not be processed on your server, instead, Firefox will serve the cached version of the login page , which redirects to the hybridauth verification hybridauth , otherwise, to initialize the Session Object required for authentication.

Solution: disable caching headers for login page and make sure it returns 200 code

+2
source

My Facebook App was in Sandbox mode, disabling the sandbox fixed it for me !!

0
source

Use $ _SERVER ['SERVER_NAME'] in the endpoint URL when setting up HybridAuth

0
source

Source: https://habr.com/ru/post/1385964/


All Articles