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

AD FS Troubleshooting - Claims Rules

· 52CE 我爱测

This article describes how to troubleshoot claims rule syntax with Active Directory Federation Services (AD FS).

A claim is a statement that one subject makes about itself or another subject. A relying party issues the claims. They're given one or more values and then packaged in security tokens that the Active Directory Federation Services (AD FS) server issues. This article deals with the claims syntax and creation. For information on claims issuance, see Troubleshoot AD FS.

How claim rules are processed

Claim rules are processed through the claims pipeline by using the claims engine. The claims engine is a logical component of AD FS that examines the set of incoming claims presented by a user. Depending on the logic in each rule, it produces an output set of claims.

How to create a claim rule

Claim rules are created separately for each federated trust relationship within AD FS. They aren't shared across multiple trusts. You can:

Components of the claim rule language

The claim rule language consists of the following components, separated by the " =>" operator:

  • A condition is used to check input claims and determine whether the issuance statement of the rule should be executed. It represents a logical expression that must be evaluated to true to run the rule body part.
  • An issuance statement.

Here's an example:

c:[type == "Name", value == "domain user"] => issue(type = "Role", value = "employee");

This claim has:

  • Condition: c:[type == "Name", value == "domain user"] evaluates the input claim of whether the Windows account name is a domain user.
  • Issuance: issue(type = "Role", value = "employee") adds a new claim to the input claim with the role of employee, if the condition is true.

For more information on claims and the syntax, see The role of the claim rule language.

Claims rule editor

The claims rule editor performs syntax checking after you finish the claim and select OK. If you have the incorrect syntax, the editor informs you.

Screenshot that shows the A D F S Management dialog with a message stating that the custom claim rule syntax isn't valid.

Event logs

When you try to troubleshoot a claim by using the logs, the best approach is to look for claims output. Look for 1000 and 1001 events in the event log.

Screenshot that shows the Event Properties dialog box with the results of a 1000 event I D.

Create a sample application

You can also create a sample application that echoes your claims. For example, you can use a sample application and create a relying party that has the same claim that you're trying to troubleshoot and see if the app has any issues with that claim.

Screenshot that shows the sample application in a browser.

A good sample web app is available. The app echoes the claims that it receives from the relying party. To use it, edit the web.config app:

  • Change https://app1.contoso.com/sampapp to the URL that's used for hosting the sample app.
  • Change all instances of sts.contoso.com to point to your AD FS server.
  • Replace the thumbprint with your thumbprint.
  • Replace the decryptionKey and the validationKey values with values that are appropriate for your scenario.

Screenshot that shows the web config file in Visual Studio.

This blog article has excellent, in-depth instructions for setting up the app.

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)

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

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