Does a GitHub App "Client Secret" ever expire? #187781
Replies: 3 comments 2 replies
-
|
GitHub App client secrets do not expire automatically. Once generated, a client secret remains valid indefinitely until you manually regenerate it in the GitHub App settings. How rotation works in practice Because there’s no built-in expiration or overlapping secret support, rotation is a manual process and requires coordination: Generate a new client secret Go to GitHub → Settings → Developer settings → GitHub Apps → Your App Under Client secrets, click Generate a new client secret Copy it immediately (GitHub only shows it once) Update your application configuration Replace the old secret in your: Environment variables Secrets manager (AWS Secrets Manager, Vault, GCP Secret Manager, etc.) CI/CD system Redeploy your application Old secret becomes invalid immediately GitHub invalidates the previous client secret as soon as a new one is generated. There is no dual-secret grace period. This means rotation must be carefully coordinated to avoid downtime. |
Beta Was this translation helpful? Give feedback.
-
|
No — a GitHub App Client Secret does not expire automatically. Details: When it stops working: |
Beta Was this translation helpful? Give feedback.
-
|
To answer your question directly: no, GitHub App client secrets do not expire. They stay valid until you explicitly delete them. Your screenshot actually confirms this — you have two active secrets coexisting, one from 2 weeks ago and one from 1 minute ago, both valid. And yes, you can have multiple client secrets active at the same time. Generating a new one does not invalidate the old ones. Only clicking "Delete" does. This is actually by design, because it enables zero-downtime rotation:
One thing worth clarifying since it trips people up: don't confuse the client secret with other GitHub App credentials — they each have different lifetimes:
For rotation best practices in production: store the client secret in a proper secrets manager (AWS Secrets Manager, HashiCorp Vault, GCP Secret Manager, Azure Key Vault — all have free tiers or are included in cloud accounts) rather than env files or hardcoded config. That way rotation is just updating the value in one place and redeploying, instead of hunting through config files. GitHub doesn't publicly document a hard limit on how many client secrets you can have active simultaneously, but in practice you'd only ever need 2 — the current one and the one you're rotating to. No reason to keep more than that around. |
Beta Was this translation helpful? Give feedback.

Uh oh!
There was an error while loading. Please reload this page.
-
Select Topic Area
Question
Body
I would like to know if the GitHub App's client secret (that is used for generating user access tokens) ever expire? How are they usually rotated for secure key management?
Beta Was this translation helpful? Give feedback.
All reactions