AudienceUriMode 枚举


指定是否应验证 SamlSecurityToken 安全令牌的 SamlAudienceRestrictionConditionSpecifies whether the SamlSecurityToken security token's SamlAudienceRestrictionCondition should be validated.

public enum class AudienceUriMode
public enum AudienceUriMode
type AudienceUriMode = 
Public Enum AudienceUriMode


Always 1


BearerKeyOnly 2

只有在安全令牌的密钥类型为 BearerKey 并且安全令牌中没有所有权证明密钥时。Only when the security token's key is of type BearerKey and there are no proof of possession keys in the security token.

Never 0



在采用颁发 AudienceUriMode 安全令牌的安全令牌服务 (STS) 的联合应用程序中,应使用 SamlSecurityToken 属性。Use the AudienceUriMode property in a federated application that utilizes a security token service (STS) that issues SamlSecurityToken security tokens. 当 STS 颁发安全令牌时,它可以通过将 SamlAudienceRestrictionCondition 添加到安全令牌中,来指定安全令牌的目标 Web 服务的 URI。When the STS issues the security token, it can specify the URI of the Web services for which the security token is intended by adding a SamlAudienceRestrictionCondition to the security token. 这样,通过指定应采用以下方式执行此检查,接收方 Web 服务的 SamlSecurityTokenAuthenticator 将能够验证颁发的安全令牌是否针对此 Web 服务:That allows the SamlSecurityTokenAuthenticator for the recipient Web service to verify that the issued security token is intended for this Web service by specifying that this check should happen by doing the following:

(可选)重写 ValidateAudienceRestriction 方法以指定要用于允许的 URI 的验证算法。Optionally, override the ValidateAudienceRestriction method to specify the validation algorithm to use for the allowed URI.