user3900456 user3900456 - 1 year ago 134
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?

Answer Source

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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download