user3900456 user3900456 - 2 months ago 18x
ASP.NET (C#) Question

How to use OWIN forms authentication without aspnet identity

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?


Like this?

var claims = new List<Claim>();
claims.Add(new Claim(ClaimTypes.Name, "Brock"));
claims.Add(new Claim(ClaimTypes.Email, ""));
var id = new ClaimsIdentity(claims,

var ctx = Request.GetOwinContext();
var authenticationManager = ctx.Authentication;

Taken from here.