Saml2SecurityTokenHandler.DetectReplayedToken(SecurityToken) 方法
定义
如果指定标记已存在于标记重播缓存中则引发异常;否则该标记将添加到缓存中。Throws an exception if the specified token already exists in the token replay cache; otherwise the token is added to the cache.
protected:
override void DetectReplayedToken(System::IdentityModel::Tokens::SecurityToken ^ token);
protected override void DetectReplayedToken (System.IdentityModel.Tokens.SecurityToken token);
override this.DetectReplayedToken : System.IdentityModel.Tokens.SecurityToken -> unit
Protected Overrides Sub DetectReplayedToken (token As SecurityToken)
参数
- token
- SecurityToken
SecurityToken表示要检查的 SAML 2.0 安全标记(该标记应为 Saml2SecurityToken类型)。A SecurityToken that represents the SAML 2.0 security token (the token should be of type Saml2SecurityToken) to be checked.
例外
token 为 null。token is null.
Configuration 属性为 null。The Configuration property is null.
- 或 --or- 在处理程序配置(通过 TokenReplayCache 属性访问)的 Caches 属性下未配置 Configuration。There is no TokenReplayCache configured under the Caches property of the handler configuration (accessed through the Configuration property).
token 不能作为 Saml2SecurityToken 实例被转换。token cannot be cast as an instance of Saml2SecurityToken.
与标识相关的断言的 ID 是 null 或为空。The ID of the assertion associated with the token is null or empty. (令牌的Assertion属性引用 Saml2Assertion,它具有一个 Id 属性,这个属性引用 Saml2Id (该引用值具有 Value 属性,该属性为 null 或为空。))(The Assertion property of the token references a Saml2Assertion that has an Id property that references a Saml2Id with a Value property that is null or empty.)
标记已存在于 TokenReplayCache 中。The token already exists in the TokenReplayCache.
注解
默认行为是只检查持有人令牌 (没有) 密钥的令牌。The default behavior is to only check bearer tokens (tokens that do not have keys). 令牌重播缓存是通过 TokenReplayCache Caches 属性所引用的对象的属性为此处理程序配置的对象 SecurityTokenHandlerConfiguration Configuration 。The token replay cache is the TokenReplayCache object configured for this handler through the Caches property of the SecurityTokenHandlerConfiguration object referenced through the Configuration property.