public virtual bool AuthenticateWithCertificate(X509Certificate2 certificate, out UserAccount account)
        {
            Tracing.Information("[UserAccountService.AuthenticateWithCertificate] called");

            certificate.Validate();

            account = this.GetByCertificate(certificate.Thumbprint);
            if (account == null) return false;

            var result = account.Authenticate(certificate);
            Update(account);

            Tracing.Verbose("[UserAccountService.AuthenticateWithCertificate] result {0}", result);

            return result;
        }
        public virtual bool AuthenticateWithCertificate(Guid accountID, X509Certificate2 certificate, out UserAccount account)
        {
            Tracing.Information("[UserAccountService.AuthenticateWithCertificate] called for userID: {0}", accountID);
            
            certificate.Validate();

            account = this.GetByID(accountID);
            if (account == null) throw new ArgumentException("Invalid AccountID");

            var result = account.Authenticate(certificate);
            Update(account);

            Tracing.Verbose("[UserAccountService.AuthenticateWithCertificate] result: {0}", result);
            
            return result;
        }
Пример #3
0
        public virtual void AddCertificate(X509Certificate2 certificate)
        {
            Tracing.Information("[UserAccount.AddCertificate] called for accountID: {0}", this.Id);

            certificate.Validate();
            RemoveCertificate(certificate);
            AddCertificate(certificate.Thumbprint, certificate.Subject);
        }