Claim.CreateSpnClaim(String) 方法

定义

创建一个表示指定服务主要名称 (SPN) 的 Claim 对象。Creates a Claim object that represents the specified Service Principal Name (SPN).

public:
 static System::IdentityModel::Claims::Claim ^ CreateSpnClaim(System::String ^ spn);
public static System.IdentityModel.Claims.Claim CreateSpnClaim (string spn);
static member CreateSpnClaim : string -> System.IdentityModel.Claims.Claim
Public Shared Function CreateSpnClaim (spn As String) As Claim

参数

spn
String

与此声明关联的实体的 SPN。The SPN of the entity associated with this claim. 此参数不能为 nullThis parameter must not be null. 如果此参数为 null,此方法将引发 ArgumentNullException 异常。If this parameter is null, this method throws an ArgumentNullException exception.

返回

Claim

此方法创建的 Claim 对象。The Claim object this method creates.

例外

spn 参数为 nullThe spn parameter is null.

注解

此方法创建的 Claim 对象具有下表所示的属性值。The Claim object this method creates has the property values shown in the following table.

属性Property “值”Value
ClaimType Spn
Resource spn 参数的值。The value of the spn parameter.
Right PossessProperty.PossessProperty.

适用于