What the error means
AADSTS7000218 is a Microsoft Entra ID error returned together with invalid_client. The full message reads "The request body must contain the following parameter: 'client_assertion' or 'client_secret'", and the response lists 7000218 under error_codes. It appears when an application requests an access token from the token endpoint and the request does not carry any credential.
Microsoft's article describes the situation as a confidential client application authenticating to Microsoft Entra ID. A confidential client is expected to prove who it is, with a client secret or a client assertion, every time it asks for a token. If the token request arrives without either one, Microsoft Entra ID rejects it with this error.
This page is for developers and administrators who see the error in an application log, a script or an integration. It is not a typical end-user sign-in problem, because the failing step is the token request sent by the app rather than a password prompt in the browser.
Common causes
Microsoft documents one cause with two forms.
- The application does not provide the credentials, a client secret or an assertion, that the token endpoint expects. A confidential client must provide them when it authenticates.
- The application is treated as confidential even though the flow was never meant to use a secret. In flows such as the OAuth 2 resource owner password credentials (ROPC) grant or the OAuth 2 device authorization grant, no redirect URI is sent, so Microsoft Entra ID looks at the app registration setting "Enable the following mobile and desktop flows". When it is set to No, the client is classed as confidential and a secret is demanded.
How to fix it
1. Include the client secret or assertion in the token request
Microsoft's resolution is to include the client secret or assertion in the token request. Check the code or configuration of the application that calls the token endpoint and confirm it sends client_secret or client_assertion in the request body. If the secret is stored in a configuration file, a key vault reference or a pipeline variable, make sure that value is actually being read and is not empty.
2. Identify the flow, grant type and redirect URI the app uses
Microsoft explains how to see what the application really sends: review the application code, or capture a Fiddler trace, and inspect the grant_type and redirect_uri parameters in the POST request to the token endpoint. The endpoints are:
V1: https://login.microsoftonline.com/<tenant name>/oauth2/token
V2: https://login.microsoftonline.com/<tenant name>/oauth2/v2.0/tokenMicrosoft lists these common grant types: password for ROPC, urn:ietf:params:oauth:grant-type:device_code for device code, authorization_code for authorization code, client_credentials for client credentials, urn:ietf:params:oauth:grant-type:jwt-bearer for on-behalf-of, and urn:ietf:params:oauth:grant-type:saml1_1-bearer for SAML bearer assertion. Client credentials, authorization code and on-behalf-of are flows where a confidential client is expected.
3. Allow public client flows when the app should not be confidential
For flows such as ROPC or device authorization, where the client application is not expected to be confidential, Microsoft documents this change in the app registration:
- In the Azure portal, open App registrations, select the application, then select Authentication.
- Select Advanced settings, then Allow public client flows.
- For "Enable the following mobile and desktop flows", select Yes.
Read the security note first. Microsoft states that changing the default client type from confidential to public causes security implications, and points to its public client and confidential client documentation.
4. Check the redirect URI type
This is a general step that follows from how Microsoft says the client type is decided. A redirect URI of type Web classifies the app as a confidential client, and one of type Mobile and desktop applications classifies it as public. If the request includes a redirect URI, compare it with the type registered in the app registration, because a mismatch changes which credentials are expected.
If nothing works
Collect the trace ID, correlation ID and timestamp from the error response, plus the grant_type and redirect_uri values the app sends. Those details let a Microsoft support engineer or your identity team match the failed request in the sign-in logs. Related codes on this site, such as AADSTS7000215 and AADSTS700016, cover other client credential and application problems.
What we checked
One Microsoft Learn troubleshooting article was read on 2026-11-22: the article on error AADSTS7000218 when a confidential client application authenticates to Microsoft Entra ID. It gives the full error message, states the cause as missing client credentials, and describes the resolution of adding the secret or assertion or allowing public client flows. It also explains how Microsoft Entra ID decides between public and confidential clients and lists the grant type values. The error was not reproduced for this page. Step 4 is a general step.
Last checked: 2026-11-22.