Skip to main content
Field notes · Practical tip

Error 400: redirect_uri_mismatch on client domains, and how to prevent it

If you run Google connections for clients on their own domains, you will meet this error sooner or later. Here is what it means, why it shows up weeks after setup, and the four-step checklist we now follow for every new domain.

By Adrian A., Founder of OHM Events Agency & AIOHM ·

The error, in front of a client

In November 2026, a new partner running AIOHM Platform on their own domain clicked "Connect Google Analytics" and got Google's error page: Error 400: redirect_uri_mismatch.

This error is worth understanding properly because of when it tends to appear. A missing address does not show up when you save your settings. It shows up later, when someone first uses that one Google feature on that one domain.

What redirect_uri_mismatch means

When an app asks Google for access, it tells Google where to send the person back afterwards. That address is the redirect_uri. Google only sends people back to addresses you have registered in advance on your OAuth client. Google's own error reference puts it plainly: the error means the redirect URI in the request "does not match an authorized redirect URI for the OAuth client ID."

The match is exact. In the parameter reference for web server apps, Google notes:

"Note that the http or https scheme, case, and trailing slash ('/') must all match."

Source: Using OAuth 2.0 for Web Server Applications, Google for Developers, checked 25 November 2026.

So https://client.com/callback and https://client.com/callback/ are two different addresses to Google. So are http and https, and so are www.client.com and client.com.

Why agencies hit it more than anyone

A single company with one website registers its callbacks once and forgets about them. An agency, or anyone running a white-label platform, has a different shape: one Google OAuth client serving many domains. Every client domain needs its own entries, and two things multiply the list.

  • No wildcards. Google's validation rules for redirect URIs list wildcard characters ('*') among the characters a redirect URI cannot contain. You cannot register https://*.yourplatform.com and be done. Each host is its own entry.
  • One address per feature. An app usually has a separate callback for each Google feature it connects. Register the sign-in callback and forget Analytics, and sign-in works while Analytics fails.

The three addresses AIOHM Platform uses per domain

Here is how this works in our own code, checked in the platform repository on 25 November 2026. By default, AIOHM Platform builds each Google redirect URI from the domain the person is using at that moment, unless the install is configured with a fixed callback address. A licensee on admin.client.com sends Google addresses on admin.client.com, not ours. That keeps each client's sign-in on their own domain, and it means each domain needs its own registrations.

Four Google connections share three callbacks:

  • Google sign-in: https://your-domain/auth/google/login/callback
  • Google Drive: https://your-domain/connections/google-drive/callback
  • Google Analytics and Search Console: https://your-domain/auth/google/analytics/central-callback

Analytics and Search Console share the last address. Search Console is stored as its own connection, but it uses the same Google app with one more read-only permission, and it returns through the same callback. Three addresses per domain, all registered at once, cover every Google feature the platform uses.

Your own app will have different paths. The principle is the same: list every callback your app can send, per domain, before the first client clicks anything.

The rules every redirect URI must follow

Even a correct address can be refused when you try to save it. Google's validation rules for redirect URIs, from the same developer page, include these:

  • It must use HTTPS, not plain HTTP. Localhost addresses are the exception.
  • The host cannot be a raw IP address, again except localhost.
  • The top-level domain must be on the public suffix list.
  • No URL shortener domains unless you own them, no user name or password in the address, no path traversal such as /.., no open redirects, and no fragment (the part after #).
  • No wildcard characters, non-printable characters, invalid percent encodings or null characters.

In practice, the first rule matters most for agencies: an address that starts with http:// is refused, so register the https:// form of every callback.

The checklist we follow for every new client domain

This is the routine we adopted after the Analytics failure.

  1. Open the OAuth client. In Google Cloud Console, go to APIs and Services, then Credentials, and open the OAuth client your app uses.
  2. Add every callback for the new domain, all at once. Under Authorised redirect URIs, add each address your app can send for that domain. For us that is the three above. Copy them from the code or the app's settings, never retype them, so the scheme, case and trailing slash match exactly.
  3. Remove domains you no longer use. A long list hides mistakes. When we cleaned ours in November 2026, we found two dead entries: one domain that no longer existed and one with no DNS at all. Neither did any harm on its own, but both made it harder to see which live domains were complete.
  4. Wait, then test every connection once. Google's help centre says it "may take 5 minutes to a few hours" for changes to these settings to take effect (Manage OAuth Clients, checked 25 November 2026). After that, sign in, connect Drive and connect Analytics on the new domain yourself, before the client does.

The last step is the one most people skip. A redirect URI error is invisible until someone triggers that specific flow on that specific domain. Testing each connection once is the only way to find a missing entry before a client does.

When the error appears anyway

If a client still sees the error, find the exact address your app sent. It is the redirect_uri parameter in the authorisation request your app sent to Google. Compare it character by character with your registered list. The usual causes are four: the domain was never added, one feature's callback was missed, the scheme or a trailing slash differs, or the change was saved recently and has not taken effect yet.

One more thing worth knowing if you manage many clients: Google's OAuth policies say Google "reserves the right to delete unused OAuth clients" that are inactive for at least six months (OAuth 2.0 Policies, checked 25 November 2026). If a seldom-used client stops working entirely, check that it still exists before you hunt for a mismatch.

Why this matters beyond one error

The lesson I keep relearning is that systems fail quietly when nothing has a list. One missing address does not fail at setup. It fails weeks later, on one connection, in front of a client. Registering every callback on day one, and testing each one, turns a support ticket into a short routine.

If you run AIOHM Platform under your own brand, the three addresses above are the ones to add for each domain you serve. The white-label licence puts the platform on your domain, with your branding and your login, which is exactly why each of your domains needs its own entries.

Warmly,
Adrian A.
Founder, OHM Events Agency & AIOHM