# AADSTS7000215: Invalid client secret is provided

Canonical: https://brambrinkmeier.com/entra/aadsts/7000215/
By Bram Brinkmeier. JSON: https://brambrinkmeier.com/api/aadsts/7000215.json

**Short answer:** AADSTS7000215 means an app or service principal sent a client secret that Microsoft Entra ID didn't accept. Usually it is a developer or rotation mistake. The security signal is repeated failures for one app ID from an IP you don't own, which suggests someone trying a leaked or old secret. Hunt it in AADServicePrincipalSignInLogs.

**Fix:** Developer: send the current secret for the right app registration and tenant. Admin: after a rotation, find every IP still failing for the app and update those systems. If failures come from an IP you don't own, create a new credential and remove the old secrets from the app registration.

| Field | Value |
|---|---|
| Code | AADSTS7000215 |
| Microsoft name | Invalid client secret |
| Category | App configuration |
| Type | Failure |
| Attack signal | Medium: worth a look in context |
| MITRE ATT&CK | [T1078.004](https://attack.mitre.org/techniques/T1078/004/) Valid Accounts: Cloud Accounts |
| Where to look | `AADServicePrincipalSignInLogs` |
| In Microsoft's error reference | Yes |
| Verification | lab-reproduced (2026-10-30) |
| Last updated | 2026-10-30 |

## What does AADSTS7000215 mean?

Microsoft's description:

> Invalid client secret is provided. Developer error - the app is attempting to sign in without the necessary or correct authentication parameters.

The reference table gives this code no PascalCase name. Two siblings help you tell the cases apart:

- **[7000222](https://brambrinkmeier.com/entra/aadsts/7000222/) InvalidClientSecretExpiredKeysProvided**: *"The provided client secret keys are expired. Create new keys for your app, or consider using certificate credentials for added security"*
- **7000218**: *"The request body must contain the following parameter: 'client_assertion' or 'client_secret'."*

So 7000222 means the secret was right but expired, 7000218 means no secret or assertion was sent at all, and 7000215 means a secret was sent and it was wrong.

## Reproduced in the lab

On 30 October 2026 an automated lab run created an app registration with a client secret, then sent a client-credentials request with a made-up secret. Entra returned `AADSTS7000215`:

> AADSTS7000215: Invalid client secret provided. Ensure the secret being sent in the request is the client secret value, not the client secret ID, for a secret added to app '<app id>'.

A control request in the same run, with the real secret, returned a token. So this code means the secret itself is wrong, not that the app or the tenant is misconfigured.

The sign-in log row isn't captured yet; see [how pages are checked](https://brambrinkmeier.com/methodology/).

## Is it an attack?

Usually not. Microsoft labels it a developer error, and most 7000215 comes from a typo in configuration or a system that still holds a secret you rotated. The security reading depends on where the requests come from.

| Pattern | Likely meaning |
|---|---|
| 7000215 for one app from your own servers or build agents, starting right after a secret rotation | A system still holding the old secret. Benign, but it tells you exactly which systems to update. |
| 7000215 for one app from an IP you don't own and have never seen succeed for that app | Someone trying a secret for your app from outside. A leaked or old secret is the likely source. Investigate. |
| 7000215 followed by a success (`ResultType` `"0"`) for the same app from the same unknown IP | The attacker found a working secret. Treat the app as compromised. |
| 7000215 spread across many app IDs from one IP | Someone testing a set of credentials against your tenant. Investigate the source. |

## How do I find it in my logs (KQL)?

Failures by app and source IP:

```kusto
AADServicePrincipalSignInLogs
| where TimeGenerated > ago(7d)
| where ResultType == "7000215"
| summarize Attempts = count(),
            FirstSeen = min(TimeGenerated),
            LastSeen = max(TimeGenerated),
            KeyIds = make_set(ServicePrincipalCredentialKeyId, 10)
          by AppId, ServicePrincipalName, IPAddress
| sort by Attempts desc
```

Failures from IPs that never had a success for the same app in the last 30 days:

```kusto
let knownAppIPs =
    AADServicePrincipalSignInLogs
    | where TimeGenerated > ago(30d)
    | where ResultType == "0"
    | distinct AppId, IPAddress;
AADServicePrincipalSignInLogs
| where TimeGenerated > ago(1d)
| where ResultType == "7000215"
| join kind=leftanti knownAppIPs on AppId, IPAddress
| summarize Attempts = count(), LastSeen = max(TimeGenerated) by AppId, ServicePrincipalName, IPAddress
| sort by Attempts desc
```

Any IP from that list that later succeeds for the same app:

```kusto
let failedFrom =
    AADServicePrincipalSignInLogs
    | where TimeGenerated > ago(7d)
    | where ResultType == "7000215"
    | summarize FirstFail = min(TimeGenerated) by AppId, IPAddress;
AADServicePrincipalSignInLogs
| where TimeGenerated > ago(7d)
| where ResultType == "0"
| join kind=inner failedFrom on AppId, IPAddress
| where TimeGenerated > FirstFail
| project TimeGenerated, AppId, ServicePrincipalName, IPAddress, ServicePrincipalCredentialKeyId, FirstFail
| sort by TimeGenerated asc
```

Check two things in your own workspace before relying on these queries:

- The Azure Monitor reference for `AADServicePrincipalSignInLogs` describes `ResultType` as *"Success or Failure"*, while the user sign-in tables document it as the numeric error code as a string. Look at a few failed rows and confirm they carry `"7000215"` and that successes carry `"0"`. If they don't, filter on `ResultSignature` (*"Contains the error code, if any, for the sign-in operation"*) instead.
- Whether `ServicePrincipalCredentialKeyId` is filled in on a **failed** secret isn't documented. A wrong secret may not match any key, so the column may be empty. On successes it tells you which credential was used.

## How does Conditional Access affect it?

- A service principal using a client secret has no MFA step.
- 7000215 is a failed credential check. For user sign-ins, Conditional Access only evaluates after the first factor succeeds; the same logic suggests no policy was evaluated here. That is reasoning from the user case, not a documented statement for service principals.
- So the controls that matter are on the credential itself: who can read it, where it is stored, and whether it is a secret at all.

## How do I fix AADSTS7000215?

**For developers:** check that the app sends the current secret for the right app registration and tenant. If the secret expired, you get [7000222](https://brambrinkmeier.com/entra/aadsts/7000222/), not 7000215.

**For admins:**
1. After a rotation, use the first query to list every IP still failing for that app, and update those systems.
2. If failures come from an IP you don't own, treat the app's existing secrets as exposed: create a new credential, remove the old ones from the app registration, and update your own systems.
3. If the third query returns a row, the app was used by someone else. Review what the app's permissions allow and what it accessed after that time.
4. Follow Microsoft's own hint in the 7000222 message and *"consider using certificate credentials for added security"*.

## Evidence

Reproduced in a lab tenant on 2026-10-30 (Client-credentials token request against a lab tenant; scenario: Wrong client secret). First line returned:

> AADSTS7000215: Invalid client secret provided. Ensure the secret being sent in the request is the client secret value, not the client secret ID, for a secret added to app '<app id>'.

Lab-run rows naming this code (7; full list at https://brambrinkmeier.com/lab-runs.json):

| Date | Scenario | Expected | Got | Message (first line) |
|---|---|---|---|---|
| 2026-10-30 | Wrong client secret | 7000215 | 7000215 | AADSTS7000215: Invalid client secret provided. Ensure the secret being sent in the request is the client secret value, not the client secret ID, for a secret ad |
| 2026-10-30 | Wrong client secret | 7000215 | 7000215 | AADSTS7000215: Invalid client secret provided. Ensure the secret being sent in the request is the client secret value, not the client secret ID, for a secret ad |
| 2026-10-30 | Wrong client secret | 7000215 | 7000215 | AADSTS7000215: Invalid client secret provided. Ensure the secret being sent in the request is the client secret value, not the client secret ID, for a secret ad |
| 2026-10-31 | Device code redeemed with a different client ID | 70016 / 7000215 / 70002 | 90023 | AADSTS90023: ClientId passed in the request doesn't match the one in cache |
| 2026-10-31 | Wrong client secret | 7000215 | 7000215 | AADSTS7000215: Invalid client secret provided. Ensure the secret being sent in the request is the client secret value, not the client secret ID, for a secret ad |
| 2026-10-31 | Device code redeemed with a different client ID | 70016 / 7000215 / 70002 | 90023 | AADSTS90023: ClientId passed in the request doesn't match the one in cache |
| 2026-10-31 | Wrong client secret | 7000215 | 7000215 | AADSTS7000215: Invalid client secret provided. Ensure the secret being sent in the request is the client secret value, not the client secret ID, for a secret ad |

## Sources

1. [Microsoft Entra authentication and authorization error codes](https://learn.microsoft.com/en-us/entra/identity-platform/reference-error-codes)
2. [AADServicePrincipalSignInLogs table reference (Azure Monitor)](https://learn.microsoft.com/en-us/azure/azure-monitor/reference/tables/aadserviceprincipalsigninlogs)

## Related codes

[AADSTS7000222](https://brambrinkmeier.com/entra/aadsts/7000222/), [AADSTS700016](https://brambrinkmeier.com/entra/aadsts/700016/), [AADSTS500011](https://brambrinkmeier.com/entra/aadsts/500011/), [AADSTS65001](https://brambrinkmeier.com/entra/aadsts/65001/), [AADSTS70002](https://brambrinkmeier.com/entra/aadsts/70002/), [AADSTS700024](https://brambrinkmeier.com/entra/aadsts/700024/), [AADSTS900144](https://brambrinkmeier.com/entra/aadsts/900144/), [AADSTS5002730](https://brambrinkmeier.com/entra/aadsts/5002730/), [AADSTS7000110](https://brambrinkmeier.com/entra/aadsts/7000110/), [AADSTS7000112](https://brambrinkmeier.com/entra/aadsts/7000112/), [AADSTS7000216](https://brambrinkmeier.com/entra/aadsts/7000216/), [AADSTS7000218](https://brambrinkmeier.com/entra/aadsts/7000218/), [AADSTS9002313](https://brambrinkmeier.com/entra/aadsts/9002313/), [AADSTS9002326](https://brambrinkmeier.com/entra/aadsts/9002326/)

## License and citation

CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). CC BY 4.0 covers the author's own text and classification fields. Quoted Microsoft error wording belongs to Microsoft, is quoted with its source and can change.

Cite as: Bram Brinkmeier, "AADSTS7000215: Invalid client secret is provided", https://brambrinkmeier.com/entra/aadsts/7000215/ (CC BY 4.0), last updated 2026-10-30.
