大网数据广告活动
域与目录服务

AD FS Troubleshooting - Loop Detection

· 52CE 我爱测

This article describes how to troubleshoot loop detection for Active Directory Federation Services (AD FS).

Looping in Active Directory Federation Services (AD FS) occurs when a relying party continuously rejects a valid security token and redirects back to AD FS.

Loop detection cookie

To prevent this problem from happening, AD FS implemented a loop detection cookie. By default, AD FS writes a cookie to web passive clients named MSISLoopDetectionCookie. This cookie holds a timestamp value and a value for the number of tokens issued. This information allows AD FS to keep track of how often and how many times a client visited the federation service within a specific timespan.

If a passive client visits the federation service for a token five times within 20 seconds, AD FS throws the following error:

MSIS7042: The same client browser session has made '{0}' requests in the last '{1}' seconds. Contact your administrator for details.

Entering into infinite loops is often caused by a misbehaving relying party application that isn't successfully consuming the token issued by AD FS. The application then sends the passive client back to AD FS, repeatedly, for a new token. AD FS issues the passive client a new token each time, with a limit of five requests within 20 seconds.

Adjust the loop detection cookie

You can use PowerShell to change the value for the number of tokens issued and the timespan value.

Set-AdfsProperties -LoopDetectionMaximumTokensIssuedInterval 5  -LoopDetectionTimeIntervalInSeconds 20

The minimum value for LoopDetectionMaximumTokensIssuedInterval is 1.

The minimum value for LoopDetectionTimeIntervalInSeconds is 5.

You can also disable loop detection when you're doing performance testing.

Set-AdfsProperties -EnableLoopDetection $false

Important: Don't disable loop detection permanently because it prevents users from entering into infinite loop states.

Related content

Source: Microsoft Learn / Windows Server documentation by Microsoft and contributors. Documentation licensed CC BY 4.0. Code samples are covered by the MIT License. Converted from Markdown, with links normalized and embedded media omitted.

资料来源与适用范围

资料来源
Microsoft Learn / Windows Server documentation
适用范围
Windows Server · Source date 02/13/2024
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY 4.0 (documentation), MIT (code samples)

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。