Saml2SecurityTokenHandler.ValidateConditions Method (Saml2Conditions, Boolean)

.NET Framework (current version)

The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

Validates the specified Saml2Conditions object.

Namespace:   System.IdentityModel.Tokens
Assembly:  System.IdentityModel (in System.IdentityModel.dll)

protected virtual void ValidateConditions(
	Saml2Conditions conditions,
	bool enforceAudienceRestriction


Type: System.IdentityModel.Tokens.Saml2Conditions

The SAML 2.0 condition to be validated.

Type: System.Boolean

true to check for Audience Restriction condition.

Throws an appropriate exception if the condition is not valid. The token may not be valid for a number of reasons. For example, the current time may not be within the token's validity period, the token may contain data that is contradictory or not valid, or the token may contain unsupported SAML 2.0 elements.

.NET Framework
Available since 4.5
Return to top