Skip to content

Commit aa5f662

Browse files
author
Simonx Xu
authored
Merge pull request #8828 from AmandaAZ/Branch-CI5501
AB#5501: Convert blog post to article
2 parents 53595ca + 4861801 commit aa5f662

File tree

2 files changed

+90
-11
lines changed

2 files changed

+90
-11
lines changed
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
---
2+
title: Microsoft Entra Applications Using TLS 1.0/1.1 Fail to Authenticate
3+
description: Provides solutions to authentication errors that occur with Microsoft Entra applications using TLS version 1.0 or 1.1.
4+
ms.reviewer: bachoang, v-weizhu
5+
ms.service: entra-id
6+
ms.date: 05/09/2025
7+
ms.custom: sap:Developing or Registering apps with Microsoft identity platform
8+
---
9+
# Microsoft Entra applications using TLS 1.0/1.1 fail to authenticate
10+
11+
This article provides solutions to authentication errors that occur with Microsoft Entra-integrated applications targeting versions earlier than Microsoft .NET Framework 4.7.
12+
13+
## Symptoms
14+
15+
Applications using an older version of the .NET Framework might encounter authentication failures with one of the following error messages:
16+
17+
- > AADSTS1002016: You are using TLS version 1.0, 1.1 and/or 3DES cipher which are deprecated to improve the security posture of Azure AD
18+
19+
- > IDX20804: Unable to retrieve document from: '[PII is hidden]'
20+
21+
- > IDX20803: Unable to obtain configuration from: '[PII is hidden]'
22+
23+
- > IDX10803: Unable to create to obtain configuration from: 'https://login.microsoftonline.com/{Tenant-ID}/.well-known/openid-configuration'
24+
25+
- > IDX20807: Unable to retrieve document from: 'System.String'
26+
27+
- > System.Net.Http.Headers.HttpResponseHeaders RequestMessage {Method: POST, RequestUri: '\<request-uri>', Version: 1.1, Content: System.Net.Http.FormUrlEncodedContent, Headers: { Content-Type: application/x-www-form-urlencoded Content-Length: 970 }} System.Net.Http.HttpRequestMessage StatusCode UpgradeRequired This service requires use of the TLS-1.2 protocol
28+
29+
## Cause
30+
31+
Starting January 31, 2022, Microsoft enforced the use of the TLS 1.2 protocol for client applications connecting to Microsoft Entra services on the Microsoft Identity Platform to ensure compliance with security and industry standards. For more information about this change, see [Enable support for TLS 1.2 in your environment for Microsoft Entra TLS 1.1 and 1.0 deprecation](../ad-dmn-services/enable-support-tls-environment.md) and [Act fast to secure your infrastructure by moving to TLS 1.2!](https://techcommunity.microsoft.com/blog/microsoft-entra-blog/act-fast-to-secure-your-infrastructure-by-moving-to-tls-1-2/2967457)
32+
33+
Applications running on older platforms or using older .NET Framework versions might not have TLS 1.2 enabled. Therefore, they can't retrieve the OpenID Connect metadata document, resulting in failed authentication.
34+
35+
## Solution 1: Upgrade the .NET Framework
36+
37+
Upgrade the application to use .NET Framework 4.7 or later, where TLS 1.2 is enabled by default.
38+
39+
## Solution 2: Enable TLS 1.2 programmatically
40+
41+
If upgrading the .NET Framework isn't feasible, you can enable TLS 1.2 by adding the following code to the **Global.asax.cs** file in your application:
42+
43+
```csharp
44+
using System.Net;
45+
46+
protected void Application_Start()
47+
{
48+
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Ssl3; // only allow TLS 1.2 and SSL 3
49+
// The rest of your startup code goes here
50+
}
51+
```
52+
53+
## Solution 3: Change web.config to enable TLS 1.2
54+
55+
If .NET Framework 4.7.2 is available, you can enable TLS 1.2 by adding the following configuration to the **web.config** file:
56+
57+
```json
58+
<system.web>
59+
    <httpRuntime targetFramework="4.7.2" />
60+
</system.web>
61+
```
62+
63+
> [!NOTE]
64+
> If using .NET Framework 4.7.2 causes breaking changes to your app, this solution might not work.
65+
66+
## Solution 4: Enable TLS 1.2 before running PowerShell commands
67+
68+
If you encounter the AADSTS1002016 error while running the PowerShell command `Connect-MSolService`, `Connect-AzureAD`, or `Connect-MSGraph` (from the Microsoft Intune PowerShell SDK module), set the security protocol to TLS 1.2 before executing the commands:
69+
70+
```powershell
71+
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
72+
```
73+
74+
## References
75+
76+
[Transport Layer Security (TLS) best practices with .NET Framework](/dotnet/framework/network-programming/tls)
77+
78+
[!INCLUDE [Azure Help Support](../../../includes/azure-help-support.md)]

support/entra/entra-id/toc.yml

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -51,25 +51,26 @@
5151
items:
5252
- name: 401 Unauthorized errors in ASP.NET Core Web API
5353
href: app-integration/401-unauthorized-aspnet-core-web-api.md
54-
- name: Cookies are disabled error in MSAL.Net XBAP application
55-
href: app-integration/script-errors-running-msal-net-xbap-app.md
56-
- name: IDX10501 Error in ASP.NET Core with Azure B2C Custom Policy
57-
href: app-integration/troubleshoot-error-idx10501-aspnet-b2c.md
54+
- name: Applications using TLS 1.0/1.1 fail to authenticate
55+
href: app-integration/application-using-tls-1dot0-1dot1-authentication-fail.md
5856
- name: Authentication fails after Android app is published to Google Play Store
5957
href: app-integration/android-app-authentication-fails-after-published-to-google-play-store.md
60-
- name: WIF10201 No valid key mapping found
61-
href: app-integration/troubleshoot-wif10201-no-validkey-securitytoken-mvc.md
62-
- name: Package Inspector for MSAL Android Native
63-
href: app-integration/package-inspector-msal-android-native.md
58+
- name: Cookies are disabled error in MSAL.Net XBAP application
59+
href: app-integration/script-errors-running-msal-net-xbap-app.md
6460
- name: Enable MSAL4J logging in a Spring Boot web application
6561
href: app-integration/enable-msal4j-logging-spring-boot-webapp.md
66-
- name: Repeated login prompts in iOS MSAL implementation
67-
href: app-integration/repeat-login-prompts-in-msal-ios-app.md
6862
- name: Error AADSTS7000218 - Invalid client
6963
href: app-integration/confidential-client-application-authentication-error-aadsts7000218.md
64+
- name: IDX10501 Error in ASP.NET Core with Azure B2C Custom Policy
65+
href: app-integration/troubleshoot-error-idx10501-aspnet-b2c.md
7066
- name: Infinite sign-in loop issue with ASP.NET applications
7167
href: app-integration/asp-dot-net-application-infinite-sign-in-loop.md
72-
68+
- name: Package Inspector for MSAL Android Native
69+
href: app-integration/package-inspector-msal-android-native.md
70+
- name: Repeated login prompts in iOS MSAL implementation
71+
href: app-integration/repeat-login-prompts-in-msal-ios-app.md
72+
- name: WIF10201 No valid key mapping found
73+
href: app-integration/troubleshoot-wif10201-no-validkey-securitytoken-mvc.md
7374

7475
- name: Troubleshoot adding apps
7576
href: app-integration/troubleshoot-adding-apps.md

0 commit comments

Comments
 (0)