Skip to content
  • Home
  • Log In
  • Register

p1r@t3z

Drvspan's aka p1r@t3z aka Drvs aka spaniakos Tech blog

Category: Web Developer

How to fix Google Login 404/403 error and ModSecurity [Resolved]

Posted on July 21, 2020February 4, 2022 by drvspan

I have created this blog in order for me to write about my experience as software engineer.

In an other post I will comment on my used plugins and why I made choose to use them, but for now let see a problem that I am having and what is the possible solutions. This solution is going to be views from the VPS side of hosting and the WHM no access side of hosting.

But first let’s see what is the problem.
For my login form I choose to have the option for google, facebook and twitter login button, for the users to have easy register/login choices.

While facebook and twitter worked out of the box using Nextend Social Login, Google has a problem which by the first look I couldn’t find what it was.

But with a closer look to the URI

https://www.piratez.gr/wp-login.php?loginSocial=google&state=<state>&code=<code>&scope=email+profile+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.email+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.profile+openid&authuser=0&prompt=none

This resulted to 404 – page not found error.

Now I had two point of information:
1) 404 error
2) The URI which has the depricated but used for backward compatibility https://www.googleapis.com/auth/userinfo.email and https://www.googleapis.com/auth/userinfo.profile

This scopes have been changed to the email and profile scope that you can see in the URI.

Immediately I knew that there was a problem with some of the values, therefore I removed the deprecated values and tried to manually re-apply the link and it got through.

There is a major problem here. This variables are sent directly from google using the callback URL I have declared to google API, therefore I cannot interfere with the values. On top of that I had a WAF installed in the site. (Which we will talk in an other post about it).

My second try, was to deactivate the WAF and try again, but it resulted in the same failure, with the same error page and the same symptoms.

The only other underlying security I have, is the modsecurity, which has rules and filters about the urls and how to process them. Sadly this blog is currently in a host in https://www.inwebpro.gr, an excellent host with a focus on security, and especially secure configuration for the server and good support and hosting. The only downside, is that the WHM (reseller hosting), has somewhat limited options that you can do, except if you ask for the permissions from the company, which will somewhat “void” you support on self harmful acts in the server’s instance.

What I want to achieve, is to whitelist the domain https://www.googleapis.com , in order for mode security to allow this url for as long as google provides it.

Now I am waiting for a reply in my request ticket ( it won’t take long, but as this is no critical issue, I have marked my ticket with moderate priority), but as I have searched a little more in google about the issue I have found that this have already been answered to the nextend website here.

I will return with a version 2 of this post to analyze the resolving of the issue.

After my communication with the hosting provider, the issue is RESOLVED by disabling the specific URL from the modsecurity rule for the specific hosting.
If you ever encounter the same problem, just disable the specific URL from the modsecurity rule, and all will work as expected!

EDIT 3/2/2022: We have made a server migration, and we are waiting for the server admin to do the same exception to the mod security.

EDIT 4/2/2022: login is now again working by using the same fix.

Recent Posts

  • How to recover your Hard Drive content! WARNING Took 1 month)
  • How to “resize” your macOS Bootcamp [Tutorial]
  • Like pirateZ.gr? Support me! [donate]
  • How to fix Google Login 404/403 error and ModSecurity [Resolved]

Hacker News

  • Creating Wildflower Meadows
  • Synthesis, Performance and Applications of Metal-Organic Framework MIL-101(Cr)
  • North Korea Botched Launch of Navy Destroyer
  • Show HN: Secure Execution of AI-Generated Code Locally on macOS/Linux MicroVMs
  • Making Minecraft Mods with LLMs
  • HTML5 elements you didn't know you need
  • Can We Trust Social Science Yet?
  • Cross Platform Machine Code (2022)
  • Show HN: Keyboard-first tool to type and create fast
  • Welcome to Agentic Commerce: Where Smart Agents Seal the Deal

Archives

  • September 2022 (1)
  • February 2022 (1)
  • July 2020 (2)

Recent Comments

  • How to recover your Hard Drive content! WARNING Took 1 month) – p1r@t3z on Like pirateZ.gr? Support me! [donate]

Helping Links

Cookie Consent
Privacy Policy

Categories

  • Affiliate and Donations
  • MacOS
  • Uncategorized
  • Web Developer

Meta

  • Register
  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org

Tags

affiliate bootcamp bootcamp size increase CRC error crypto ddrescure Failing HDD google login 403 google login 404 google login issue HDD recovery inwebpro linux recovery macOS modsecurity nextend partition paypal social login

top
© 2025 p1r@t3z
Theme: Techieblog by WP Crumbs