Join our Newsletter — 33% off our NHI Course
Authentication, Authorisation & Trust

Client Secret

← Back to Glossary
By NHI Mgmt Group Updated October 31, 2026 Domain: Authentication, Authorisation & Trust

A client secret is a credential used by an application to prove its identity to an identity provider during token exchange. In OIDC, it functions like a password for the workload, so exposure in code, logs, or build artifacts can enable impersonation and downstream access.

What a client secret actually does

A client secret is a shared credential that lets an application authenticate itself to an identity provider during token exchange. It is not the application’s identity, but a proof mechanism attached to that identity. Because it behaves like a password for the client, any copy of it in source code, logs, tickets, or artifacts becomes a direct impersonation path.

That makes the term broader than a simple configuration value. A client secret sits in the authentication layer of machine-to-machine access, where compromise can let an attacker request tokens as the application and then use those tokens across downstream APIs and services.

Where client secrets are used in OAuth and OIDC

Client secrets are most commonly associated with confidential clients, especially service-to-service and other server-side integrations. In those flows, the application presents the secret to the identity provider so the provider can decide whether to issue tokens. The secret is therefore part of the trust relationship between the client and the token issuer, not just a local secret stored for convenience.

In OIDC and OAuth client credentials scenarios, the security model depends on the secret remaining known only to the legitimate application operators. If the secret is embedded in code or copied into a build system, then every environment that sees that material becomes part of the attack surface. For deeper implementation context, see Machine-to-Machine OAuth (Client Credentials) Guide.

Many teams also use client secrets alongside other credentials, such as certificates or signed assertions. That comparison matters because the choice affects how strongly the client can be bound to a specific runtime, how rotation is handled, and how easily the credential can be reused outside the intended system. JWT Client Authentication Guide covers the common alternative in which signed assertions replace a shared secret.

Why exposure becomes a security and identity problem

A client secret creates a single point of failure for application authentication. If it leaks, the attacker does not need to defeat the identity provider’s front door, they can present the same proof the application would have used. That can lead to token issuance, impersonation, unauthorized API calls, and access that looks legitimate in logs unless the organisation has strong correlation and attribution controls.

Exposure usually matters because the secret is often reused in multiple places, copied into CI/CD pipelines, or stored in environment variables and deployment manifests. The more places it exists, the harder it is to know which copy was compromised and whether related tokens, sessions, or downstream credentials also need to be invalidated. Guide to the Secret Sprawl Challenge explains why hardcoded credentials and pipeline exposure make this problem persistent.

Client secret compromise is also an identity-governance issue because it often outlives the people who created it. Stale app credentials, forgotten registrations, and unmanaged rotation windows extend the attack surface long after the original integration was deployed. Azure Entra Client Secrets Security Guide shows how this becomes an operational control problem, not just a code hygiene issue.

How organisations reduce client secret risk

The safest pattern is to minimise reliance on shared secrets where a stronger client-authentication method is available. Where secrets are still used, they need short lifetimes, narrow scope, secure storage, and a clearly owned rotation process. That is especially important for applications that can request broad application permissions or reach sensitive internal APIs.

When a client secret cannot be removed immediately, the practical control goal is to confine what it can do and where it can travel. That means keeping it out of code repositories, preventing it from appearing in logs or telemetry, and ensuring the application registration has only the minimum access needed for the use case. The life-cycle angle is often more important than the initial setup: expired or orphaned secrets are a common source of outages and blind spots. How to find expiring app secrets and certificates in Entra ID is useful where secret expiry and ownership need active management.

For teams standardising controls across multiple platforms, Secrets Management Guide and API Key Management Guide provide adjacent patterns for central storage, rotation, and revocation that apply equally well to application credentials.

How to think about detection and recovery after compromise

If a client secret is exposed, the first assumption should be that any token exchange performed with that secret may be suspect. Detection is about finding where the secret appeared, where it was used, and whether the application account established new credentials, unusual token issuance, or unexpected access patterns after exposure. The response then expands beyond the secret itself to include the application registration, downstream tokens, and any privileges that the compromised client could exercise.

Post-incident review should ask whether the leaked secret was replaceable, whether a stronger client-authentication method was available, and whether the integration had an unnecessary level of trust. Public breach analysis is often the fastest way to understand the failure mode. OneLogin API flaw (CVE-2025-59363) shows how exposed OIDC secrets can create impersonation risk, while Commvault Metallic breach 2025 illustrates how app secrets can become a third-party access path into customer environments.

In practice, the recovery question is not only “rotate the secret” but also “what else must be rotated or invalidated because this client could already act as the application?” That is the identity impact that makes client secret compromise more serious than a generic secret leak.

Risk and Threat Considerations

Client secrets are attractive to attackers because they are portable, reusable, and often difficult to distinguish from legitimate authentication traffic once stolen. A leak from source control, build output, support tooling, or browser-accessible configuration can turn into impersonation, token minting, and silent access to downstream systems.

Failure mechanism: The attacker obtains a valid client secret, uses it in token exchange as the application, and then abuses the resulting tokens or linked permissions before defenders detect the source of the compromise.

Impact: The blast radius can extend beyond one application to any API, tenant, or service that trusts that client, including privilege abuse, data exposure, unauthorized automation, and the need to revoke credentials and re-establish trust relationships.

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 and OWASP API Security Top 10 address the attack and risk surface, while NIST SP 800-53 Rev 5 sets the governance and control requirements practitioners need to meet.

FrameworkControl / ReferenceRelevance
OWASP Non-Human Identity Top 10NHI-02 — Secret LeakageClient secrets are identity-bearing credentials whose exposure creates direct impersonation risk.
NHI-04 — Insecure AuthenticationClient secrets authenticate applications to identity providers during token exchange.
NHI-07 — Long-Lived SecretsClient secrets often persist too long and expand exposure windows when not rotated quickly.
Recommendation — Inventory and protect client secrets so they never leak into code, logs, artifacts, or shared tooling. Prefer stronger client-authentication methods and harden token exchange paths against secret abuse. Set short lifetimes and rotate client secrets aggressively to limit reuse after exposure.
NIST SP 800-53 Rev 5IA-5 — Authenticator ManagementClient secrets are authenticators whose issuance, storage, rotation, and revocation must be managed.
IA-9 — Service Identification and AuthenticationApplication-to-IdP and service-to-service authentication with secrets falls under service authentication.
AC-6 — Least PrivilegeCompromised client secrets should not unlock broad downstream access if privilege is minimised.
Recommendation — Manage client secret lifecycle, including secure storage, rotation, revocation, and replacement. Use service authentication controls that bind client identity to approved runtimes and limit shared-secret reliance. Constrain application permissions so a stolen client secret cannot access more than necessary.
OWASP API Security Top 10API2 — Broken AuthenticationA leaked client secret undermines API authentication and enables unauthorized token use.
API5 — Broken Function Level AuthorizationToken misuse after client-secret compromise can expose functions beyond intended application scope.
Recommendation — Harden API authentication flows so leaked client credentials cannot be reused casually. Enforce function-level authorization so tokens minted with client secrets cannot reach privileged operations.

Practitioner Guidance

Why practitioners should care: Treat client secrets as temporary authentication material, not as durable configuration. Their security value depends on tight storage, short lifespan, ownership, and rapid replacement when exposure is suspected.

Common misunderstanding: A client secret is often assumed to be “safe because it is server-side.” In reality, server-side placement only reduces exposure if the secret never enters code, logs, tickets, or shared infrastructure.

Practitioner takeaway: If you cannot confidently control where the secret exists and who can read it, the better design is usually to replace it with a stronger client-authentication method and reduce the trust carried by that application.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

NHIMG Editorial Note
Reviewed and updated by the NHIMG editorial team on October 31, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org