I want to use the OWIN pipeline to emit the authentication cookie to the client, clear the cookie when the user signs out etc but I don`t want to use the annoying aspnet identity provider. It just doesn't fit on the project, I tried for a long time and it just doesn't fit. So I decide I won't use it. I just want to use the OWIN pipeline.
Is this possible or I should fall back to the old forms authentication?
var claims = new List<Claim>(); claims.Add(new Claim(ClaimTypes.Name, "Brock")); claims.Add(new Claim(ClaimTypes.Email, "firstname.lastname@example.org")); var id = new ClaimsIdentity(claims, DefaultAuthenticationTypes.ApplicationCookie); var ctx = Request.GetOwinContext(); var authenticationManager = ctx.Authentication; authenticationManager.SignIn(id);
Taken from here.