How to implement Gmail OpenID authentication in my application

I’m trying to set up OpenID authentication using Gmail accounts for my web application but running into some issues. When I attempt to use the standard OpenID endpoints, I keep getting HTTP 302 redirect errors followed by unsupported GET method responses.

Has anyone successfully integrated Gmail OpenID authentication recently? I’m looking for working examples or alternative approaches that actually function properly. The documentation seems outdated and most of the endpoints I’ve tried either return errors or seem to be deprecated.

What’s the current best practice for allowing users to sign in with their Gmail accounts using OpenID? Are there any reliable libraries or services that handle this authentication flow correctly?

Google killed their OpenID 2.0 service in 2015 - that’s why you’re getting those redirect errors and unsupported method responses. Those endpoints don’t work anymore. I ran into the same thing two years ago with a legacy app I was maintaining. You’ll need to migrate to Google’s OAuth 2.0 with OpenID Connect, which is what they use now. It’s actually easier than the old OpenID flow. Just create a project in Google Cloud Console, enable the Google+ API, and set up OAuth 2.0 credentials. The auth flow uses standard OAuth 2.0 authorization code grant but returns extra identity info as JWT. Most modern auth libraries handle this natively, so it should be way less painful than the old deprecated setup.

totally agree, google oauth2 is the way forward! openid is pretty much obsolete now. the new identity docs have a bunch of examples that actually work. way simpler than the old openid methods.

Had the exact same problem last year updating an older project. OpenID 2.0 endpoints are completely dead - that’s why you’re getting those 302 redirects and method errors. I switched to Google Identity Services with their new sign-in flow and it worked great. Way cleaner than the old OAuth setup. You just include their JavaScript library and set it up with your client ID from Google Cloud Console. Token verification happens server-side but it’s pretty straightforward with their libraries. Performance is better too since there’s less back-and-forth than traditional OAuth. Just make sure you enable the right scopes in your console settings or you’ll get auth failures.