An OAuth client secret is the credential an application uses to prove itself to an identity provider during token exchange. It is not a user password, but it is still sensitive access material and should be stored, rotated, and monitored like any other production secret.
Expanded Definition
An OAuth client secret is the confidential credential an application presents to an identity provider when it exchanges an authorization grant for tokens. In practice, it identifies the client application and helps the provider distinguish legitimate token requests from impersonation attempts. It is not a user password, and it should never be treated as one.
Definitions vary across vendors on whether a client secret is acceptable for public clients, but the security guidance is consistent: use it only where the application can actually keep a secret. For browser-based, mobile, or desktop apps, stronger patterns such as proof-of-possession, PKCE, or brokered token exchange are usually more appropriate. OWASP’s OWASP Non-Human Identity Top 10 frames this as a secret handling and lifecycle issue, not just an authentication detail.
The most common misapplication is embedding the client secret in distributed code, where it becomes easy to extract from repos, build logs, containers, or front-end bundles.
Examples and Use Cases
Implementing OAuth client secrets rigorously often introduces operational friction, because tighter storage and rotation controls can slow application changes and require more coordination between developers and platform teams.
- A server-side web app stores its client secret in a secrets manager and injects it at runtime, rather than hardcoding it in app settings. The Guide to the Secret Sprawl Challenge shows why scattered credentials quickly become unmanageable.
- A SaaS integration uses a client secret to authenticate to the token endpoint, but only from a hardened backend service. This reduces exposure compared with placing the secret in a browser or mobile package.
- An enterprise audits third-party OAuth apps and discovers one vendor connection has broad access to mailbox and CRM data. The Salesloft OAuth token breach demonstrates how token abuse can cascade from one compromised integration.
- A CI/CD pipeline mounts the secret only for a deployment job and rotates it after release. This aligns with the least-exposure principles reflected in the CI/CD pipeline exploitation case study.
- A security team compares client-secret use with Ultimate Guide to NHIs — Static vs Dynamic Secrets and decides where short-lived credentials can replace long-lived static material.
For implementation guidance, the OAuth 2.0 security model in IETF specifications remains the baseline reference for token exchange behavior and client authentication expectations.
Why It Matters in NHI Security
OAuth client secrets are a non-human identity control surface, which means their exposure often creates machine-to-machine compromise rather than a single account issue. When they leak, attackers may mint tokens, impersonate applications, and move laterally through SaaS platforms, APIs, and CI/CD systems. NHI Mgmt Group research shows that 85% of organisations lack full visibility into third-party vendors connected via OAuth apps, which makes hidden client-secret dependencies especially risky.
That risk is amplified by poor storage discipline. NHI Mgmt Group also reports that 96% of organisations store secrets outside of secrets managers in vulnerable locations including code, config files, and CI/CD tools, and 79% have experienced secrets leaks. In that environment, a client secret is only as safe as the weakest system that can read it.
For governance, this means treating the secret as a renewable credential with ownership, rotation cadence, revocation paths, and logging. It also means linking application access reviews to OAuth app registrations, not just to human identities. Organisations typically encounter the full impact only after an integration is abused or a vendor token is stolen, at which point client-secret control becomes operationally unavoidable to address.
Further reading from NHI Mgmt Group includes the Dropbox Sign breach and the Shai Hulud npm malware campaign, both of which reinforce how quickly secrets become attacker leverage when they are exposed outside controlled systems.
Standards & Framework Alignment
This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.
OWASP Non-Human Identity Top 10 address the attack and risk surface, while NIST CSF 2.0 and NIST Zero Trust (SP 800-207) set the governance and control requirements practitioners need to meet.
| Framework | Control / Reference | Relevance |
|---|---|---|
| OWASP Non-Human Identity Top 10 | NHI-02 | OAuth client secrets are covered as sensitive non-human credentials that need lifecycle control. |
| NIST CSF 2.0 | PR.AC-1 | Client-secret handling supports identity proofing and access control for machine identities. |
| NIST Zero Trust (SP 800-207) | 2.1 | Zero Trust requires continuous verification of service-to-service credentials like client secrets. |
Treat each OAuth exchange as untrusted until the client credential is verified and scoped.