/// <summary>
        /// Initializes a new instance of the <see cref="BasicAuthenticationConfiguration"/> class.
        /// </summary>
        /// <param name="userValidator">A valid instance of <see cref="IUserValidator"/> class</param>
        /// <param name="realm">Basic authentication realm</param>
        /// <param name="userPromptBehaviour">Control when the browser should be instructed to prompt for credentials</param>
        public BasicAuthenticationConfiguration(IUserValidator userValidator, string realm, UserPromptBehaviour userPromptBehaviour = Basic.UserPromptBehaviour.NonAjax)
        {
            if (userValidator == null)
            {
                throw new ArgumentNullException("userValidator");
            }

            if (string.IsNullOrEmpty(realm))
            {
                throw new ArgumentException("realm");
            }

            this.UserValidator = userValidator;
            this.Realm = realm;
            this.UserPromptBehaviour = userPromptBehaviour;
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="BasicAuthenticationConfiguration"/> class.
        /// </summary>
        /// <param name="userValidator">A valid instance of <see cref="IUserValidator"/> class</param>
        /// <param name="realm">Basic authentication realm</param>
        /// <param name="userPromptBehaviour">Control when the browser should be instructed to prompt for credentials</param>
        public BasicAuthenticationConfiguration(IUserValidator userValidator, string realm, UserPromptBehaviour userPromptBehaviour = Basic.UserPromptBehaviour.NonAjax)
        {
            if (userValidator == null)
            {
                throw new ArgumentNullException("userValidator");
            }

            if (string.IsNullOrEmpty(realm))
            {
                throw new ArgumentException("realm");
            }

            this.UserValidator       = userValidator;
            this.Realm               = realm;
            this.UserPromptBehaviour = userPromptBehaviour;
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="CDP4WebServiceAuthenticationConfiguration"/> class.
        /// </summary>
        /// <param name="userValidator">
        /// A valid instance of <see cref="IUserValidator"/> class
        /// </param>
        /// <param name="realm">
        /// Basic authentication realm
        /// </param>
        /// <param name="userPromptBehaviour">
        /// Control when the browser should be instructed to prompt for credentials
        /// </param>
        /// <param name="cryptographyConfiguration">
        /// The cryptography configuration.
        /// </param>
        public CDP4WebServiceAuthenticationConfiguration(IUserValidator userValidator, string realm, UserPromptBehaviour userPromptBehaviour = UserPromptBehaviour.NonAjax, CryptographyConfiguration cryptographyConfiguration = null)
        {
            this.CryptographyConfiguration = cryptographyConfiguration ?? CryptographyConfiguration.Default;

            if (userValidator == null)
            {
                throw new ArgumentNullException("userValidator", "The userValidator must not be null");
            }

            if (string.IsNullOrEmpty(realm))
            {
                throw new ArgumentException("realm");
            }

            this.UserValidator       = userValidator;
            this.Realm               = realm;
            this.UserPromptBehaviour = userPromptBehaviour;
        }