ClaimTypeRequirement 构造函数
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
初始化 ClaimTypeRequirement 类的新实例。
重载
ClaimTypeRequirement(String) |
为所需的指定类型声明初始化 ClaimTypeRequirement 类的新实例。 |
ClaimTypeRequirement(String, Boolean) |
为指定类型的声明初始化 ClaimTypeRequirement 类的新实例。 |
ClaimTypeRequirement(String)
- Source:
- ClaimTypeRequirement.cs
- Source:
- ClaimTypeRequirement.cs
- Source:
- ClaimTypeRequirement.cs
为所需的指定类型声明初始化 ClaimTypeRequirement 类的新实例。
public:
ClaimTypeRequirement(System::String ^ claimType);
public ClaimTypeRequirement (string claimType);
new System.ServiceModel.Security.Tokens.ClaimTypeRequirement : string -> System.ServiceModel.Security.Tokens.ClaimTypeRequirement
Public Sub New (claimType As String)
参数
- claimType
- String
声明类型。
示例
下面的代码将两个声明类型要求添加到安全绑定。
WSFederationHttpBinding binding = new WSFederationHttpBinding();
binding.Security.Message.ClaimTypeRequirements.Add
(new ClaimTypeRequirement
("http://schemas.microsoft.com/ws/2005/05/identity/claims/EmailAddress"));
binding.Security.Message.ClaimTypeRequirements.Add
(new ClaimTypeRequirement
("http://schemas.microsoft.com/ws/2005/05/identity/claims/UserName", true));
注解
可以在 中找到 ClaimTypes预定义的声明类型。
适用于
ClaimTypeRequirement(String, Boolean)
- Source:
- ClaimTypeRequirement.cs
- Source:
- ClaimTypeRequirement.cs
- Source:
- ClaimTypeRequirement.cs
为指定类型的声明初始化 ClaimTypeRequirement 类的新实例。
public:
ClaimTypeRequirement(System::String ^ claimType, bool isOptional);
public ClaimTypeRequirement (string claimType, bool isOptional);
new System.ServiceModel.Security.Tokens.ClaimTypeRequirement : string * bool -> System.ServiceModel.Security.Tokens.ClaimTypeRequirement
Public Sub New (claimType As String, isOptional As Boolean)
参数
- claimType
- String
声明类型。
- isOptional
- Boolean
如果值为 false
,则声明是必选的;否则声明是可选的。
示例
下面的代码将两个声明类型要求添加到安全绑定。
WSFederationHttpBinding binding = new WSFederationHttpBinding();
binding.Security.Message.ClaimTypeRequirements.Add
(new ClaimTypeRequirement
("http://schemas.microsoft.com/ws/2005/05/identity/claims/EmailAddress"));
binding.Security.Message.ClaimTypeRequirements.Add
(new ClaimTypeRequirement
("http://schemas.microsoft.com/ws/2005/05/identity/claims/UserName", true));