Skip to content

Instantly share code, notes, and snippets.

View Vikaskumargd's full-sized avatar
🎯
Focusing

Vikas Kumar Vikaskumargd

🎯
Focusing
  • India
  • 08:14 (UTC +05:30)
View GitHub Profile
@Vikaskumargd
Vikaskumargd / introrx.md
Created January 18, 2017 21:33 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@Vikaskumargd
Vikaskumargd / authenticationWithAsp.netIdentity.cs
Created January 16, 2017 19:14
I felt the same way when taking a look at Identity. It added lots of abstractions and does not suit with my case that I have legacy system which implemented own authentication work-flow. Tons of example about OWIN authentication which uses Identity and EF by default. But technically, you are able to strip out Identity to use only OWIN cookie aut…
[HttpPost]
public ActionResult Login(LoginViewModel model, string returnUrl)
{
var user = _userService.GetByEmail(model.Email);
//check username and password from database, naive checking: password should be in SHA
if (user != null && (user.Password == model.Password))
{
var claims = new[] {
new Claim(ClaimTypes.Name, user.Name),