Entra ID sign-in error

AADSTS7000215: Invalid client secret

AADSTS7000215 means the client secret the app sent is not valid for its registration. Secret ID versus value, wrong pairing, deleted secrets and how to rotate.

Last updated Checked against Microsoft Learn on Look up another code

AADSTS7000215

App registrations and credentialsWho fixes it:App developerTenant admin

Invalid client secret is provided.

Microsoft's description, from the Microsoft Entra error code reference

What it means

The client secret the app sent does not match a valid secret on its app registration. Typical causes: the secret's ID sent instead of its value, a client ID paired with another app's secret, or a secret that has been deleted. Spaces or encoding damage when the secret is read from configuration have the same effect. An expired secret normally returns AADSTS7000222 instead, although one Microsoft article shows this code during an expiry problem.

Fix it: tenant admins

  1. In the Microsoft Entra admin center, open App registrations, select the app, then Certificates & secrets > Client secrets to see the secrets and their expiry dates.
  2. To create one, select New client secret, add a description, pick an expiry (24 months at most) and select Add. Copy the Value at once: it is never shown again.
  3. The Renew expiring application credentials recommendation in Microsoft Entra lists app registration credentials that expire within 30 days.

Fix it: app developers

  1. Check the app sends the secret's value, not the secret ID listed next to it.
  2. Check the client ID and the secret belong to the same app registration. Check too that the value has no extra spaces or line breaks once it is loaded from configuration or Key Vault.
  3. If the secret was deleted or nobody has the value, create a new one (below), update the app, test it, then remove the old secret.
  4. Where you can, use a certificate, a federated credential or a managed identity instead of a secret.

Related codes

Microsoft sources

Find who is hitting AADSTS7000215

Sign-in logs record the code without the AADSTS prefix: as status/errorCode in Microsoft Graph S04 and as ResultType in the SigninLogs table in Log Analytics S05. The SigninLogs and Microsoft Graph queries below cover interactive sign-ins. Non-interactive sign-ins are in the AADNonInteractiveUserSignInLogs table, which documents the error code in ResultSignature S41. If you query that table, test ResultType as well. For one failed sign-in, paste its error message into the lookup to get queries for its Correlation ID.

This code can also come from an app signing in as itself (client credentials), not from a person. Those sign-ins are in the AADServicePrincipalSignInLogs table, which documents the error code in ResultSignature S74; the query checks ResultSignature and ResultType.

Apps signing in as themselves (KQL), last 7 days

AADServicePrincipalSignInLogs
| where TimeGenerated > ago(7d) and (ResultType == "7000215" or ResultSignature == "7000215")
| summarize Failures = count(), Last = max(TimeGenerated) by ServicePrincipalName, AppId
| sort by Failures desc

Log Analytics (KQL), last 7 days

SigninLogs
| where TimeGenerated > ago(7d) and ResultType == "7000215"
| summarize Failures = count(), Last = max(TimeGenerated) by UserPrincipalName, AppDisplayName
| sort by Failures desc

Microsoft Graph PowerShell, last 7 days

Connect-MgGraph -Scopes "AuditLog.Read.All"
$since = (Get-Date).ToUniversalTime().AddDays(-7).ToString("yyyy-MM-ddTHH:mm:ssZ")
Get-MgAuditLogSignIn -Filter "status/errorCode eq 7000215 and createdDateTime ge $since" -All |
  Select-Object CreatedDateTime, UserPrincipalName, AppDisplayName, CorrelationId

Reading sign-in logs needs at least the Reports Reader role S06; the Graph call needs the AuditLog.Read.All permission S42, and -All returns every page of results S69.

Sources for this page

Microsoft's description is quoted from the Microsoft Entra error code reference; it is Microsoft's text and is not covered by our CC BY 4.0 licence. The cause and fix steps are our own wording, published under CC BY 4.0; each source below is the Microsoft page they rest on, with the passage we checked. Rules for every page are in the methodology.

  1. S01. Microsoft (Microsoft Learn), Microsoft Entra authentication and authorization error codes. Retrieved 2026-11-25.

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

    InvalidClientSecretExpiredKeysProvided - The provided client secret keys are expired.

    Error codes are subject to change at any time in order to provide more granular error messages

    Error codes and messages are subject to change. For the most current info, take a look at the

    You can also link directly to a specific error by adding the error code number to the URL

  2. S17. Microsoft (Microsoft Learn), Troubleshoot confidential client applications (MSAL.NET). Retrieved 2026-11-25.

    Verify the secret value (not the secret ID) is used in your configuration.

    Check that the secret hasn't expired in the Microsoft Entra admin center under Certificates & secrets.

  3. S27. Microsoft (Microsoft Learn), Add and manage application credentials in Microsoft Entra ID. Retrieved 2026-11-25.

    Select Certificates & secrets > Client secrets > New client secret.

    Client secret lifetime is limited to two years (24 months) or less.

    Record the client secret Value for use in your client application code. This secret value is never displayed again after you leave this page.

  4. S28. Microsoft (Microsoft Learn), Microsoft Entra recommendation: Renew expiring application credentials. Retrieved 2026-11-25.

    It's on an application registration AND is expiring within the next 30 days.

  5. S39. Microsoft (Microsoft Learn, Azure Kubernetes Service), Troubleshoot the BadRequest or InvalidClientSecret error. Retrieved 2026-11-25.

    The creation or credential-reset request supplies an incorrect secret or a mismatched client ID/secret pair. An existing cluster can also encounter this error if it still uses a credential deleted from Entra.

  6. S74. Microsoft (Microsoft Learn, Azure Monitor), Azure Monitor Logs reference: AADServicePrincipalSignInLogs. Retrieved 2026-11-25.

    Contains the error code, if any, for the sign-in operation

  7. S04. Microsoft (Microsoft Learn, Microsoft Graph), signIn resource type. Retrieved 2026-11-25.

    Supports $filter (eq) on errorCode property.

    The request ID sent from the client when the sign-in is initiated. Used to troubleshoot sign-in activity.

  8. S05. Microsoft (Microsoft Learn, Azure Monitor), Azure Monitor Logs reference - SigninLogs. Retrieved 2026-11-25.

    Provides the 5-6 digit error code that's generated during a sign-in event. 0 indicates success; other values are failures.

    The identifier that's sent from the client when sign-in is initiated.

  9. S06. Microsoft (Microsoft Learn), How to troubleshoot sign-in errors. Retrieved 2026-11-25.

    Reports Reader is the least privileged role required to access the activity logs.

    any user can access their own sign-ins from https://mysignins.microsoft.com.

  10. S41. Microsoft (Microsoft Learn, Azure Monitor), Azure Monitor Logs reference - AADNonInteractiveUserSignInLogs. Retrieved 2026-11-25.

    Contains the error code, if any, for the sign-in operation.

  11. S42. Microsoft (Microsoft Learn, Microsoft Graph), List signIns. Retrieved 2026-11-25.

    To avoid having the request time out, apply the $filter parameter with a time range for which to get all sign-ins

    Sign-ins that are interactive in nature

  12. S69. Microsoft (Microsoft Learn, Microsoft Graph PowerShell), Get-MgAuditLogSignIn (Microsoft.Graph.Reports). Retrieved 2026-11-25.

    -All List all pages.

Back to the AADSTS Error Code Lookup · All 351 codes