public ResultBase PreAuth(string uname) { ResultBase r = new ResultBase(); WebTicketService wts = new WebTicketService(RequestContext); Ticket t = wts.PreAuthTicket(uname); if (t == null || !t.PreAuthCompleted) { r.LastError = new Exception("Pre-authentication failed"); } return r; }
public ResultBase Auth() { var r = new ResultBase(); var wts = new WebTicketService(RequestContext); if (!wts.AuthTicket(PPLService.ThreadIdentity.Name)) { r.LastError = new Exception("Authentication failed"); } else { var s = new WebPPLService(RequestContext); s.GetCurrent().Authorize(new[] { new URole("admins", 100) }); } return r; }