Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages
Security and hardening

The Google OAuth client secret is not shown in Cloud Console

ErrorClient secret shows only ****abcd

Short answer

Google stores client secrets hashed. The full value can be seen and downloaded only when it is created; later the console shows the last four characters. If you lost it, add a new secret on the client's details page and rotate. Some client types, such as JavaScript apps, have no secret at all.

  • Applies to Google Auth Platform Console
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Fix it fast

  1. 1Find out which cause you have

    Open the client in the Google Auth Platform Clients page and look at what the secrets section shows and what the client type is.

    # Google Cloud Console > Google Auth Platform > Clients > select your client
  2. 2Match what you see, then jump to its fix

    1. 1only the last four characters are shownThe secret was created earlier and is no longer viewableFix
    2. 2no client secret exists for the clientThis client type does not use a secretFix

What does the error look like?

  • Client secret shows only ****abcd
  • No client secret field for the OAuth client

Cause 1 of 2

The secret was created earlier and is no longer viewable

1Check

Google says client secrets are visible and downloadable only at creation time. The console keeps the last four characters so you can tell secrets apart.

# Clients > your client > Client secrets section

2Fix

Add a new secret, then rotate. A client holds at most two secrets, so disable and delete one first if both slots are used. Copy the new value immediately into your secret store.

# 1. Clients > your client > Add secret
# 2. Save the new value in your secret manager
# 3. Deploy the app with the new value
# 4. Disable the old secret, then delete it

3Verify

Your app completes the token exchange with the new secret.

# sign in through the app; the token request should succeed

Confirmed by support.google.com

Did this fix it?

Cause 2 of 2

This client type does not use a secret

1Check

Google's OAuth overview says a JavaScript application does not require a secret, but a web server application does. Installed apps (Android, iOS, desktop) may get a secret that is not treated as confidential.

# Clients > your client > Application type

2Fix

For a JavaScript app, send no client_secret. If your backend needs one, create a Web application client for the server side instead.

# Web application client: has client_id and client_secret
# JavaScript-only app: use the client_id alone

3Verify

The flow works without a secret, or the new Web client returns tokens from the server.

# complete one sign-in and check the token response

Confirmed by developers.google.com

Did this fix it?

How do I stop it coming back?

  • Store the secret in a secret manager the moment it is created.
  • Rotate secrets by adding the new one first; delete the old one only after the app uses the new one.
  • Never ship a secret inside a mobile or browser app.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.

Related fixes

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.