예제 #1
0
        public void WriteAuditEntry(SecurityAuditEntry auditEntry)
        {
            string category = "";

            switch (auditEntry.AuditType)
            {
            case SecurityAuditType.AuthenticationSuccess:
            {
                category = "认证成功";
                break;
            }

            case SecurityAuditType.AuthenticationFailure:
            {
                category = "认证失败";
                break;
            }

            case SecurityAuditType.AuthorizationSuccess:
            {
                category = "授权成功";
                break;
            }

            case SecurityAuditType.AuthorizationFailure:
            {
                category = "授权失败";
                break;
            }
            }
            this.DataAccess.WriteAuditEntry(auditEntry.Id, category, auditEntry.IPAddress, auditEntry.Message);
        }
예제 #2
0
        public void AuditForAuthenticationFailure(string userName)
        {
            string             ipAddress  = HttpContext.Current.Request.UserHostAddress;
            SecurityAuditEntry auditEntry = new SecurityAuditEntry(Guid.NewGuid().ToString(), SecurityAuditType.AuthenticationFailure, ipAddress);

            auditEntry.Message = string.Format("用户\"{0}\"登录失败", userName);
            this.SecurityAuditProxy.WriteAuditEntry(auditEntry);
        }
예제 #3
0
 public void WriteAuditEntry(SecurityAuditEntry auditEntry)
 {
     Guard.ArgumentNotNull(auditEntry, "auditEntry");
     this.Business.WriteAuditEntry(auditEntry);
 }
예제 #4
0
 public void WriteAuditEntry(SecurityAuditEntry auditEntry)
 {
     this.Invoker.Invoke(proxy => proxy.WriteAuditEntry(auditEntry));
 }