public virtual void ValidateStatement(StatementAbstract statement)
        {
            if (statement == null)
            {
                throw new ArgumentNullException("statement");
            }

            // Validate all possible statements in the assertion
            if (statement is AuthnStatement)
            {
                ValidateAuthnStatement((AuthnStatement)statement);
            }
            else if (statement is AuthzDecisionStatement)
            {
                ValidateAuthzDecisionStatement((AuthzDecisionStatement)statement);
            }
            else if (statement is AttributeStatement)
            {
                ValidateAttributeStatement((AttributeStatement)statement);
            }
            else
            {
                throw new Saml2FormatException(string.Format("Unsupported Statement type {0}", statement.GetType()));
            }
        }
Exemple #2
0
        /// <summary>
        /// Validates the statement.
        /// </summary>
        /// <param name="statement">The statement.</param>
        /// <exception cref="SAML2.Profiles.DKSAML20.DKSaml20FormatException">Thrown if a format error is detected.</exception>
        public void ValidateStatement(StatementAbstract statement)
        {
            if (statement is AuthzDecisionStatement)
            {
                ValidateAuthzDecisionStatement();
                return;
            }

            if (statement is AttributeStatement)
            {
                ValidateAttributeStatement(statement as AttributeStatement);
                return;
            }

            if (statement is AuthnStatement)
            {
                ValidateAuthnStatement(statement as AuthnStatement);
                return;
            }

            throw new DKSaml20FormatException(string.Format("The DK-SAML 2.0 profile does not allow unknown Statement type: \"{0}\"", statement.GetType()));
        }