Saml2SecurityTokenHandler.DetectReplayedToken(SecurityToken) Method

Definition

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)

Parameters

token
SecurityToken

A SecurityToken that represents the SAML 2.0 security token (the token should be of type Saml2SecurityToken) to be checked.

Exceptions

token is null.

The Configuration property is null.

-or-

There is no TokenReplayCache configured under the Caches property of the handler configuration (accessed through the Configuration property).

token cannot be cast as an instance of Saml2SecurityToken.

The ID of the assertion associated with the token is null or empty. (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.)

The token already exists in the TokenReplayCache.

Remarks

The default behavior is to only check bearer tokens (tokens that do not have keys). 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.

Applies to