public bool Authenticate(UserNamePasswordValidator validator)
 {
     if (!_valid)
     {
         return(false);
     }
     try
     {
         validator.Validate(_username, _password);
         return(true);
     }
     catch { }
     return(false);
 }
Example #2
0
        public void Authentificate(IIdentity myIdentity)
        {
            if (myIdentity == null)
            {
                throw new ArgumentNullException("myIdentity");
            }

            var identity = myIdentity as HttpListenerBasicIdentity;

            if (identity == null)
            {
                throw new SecurityTokenValidationException("The authentification scheme was not basic.");
            }

            _validator.Validate(identity.Name, identity.Password);
        }