Skip to content

Commit 49cb064

Browse files
authored
Merge pull request #8804 from MicrosoftDocs/main
Auto push to live 2025-04-25 10:02:02
2 parents 8004527 + e45f0ea commit 49cb064

File tree

6 files changed

+260
-2
lines changed

6 files changed

+260
-2
lines changed

support/azure/virtual-machines/linux/support-linux-open-source-technology.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Describes support for Linux distributions and open-source technolog
44
ms.service: azure-virtual-machines
55
ms.custom: sap:VM Admin - Linux (Guest OS), linux-related-content
66
ms.topic: article
7-
ms.date: 03/28/2025
7+
ms.date: 04/25/2025
88
ms.reviewer: patcatun, clausw, divargas, rondom, azurevmlnxcic, v-weizhu
99
---
1010

@@ -35,6 +35,8 @@ Microsoft Azure supports the [Linux operating system](https://azure.microsoft.co
3535
Microsoft Support provides assistance for the Azure platform or services. Microsoft also provides commercially viable support for Linux. A support plan is required to receive Microsoft Support.
3636

3737
- Azure Marketplace offers various Linux distributions. Microsoft provides support for Linux customers, but they might need to work with specific Linux vendors for further assistance. These vendors might be required to deliver distribution-specific fixes.
38+
- **Red Hat and SUSE PAYG images:** Microsoft Support manages the first levels of Linux support and will engage the vendor if required.
39+
- **Red Hat and SUSE BYOS images**: Customers might contact the vendor directly for support. The vendor is primarily responsible for Linux support; however, Microsoft can provide additional assistance if required.
3840
- In Azure Marketplace, you may select a highly customized Linux image, such as a firewall appliance. Microsoft provides assistance for these images, but the Linux vendor must be engaged to troubleshoot specific system-related problems. Microsoft may collaborate with the vendor for those issues.
3941
- Microsoft Support doesn't assist customers for basic Linux administration, design, architecture, or deployment of applications or solutions on Azure.
4042
- The ability to customize Linux is one of the hallmarks of the operating system. We encourage you to use a Linux solution that benefits your organization. However, the Linux vendor may not support some modifications, such as custom kernels or modules. For vendor support, you may be required to use stock kernels or libraries for your image.
Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
---
2+
title: Infinite Sign-in Loop Between ASP.NET Application and Microsoft Entra ID
3+
description: Helps you resolve an infinite sign-in loop issue between an ASP.NET application and with Microsoft Entra ID when performing sign in.
4+
ms.date: 04/25/2025
5+
ms.reviewer: bachoang, v-weizhu
6+
ms.service: entra-id
7+
ms.custom: sap:Developing or Registering apps with Microsoft identity platform
8+
---
9+
10+
# Infinite sign-in loop between ASP.NET application and Microsoft Entra ID
11+
12+
This article provides solutions to an issue where an ASP.NET application experiences an infinite redirect loop during signing in with Microsoft Entra ID.
13+
14+
## Symptoms
15+
16+
An ASP.NET application running an earlier version of Open Web Interface for .NET (OWIN) middleware fails to recognize an authenticated request from Microsoft Entra ID. It keeps sending the request back to Microsoft Entra ID for signing in, leading to the infinite loop issue. The following error message might be displayed in the browser:
17+
18+
> We couldn't sign you in. Please try again.
19+
20+
## Cause
21+
22+
This issue occurs due to a cookie mismanagement issue (a [known Katana bug](https://github.com/aspnet/AspNetKatana/wiki/System.Web-response-cookie-integration-issues)) in the earlier version of OWIN.
23+
24+
### How to recognize the Katana bug
25+
26+
Capture a Fiddler trace and examine one of the later redirect frames back to the web application. Note in the following screenshot, the request in frame 58 contains multiple OpenIdConnect.nonce cookies (red-circled). In a working scenario, you should only have one OpenIdConnect.nonce cookie set at the beginning before authentication. After the request is successfully authenticated, this nonce cookie is destroyed and ASP.NET sets its own session cookie. Because of this bug, you see a buildup of these nonce cookies.
27+
28+
:::image type="content" source="media/asp-dot-net-application-infinite-sign-in-loop/openidconnet-nonce-cookies.png" alt-text="Screenshot that shows multiple OpenIdConnect nonce cookies." lightbox="media/asp-dot-net-application-infinite-sign-in-loop/openidconnet-nonce-cookies.png":::
29+
30+
## Solution 1: Upgrade to ASP.NET Core
31+
32+
The issue is resolved in ASP.NET Core and a later version of Katana OWIN for ASP.NET. To resolve this issue, upgrade your application to use ASP.NET Core.
33+
34+
If you must continue to use ASP.NET, perform the following actions:
35+
36+
- Update your application's Microsoft.Owin.Host.SystemWeb package to version 3.1.0.0 or later.
37+
- Modify your code to use one of the new cookie manager classes, for example:
38+
39+
```csharp
40+
app.UseCookieAuthentication(new CookieAuthenticationOptions
41+
{
42+
AuthenticationType = "Cookies",
43+
CookieManager = new Microsoft.Owin.Host.SystemWeb.SystemWebChunkingCookieManager()
44+
});
45+
```
46+
or
47+
48+
```csharp
49+
app.UseCookieAuthentication(new CookieAuthenticationOptions()
50+
{
51+
CookieManager = new SystemWebCookieManager()
52+
});
53+
```
54+
55+
## Solution 2: Correct the redirect URL
56+
57+
In some cases where the application is hosted under a virtual directory or an application instead of the root of the web site, [solution 1](#solution-1-upgrade-to-aspnet-core) might not work. For more information, see [Infinite re-direct loop after AAD Authentication when redirect is specified](https://stackoverflow.com/questions/44397715/infinite-re-direct-loop-after-aad-authentication-when-redirect-is-specified) and [Microsoft Account OAuth2 sign-on fails when redirect URL is not under the website root](https://github.com/aspnet/AspNetKatana/issues/203).
58+
59+
For example, suppose you have the following environment:
60+
61+
- The root of a web site: `https://mysite` – This site runs under *Application Pool 1*.
62+
- An application *test2* under the root: `https://mysite/test2` – This application runs under *Application Pool 2*.
63+
- Your ASP.NET application runs under the *test2* application with the following code:
64+
65+
```csharp
66+
public void Configuration(IAppBuilder app)
67+
{
68+
// For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=316888
69+
app.SetDefaultSignInAsAuthenticationType(CookieAuthenticationDefaults.AuthenticationType);
70+
app.UseCookieAuthentication(new CookieAuthenticationOptions());
71+
app.UseOpenIdConnectAuthentication(
72+
new OpenIdConnectAuthenticationOptions
73+
{
74+
// Sets the ClientId, authority, RedirectUri as obtained from web.config
75+
ClientId = clientId,
76+
Authority = authority,
77+
RedirectUri = "https://mysite/test2",
78+
// PostLogoutRedirectUri is the page that users will be redirected to after sign-out. In this case, it is using the home page
79+
PostLogoutRedirectUri = redirectUri,
80+
Scope = OpenIdConnectScope.OpenIdProfile,
81+
// ResponseType is set to request the id_token - which contains basic information about the signed-in user
82+
ResponseType = OpenIdConnectResponseType.IdToken,
83+
// ValidateIssuer set to false to allow personal and work accounts from any organization to sign in to your application
84+
// To only allow users from a single organizations, set ValidateIssuer to true and 'tenant' setting in web.config to the tenant name
85+
// To allow users from only a list of specific organizations, set ValidateIssuer to true and use ValidIssuers parameter
86+
87+
// OpenIdConnectAuthenticationNotifications configures OWIN to send notification of failed authentications to OnAuthenticationFailed method
88+
89+
Notifications = new OpenIdConnectAuthenticationNotifications
90+
{
91+
AuthenticationFailed = OnAuthenticationFailed
92+
}
93+
94+
}
95+
);
96+
}
97+
```
98+
99+
- You use the following code to trigger the sign-in flow:
100+
101+
```csharp
102+
public void SignIn()
103+
{
104+
if (!Request.IsAuthenticated)
105+
{
106+
HttpContext.GetOwinContext().Authentication.Challenge(
107+
new AuthenticationProperties { RedirectUri = "/" },
108+
OpenIdConnectAuthenticationDefaults.AuthenticationType);
109+
}
110+
}
111+
```
112+
113+
This scenario can result in an authentication infinite loop with a buildup of multiple OpenIdConnect.nonce cookies. The difference is that ASP.NET doesn't appear to set its authenticated session cookies. To resolve the issue in such scenario, set the redirect URLs in the OpenID Connect initialization code and the `Challenge` method (note the trailing slash in the redirect URL):
114+
115+
```csharp
116+
app.UseOpenIdConnectAuthentication(
117+
new OpenIdConnectAuthenticationOptions
118+
{
119+
// Sets the ClientId, authority, RedirectUri as obtained from web.config
120+
ClientId = clientId,
121+
Authority = authority,
122+
RedirectUri = "https://mysite/test2/",
123+
// PostLogoutRedirectUri is the page that users will be redirected to after sign-out. In this case, it is using the home page
124+
PostLogoutRedirectUri = redirectUri,
125+
Scope = OpenIdConnectScope.OpenIdProfile,
126+
...
127+
```
128+
129+
```csharp
130+
public void SignIn()
131+
{
132+
if (!Request.IsAuthenticated)
133+
{
134+
HttpContext.GetOwinContext().Authentication.Challenge(
135+
new AuthenticationProperties { RedirectUri = "/test2/" },
136+
OpenIdConnectAuthenticationDefaults.AuthenticationType);
137+
}
138+
}
139+
```
140+
141+
## References
142+
143+
- [Infinite redirects with ASP.NET OWIN and OpenID Connect](https://varnerin.info/infinite-redirects-with-aspnet-owin-and-openid-connect/)
144+
145+
[!INCLUDE [Azure Help Support](../../../includes/azure-help-support.md)]
1.07 MB
Loading

support/entra/entra-id/toc.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@
6363
href: app-integration/enable-msal4j-logging-spring-boot-webapp.md
6464
- name: Repeated login prompts in iOS MSAL implementation
6565
href: app-integration/repeat-login-prompts-in-msal-ios-app.md
66+
- name: Infinite sign-in loop issue with ASP.NET applications
67+
href: app-integration/asp-dot-net-application-infinite-sign-in-loop.md
6668

6769

6870
- name: Troubleshoot adding apps
@@ -295,7 +297,6 @@
295297
items:
296298
- name: Python scripts making requests are detected as web crawlers
297299
href: users-groups-entra-apis/python-scripts-microsoft-graph-requests-detected-as-web-crawler.md
298-
299300
- name: Microsoft Entra User Provisioning and Synchronization
300301
items:
301302
- name: User Sign-in or password Problems
Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
---
2+
title: Scripts to Check and Clean the AGPM Archive That Causes GPO Operation Issues
3+
description: Introduces a script to check and clean up the AGPM archive that might lead to GPO operation issues.
4+
ms.date: 04/25/2025
5+
manager: dcscontentpm
6+
audience: itpro
7+
ms.topic: troubleshooting
8+
ms.reviewer: garymu
9+
ms.custom:
10+
- sap:group policy\group policy management (gpmc or gpedit)
11+
- pcy:WinComm Directory Services
12+
---
13+
# Scripts: Check and clean up the AGPM archive that might lead to GPO operation issues
14+
15+
_Applies to:_   Advanced Group Policy Manager 4.0 SP3
16+
17+
The sample script included in this article can assist with archive inconsistencies that lead to errors in managing Group Policy Objects (GPOs) within the tool.
18+
19+
Examples of errors that can occur if there's inconsistent information in the **gpostate.xml** file:
20+
21+
```output
22+
Create GPO: Test...Failed.
23+
[Error] The system cannot find the file specified. (Exception from HRESULT: 0x80070002)
24+
--------------------------------------------------------------------------------------------------------
25+
1 actions failed.
26+
```
27+
28+
## Script
29+
30+
Here's what the script does:
31+
32+
1. Stops the Advanced Group Policy Management (AGPM) service.
33+
2. Scans the **gpostate.xml** file and removes references (if any) to archive nonexistent or incomplete GUID folders.
34+
3. Renames the **gpostate.xml** file with a timestamp if any changes are detected and saves a new **gpostate.xml** file.
35+
4. Starts the AGPM service.
36+
37+
[!INCLUDE [Script disclaimer](../../includes/script-disclaimer.md)]
38+
39+
```powershell
40+
Write-Host "Stopping AGPM Service"
41+
Stop-Service "AGPM Service" -ErrorAction Stop
42+
$AGPMArchivePath = Get-ItemPropertyValue -Path "HKLM:\SOFTWARE\Microsoft\AGPM" -Name "ArchivePath" -ErrorAction Stop
43+
$AGPMFile =$AGPMArchivePath + "gpostate.xml"
44+
[xml]$AGPMArchive = Get-Content -Path $AGPMFile -ErrorAction Stop
45+
$bChangesMade = $false
46+
foreach( $GPODomain in $AGPMArchive.Archive.GPODomain )
47+
{
48+
Write-Host "Processing archive information for domain: $($GPODomain.domain)"
49+
$ArchiveGPO = if( $GPODomain.GPO -is [array] ){ $GPODomain.GPO[0] } else { $GPODomain.GPO }
50+
While( $ArchiveGPO -ne $null )
51+
{
52+
$TempGPONext = $ArchiveGPO.NextSibling
53+
Write-Host "Checking GPO $($ArchiveGPO.id)"
54+
if( $ArchiveGPO.state.archiveId -ne $null ){
55+
$TestArchivePath = $AGPMArchivePath + $ArchiveGPO.state.archiveId
56+
if( -not (Test-Path $TestArchivePath ) )
57+
{
58+
Write-Host "$($ArchiveGPO.state.archiveId) is not in archive - Removing"
59+
$ArchiveGPO.ParentNode.RemoveChild($ArchiveGPO) > $null
60+
$bChangesMade = $true
61+
}
62+
}
63+
else
64+
{
65+
$ArchiveGPOHistoryItem = $ArchiveGPO.History.FirstChild
66+
While( $ArchiveGPOHistoryItem -ne $null )
67+
{
68+
$TempNext = $ArchiveGPOHistoryItem.NextSibling
69+
$TestArchivePath = $AGPMArchivePath + $ArchiveGPOHistoryItem.archiveId
70+
if( -not (Test-Path -Path $TestArchivePath) )
71+
{
72+
Write-Host "History '$($ArchiveGPOHistoryItem.archiveId)' for State '$($ArchiveGPOHistoryItem.state)' on '$($ArchiveGPOHistoryItem.time)' is not in archive - Removing"
73+
$ArchiveGPOHistoryItem.ParentNode.RemoveChild($ArchiveGPOHistoryItem) > $null
74+
$bChangesMade = $true
75+
}
76+
elseif( -not (Test-Path -Path ($TestArchivePath + "\bkupinfo.xml") ) )
77+
{
78+
Write-Host "'$($ArchiveGPOHistoryItem.archiveId)' does not have bkupinfo.xml - Removing"
79+
$ArchiveGPOHistoryItem.ParentNode.RemoveChild($ArchiveGPOHistoryItem) > $null
80+
$bChangesMade = $true
81+
}
82+
$ArchiveGPOHistoryItem = $TempNext
83+
}
84+
if( -not $ArchiveGPO.History.HasChildNodes )
85+
{
86+
Write-Host "GPO $($ArchiveGPO.id) has no History removing."
87+
$ArchiveGPO.ParentNode.RemoveChild($ArchiveGPO) > $null
88+
$bChangesMade = $true
89+
}
90+
}
91+
$ArchiveGPO = $TempGPONext
92+
}
93+
}
94+
if( $bChangesMade )
95+
{
96+
$BackupFileName = "gpostate\_bak\_$((Get-Date).ToString('yyyymmdd-hhmmss')).xml"
97+
Write-Host "Backing up gpostate.xml file to $BackupFileName"
98+
Move-Item -Path $AGPMFile -Destination ($AGPMArchivePath + $BackupFileName) -Force -ErrorAction Stop
99+
Write-Host "Saving updates"
100+
$AGPMArchive.Save($AGPMArchivePath + "gpostate.xml")
101+
}
102+
else
103+
{
104+
Write-Host "No Changes made."
105+
}
106+
Write-Host "Starting AGPM service."
107+
Start-Service "AGPM Service"
108+
```

support/windows-server/toc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3145,6 +3145,8 @@ items:
31453145
href: ./support-tools/scripts-retrieve-profile-age-delete-aged-copies.md
31463146
- name: Scripts to view the certificate information in the msDS-KeyCredentialLink attribute
31473147
href: ./support-tools/script-to-view-msds-keycredentiallink-attribute-value.md
3148+
- name: 'Scripts to check and clean up the AGPM archive'
3149+
href: support-tools/scripts-check-and-cleanup-the-agpm-archive.md
31483150
- name: TroubleShootingScript toolset (TSS)
31493151
items:
31503152
- name: Introduction to TroubleShootingScript toolset (TSS)

0 commit comments

Comments
 (0)