public Student Find(AuthenticationParams model) { var student = _context.Student.Where(s => s.Username == model.Username && s.Password == model.Password) .FirstOrDefault(); return(student); }
public Mentor Find(AuthenticationParams model) { var mentor = _context.Mentor.Where(m => m.Username == model.Username && m.Password == model.Password) .FirstOrDefault(); return(mentor); }
public Partner Find(AuthenticationParams model) { var partner = _context.Partner.Where(p => p.Username == model.Username && p.Password == model.Password) .FirstOrDefault(); return(partner); }
public string SetToken(AuthenticationParams model) { var student = Find(model); if (student != null) { student.Token = Guid.NewGuid().ToString(); _context.SaveChanges(); } return(student?.Token); }
public string SetToken(AuthenticationParams model) { var mentor = Find(model); if (mentor != null) { mentor.Token = Guid.NewGuid().ToString(); _context.SaveChanges(); } return(mentor?.Token); }
public void Authenticate(AuthenticationParams authenticationParams) { if (authenticationParams == null) { throw new ArgumentNullException(nameof(authenticationParams)); } var response = factory .GetRequest(authenticationParams) .Send <AuthenticationResult>(serviceUrl); factory.SessionId = response.Result.SessionId; }
public string GetToken(AuthenticationParams model) { return(Find(model).Token); }
public ActionResult <string> GetToken([FromBody] AuthenticationParams model) { return(_partnerRepo.GetToken(model)); }
public ActionResult <Partner> RetrievePartner([FromBody] AuthenticationParams model) { return(_partnerRepo.Find(model)); }
public ActionResult <string> GenerateToken([FromBody] AuthenticationParams model) { return(_studentRepo.SetToken(model)); }
public ActionResult <Student> RetrieveStudent([FromBody] AuthenticationParams model) { return(_studentRepo.Find(model)); }
public ActionResult <Mentor> RetrieveMentor([FromBody] AuthenticationParams model) { return(_mentorRepo.Find(model)); }