Custom Information in Identity Cookie/ Ticket MVC Jan 10, 2014

With MVC 5 has done away with the Forms based authentication (for good) and has replaced that with the OWIN Security Middleware,

Brock Allen has writter an nice post summarizing the basics

A primer on OWIN cookie authentication middleware

Because the identity is claim based you can add additional claim to the user for later use.

If you are just looking to add information using the existing ApplicationOAuthProvider Update the code to read.

Note that I am adding a singe claim called E-mail, and i am also using both cookie and ticket.

To Access the Claims you can
var context = (OwinContext)HttpContext.Current.GetOwinContext(); var owinUser = context.Authentication.User; var claims = owinUser.Claims;