PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Thursday, March 3, 2022

[FIXED] Error 404 using HybridAuth with Google

 March 03, 2022     google-api, hybridauth, php, wordpress, yii     No comments   

Issue

I have a problem with an old site developed using YII 1.1.
Everything worked until some time ago (the site is rarely used) but now login the Google login doesn't work.
Specifically, I use the HybridAuth extension (guide https://www.yiiframework.com/wiki/459/integrating-hybridauth-directly-into-yii-withoutan-extension) but now it seems that the callback called up "socialLogin?hauth.done=Google" has a 404 not-found error.
Nothing has changed on the website and obviously the controller exists. The only thing that is changed is the parent site (YII is in a subdomain) has been completely renewed (It's a Wordpress). What can I check?
I did 3 really strange behavior:

  1. The first time, or if I have never given consent to use, the login works correctly. Next login failed (404).
  2. If i manually call the URL via browser (copy and paste URL) the callback a I remove the scope "https://www.googleapis.com/auth/userinfo.profile" I have no more 404 error.
  3. If I remove from URL only the word ".profile", for example https://www.googleapis.com/auth/userinfo.profil2, I have no 404 error.

Locally the site work fine, without any problem at the login.

What can I check on YII configuration or in wordpress configuration ?


Solution

I solve it.
It was the .htaccess file of parent domain (Wordpress).
I add this line:

#BEGIN WordPress

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_URI} !subdomain ##NEW LINE
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress


Answered By - enfix
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing