Entra ID sign-in error

AADSTS7000218: Token request has no client secret or assertion

AADSTS7000218 means a confidential client asked for a token without a client secret or certificate assertion. Why Entra sees it as confidential and the fix.

Last updated Checked against Microsoft Learn on Look up another code

AADSTS7000218

App registrations and credentialsWho fixes it:App developer

The request body must contain the following parameter: 'client_assertion' or 'client_secret'.

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

What it means

The token request came from an app that Microsoft Entra ID treats as a confidential client, but it carried no client secret or client assertion. A redirect URI of type Web makes an app a confidential client; mobile and desktop redirect URIs make it a public client. Without a redirect URI (device code or ROPC), the Allow public client flows setting decides.

Fix it: app developers

  1. Work out which flow the app uses. Check the grant_type and redirect_uri it sends to the /oauth2/v2.0/token endpoint, in the code or a network trace.
  2. Web app, web API or background service (authorization code, client credentials or on-behalf-of flow): add the client secret or the client assertion (certificate) to the token request. These flows expect a confidential client, so do not turn on public client flows for them.
  3. Desktop or mobile app that cannot keep a secret: check its redirect URI is registered as Mobile and desktop applications, not Web. A redirect URI of type Web makes Microsoft Entra ID expect a secret.
  4. Device code flow or ROPC, which send no redirect URI: only here, the app registration owner can set Authentication > Advanced settings > Allow public client flows to Yes. Microsoft warns that changing a confidential client to public has security implications. A public client holds no secret, so leave the setting off for any app that can keep one.

Related codes

Microsoft sources

Find who is hitting AADSTS7000218

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 == "7000218" or ResultSignature == "7000218")
| 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 == "7000218"
| 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 7000218 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. S29. Microsoft (Microsoft Learn), Error AADSTS7000218 for a confidential client application. Retrieved 2026-11-25.

    A redirect URI of type Mobile and desktop applications classifies the application as a public client.

    A confidential client is expected in certain OAuth2 grant flows, such as the Client Credentials flow, Authorization Code flow, or On-Behalf-Of flow.

    Public client: A client that can't store any secret.

    This issue occurs because the application doesn't provide the credentials (client secret or assertion) that the token endpoint expects.

    To resolve this issue, include the client secret or assertion in the token request.

    A redirect URI of type Web classifies the application as a confidential client.

    Select Advanced settings > Allow public client flows.

    Changing the default client type from confidential to public causes security implications.

  2. 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

  3. 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.

  4. 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.

  5. 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.

  6. 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.

  7. 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

  8. 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