public ActionResult Login(LoginModel model) { try { if (model.Id == null) model.Id = "test"; ActionResult redirection; IRelyingParty rp = model.Id.GetRelyingPartyElement(out redirection); if (redirection != null) return redirection; var result = HandleSignInRequestLocal(model, (m) => { return true; }, rp); if (result != null) return result; } catch(Exception ex) { throw; return new RedirectResult(OnErrorRedirectUrl); } return new EmptyResult(); }
ClaimsPrincipal GetPrincipal(LoginModel model) { ClaimsIdentity i = new ClaimsIdentity( new List<Claim> { new Claim(ClaimTypes.Name, model.UserName ), new Claim(ClaimTypes.NameIdentifier, model.UserName ) }, "simpleSts"); ClaimsPrincipal p = new ClaimsPrincipal(i); return p; }