3

Since a few weeks ago, Google started complaining about using OAuth from non HTTPS sites. So finally we updated all our services to HTTPS.

But in my PC I use WAMP and HTTP (is just for development purposes). And since then every time I try to login with Google OAuth, I got the error: Error 400: invalid_request (without further information)

Error from OAuth

In production server every works like a charm. But only fails at localhost. In the Google API Console I have set the URI correctly:

URIs

I don't know what else to try. Should I install a SSL certificate on my WAMP server?. Doesn't Google support anymore localhost URIs?

Just for let you know, in my development environment I'm using WAMP 3.2.2.2. The project uses Laravel 8.0 with Socialite 5.0

Thank you in advance for everyone who can help me :)

MatuDuke
  • 4,997
  • 1
  • 21
  • 26

1 Answers1

0

SSL and OAuth development tend to go together and it is a struggle if you try to use localhost URLs. I therefore work locally by adding entries to my hosts file:

127.0.0.1  web.mycompany.com api.mycompany.com

Then create some OpenSSL certificates as in this bash script. I then use these whenever required, which improves my productivity.

This also provides a more real world setup, with better options for understanding trust issues early. Further details in this blog post.

Gary Archer
  • 22,534
  • 2
  • 12
  • 24