Skip to content

Commit 5220d1a

Browse files
authored
Updates from editor
1 parent 6f20d31 commit 5220d1a

1 file changed

Lines changed: 24 additions & 24 deletions

File tree

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
2-
title: Invalid client error (AADSTS7000218) when authenticating to Microsoft Entra ID
2+
title: Invalid Client Error AADSTS7000218 When Authenticating to Microsoft Entra ID
33
description: Provides a solution to the AADSTS7000218 error when a confidential client application authenticates to Microsoft Entra ID.
4-
ms.date: 04/23/2025
4+
ms.date: 04/25/2025
55
ms.reviewer: bachoang, v-weizhu
66
ms.service: entra-id
77
ms.custom: sap:Developing or Registering apps with Microsoft identity platform
@@ -26,70 +26,70 @@ When a confidential client application authenticates to Microsoft Entra ID to ge
2626

2727
## Cause
2828

29-
This issue occurs because the application doesn't provide its credential (a client secret or a client assertion) as expected by the token endpoint. A confidential client must provide its credential when authenticating to Microsoft Entra ID.
29+
This issue occurs because the application doesn't provide the credentials (client secret or assertion) that the token endpoint expects. A confidential client must provide its credentials when authenticating to Microsoft Entra ID.
3030

3131
## Resolution
3232

33-
To resolve this issue, include the client secret or client assertion in the token request.
33+
To resolve this issue, include the client secret or assertion in the token request.
3434

35-
In some authentication flow scenarios such as [OAuth 2 Resource Owner Password Credentials (ROPC)](/entra/identity-platform/v2-oauth-ropc) grant flow or [OAuth 2 device authorization grant flow](/entra/identity-platform/v2-oauth2-device-code) where you don't expect the client application to be confidential, allow public client flows in the **App registrations**:
35+
In some authentication flow scenarios, such as the [OAuth 2 Resource Owner Password Credentials (ROPC)](/entra/identity-platform/v2-oauth-ropc) grant flow or [OAuth 2 device authorization grant flow](/entra/identity-platform/v2-oauth2-device-code), where you don't expect the client application to be confidential, allow public client flows in the **App registrations**:
3636

3737
1. In the [Azure portal](https://portal.azure.com/), in **App registrations**, select your application, and then select **Authentication**.
3838
2. Select **Advanced settings** > **Allow public client flows**.
3939
3. For **Enable the following mobile and desktop flows**, select **Yes**.
4040

41-
:::image type="content" source="media/confidential-client-application-authentication-error-aadsts7000218/allow-public-client-flows.png" alt-text="Screenshot that shows the 'Enable the following mobile and desktop flows' option" lightbox="media/confidential-client-application-authentication-error-aadsts7000218/allow-public-client-flows.png":::
41+
:::image type="content" source="media/confidential-client-application-authentication-error-aadsts7000218/allow-public-client-flows.png" alt-text="Screenshot that shows the 'Enable the following mobile and desktop flows' option." lightbox="media/confidential-client-application-authentication-error-aadsts7000218/allow-public-client-flows.png":::
4242

43-
Changing the default client type from confidential to public causes security implications. For more information, see [Whats the security implication of changing the default client type from confidential to public in Azure AD?](https://blogs.aaddevsup.xyz/2020/09/whats-the-security-implication-of-changing-the-default-client-type-from-confidential-to-public-in-azure-ad/)
43+
Changing the default client type from confidential to public causes security implications. For more information, see [What's the security implication of changing the default client type from confidential to public in Azure AD?](https://blogs.aaddevsup.xyz/2020/09/whats-the-security-implication-of-changing-the-default-client-type-from-confidential-to-public-in-azure-ad/)
4444

4545
## Understand client types in Microsoft Entra ID
4646

47-
As defined in the [OAuth 2.0 specifications](https://tools.ietf.org/html/rfc6749), client applications are categorized into two types:
47+
As defined in the [OAuth 2.0 specification](https://tools.ietf.org/html/rfc6749), client applications are categorized into two types:
4848

49-
- Confidential client: A client who is able to securely store a secret used to authenticate to Microsoft Entra ID.
49+
- Confidential client: A client that can securely store a secret used to authenticate to Microsoft Entra ID.
5050

51-
For example: The client is a web application where its code and secret are stored on a server that’s not exposed to the public. The application's confidential information can only be accessed by an admin.
51+
For example, the client is a web application whose code and secrets are stored on a server that isn't exposed to the public. Only an admin can access the application's confidential information.
5252
- Public client: A client that can't store any secret.
5353

54-
For example: A public client is a mobile application or desktop application running in an insecure or unmanaged environment.
54+
For example, a public client is a mobile or desktop application running in an insecure or unmanaged environment.
5555

56-
In the Microsoft Entra App Registration model, a registered application can be both a public client and a confidential client, depending on the context the application is used in. This is because an application might have part of it used as a public client while some other parts are designed to be used as a confidential client.  Depending on workflows, the application developer must decide if the application should act as a public or confidential client. A confidential client is expected in certain OAuth2 grant flows such as Client Credentials flow, Authorization Code flow, or On-Behalf-Of flow. It uses a flow to request a token.
56+
In the Microsoft Entra App Registration model, a registered application can be both a public client and a confidential client, depending on the context in which the application is used. This is because an application might have a part used as a public client, while other parts are designed to be used as a confidential client. Depending on workflows, the application developer must decide if the application should act as a public or confidential 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. It uses a flow to request a token.
5757

5858
## How Microsoft Entra ID determines the client type
5959

6060
- Method 1: Use the type of the redirect URI (reply URL)
6161

6262
Microsoft Entra ID checks the redirect URI (reply URL) provided in the request and cross-checks it with the redirect URI registered in the App Registrations.
63-
- A **Web** type redirect URI classifies the application as a confidential client.
63+
- A redirect URI of type **Web** classifies the application as a confidential client.
6464

65-
:::image type="content" source="media/confidential-client-application-authentication-error-aadsts7000218/web-client-type.png" alt-text="Screenshot that shows a Web type redirect URI" lightbox="media/confidential-client-application-authentication-error-aadsts7000218/web-client-type.png":::
66-
- A **Mobile and desktop applications** type redirect URI classifies the application as a public client.
65+
:::image type="content" source="media/confidential-client-application-authentication-error-aadsts7000218/web-client-type.png" alt-text="Screenshot that shows a Web-type redirect URI." lightbox="media/confidential-client-application-authentication-error-aadsts7000218/web-client-type.png":::
66+
- A redirect URI of type **Mobile and desktop applications** classifies the application as a public client.
6767

68-
:::image type="content" source="media/confidential-client-application-authentication-error-aadsts7000218/public-client-type.png" alt-text="Screenshot that shows a public type redirect URI" lightbox="media/confidential-client-application-authentication-error-aadsts7000218/public-client-type.png":::
68+
:::image type="content" source="media/confidential-client-application-authentication-error-aadsts7000218/public-client-type.png" alt-text="Screenshot that shows a public-type redirect URI." lightbox="media/confidential-client-application-authentication-error-aadsts7000218/public-client-type.png":::
6969

7070
- Method 2: Use the **Enable the following mobile and desktop flows** option (when no reply URL is provided)
7171

72-
In some OAuth 2.0 flows, such as the [OAuth 2 Resource Owner Password Credentials (ROPC)](/azure/active-directory/develop/v2-oauth-ropc) grant flow, [OAuth 2 device authorization grant flow](/entra/identity-platform/v2-oauth2-device-code) and Integrated Windows Authentication, there is no reply URL provided in the token request. In these cases, Microsoft Entra ID uses the app registration's **Enable the following mobile and desktop flows** to determine whether the client is confidential or public.
72+
In some OAuth 2.0 flows, such as the [OAuth 2 Resource Owner Password Credentials (ROPC)](/azure/active-directory/develop/v2-oauth-ropc) grant flow, [OAuth 2 device authorization grant flow](/entra/identity-platform/v2-oauth2-device-code) and Integrated Windows Authentication, no reply URL is provided in the token request. In these cases, Microsoft Entra ID uses the app registration's **Enable the following mobile and desktop flows** to determine whether the client is confidential or public.
7373

7474
- If **Enable the following mobile and desktop flows** is set to **Yes**, the client is public.
7575
- If it's set to **No**, the client is confidential.
7676

7777
### How to identify the grant type and redirect URI used by an application
7878

79-
Review the application code or capture a [Fiddler](https://blogs.aaddevsup.xyz/2018/09/capture-https-traffic-with-http-fiddler/) trace to inspect the grant_type and redirect_uri parameters sent in the POST request to Microsoft Entra ID's token endpoint:
79+
Review the application code or capture a [Fiddler](https://blogs.aaddevsup.xyz/2018/09/capture-https-traffic-with-http-fiddler/) trace to inspect the `grant_type` and `redirect_uri` parameters sent in the POST request to the Microsoft Entra ID's token endpoint:
8080

8181
- V1 endpoint: `https://login.microsoftonline.com/<tenant name>/oauth2/token`
8282
- V2 endpoint: `https://login.microsoftonline.com/<tenant name>/oauth2/v2.0/token`
8383

84-
Here's an example of Fiddler trace:
84+
Here's an example of a Fiddler trace:
8585

86-
:::image type="content" source="media/confidential-client-application-authentication-error-aadsts7000218/post-request.png" alt-text="Screenshot hat shwos a POST request in Fiddler" lightbox="media/confidential-client-application-authentication-error-aadsts7000218/post-request.png":::
86+
:::image type="content" source="media/confidential-client-application-authentication-error-aadsts7000218/post-request.png" alt-text="Screenshot that shows a POST request in Fiddler.":::
8787

88-
:::image type="content" source="media/confidential-client-application-authentication-error-aadsts7000218/grant-type.png" alt-text="Screenshot that shows a grant type" lightbox="media/confidential-client-application-authentication-error-aadsts7000218/grant-type.png":::
88+
:::image type="content" source="media/confidential-client-application-authentication-error-aadsts7000218/grant-type.png" alt-text="Screenshot that shows a grant type.":::
8989

90-
Common OAuth 2.0 flows and their associated `grant_type` values are listed below:
90+
Common OAuth 2.0 flows and their associated `grant_type` values are listed as follows:
9191

92-
| OAuth 2.0 flow | grant_typevalue |
92+
| OAuth 2.0 flow | grant_type value |
9393
| --- | --- |
9494
| [ROPC](/entra/identity-platform/v2-oauth-ropc) | `password` |
9595
| [Device Code](/entra/identity-platform/v2-oauth2-device-code) | `urn:ietf:params:oauth:grant-type:device_code` |
@@ -100,6 +100,6 @@ Common OAuth 2.0 flows and their associated `grant_type` values are listed below
100100

101101
## References
102102

103-
- [Microsoft Authentication Library (MSAL) Client Applications](https://github.com/AzureAD/microsoft-authentication-library-for-dotnet/wiki/Client-Applications)
103+
[Microsoft Authentication Library (MSAL) Client Applications](https://github.com/AzureAD/microsoft-authentication-library-for-dotnet/wiki/Client-Applications)
104104

105105
[!INCLUDE [Azure Help Support](../../../includes/azure-help-support.md)]

0 commit comments

Comments
 (0)