Similar Form authentication in OWIN MVC
<p>I am taking over from another colleague where he has implemented OWIN in the project. Now what I am trying to achieve is to add a login method and see if the user is logged in then add the authentication like we used to do in form authentication like this</p>

<pre><code>FormsAuthentication.SetAuthCookie(email, true);
</code></pre>

<p>What I am trying to achieve overall is this function</p>

<pre><code>    [AllowAnonymous]
    [HttpPost]
    public ActionResult Login(String email, String password)
    {
        //  Request.GetOwinConte

        // TODO validate user
        /*
        if(Membership.ValidateUser(email, password))
        {


        }*/

        //var user = UserManager.FindAsync(email, password);

        FormsAuthentication.SetAuthCookie(email, true); // how should I replicate this in OWIN?
        return RedirectToAction("Index","Site");

    }
</code></pre>

<p>So after following the links in the comments and this tutorial
<a href="http://www.khalidabuhakmeh.com/asp-net-mvc-5-authentication-breakdown-part-deux#disqus_thread" rel="nofollow">http://www.khalidabuhakmeh.com/asp-net-mvc-5-authentication-breakdown-part-deux#disqus_thread</a></p>

<p>I have been able to store cookies like this</p>

<pre><code>    public ActionResult Login(String email, String password)
    {
        //  Request.GetOwinConte

        // TODO validate user
        /*
        if(Membership.ValidateUser(email, password))
        {

        }*/

        var identity = new ClaimsIdentity(new[] {
                        new Claim(ClaimTypes.Name, email),
                    },
                    DefaultAuthenticationTypes.ApplicationCookie,
                    ClaimTypes.Name, ClaimTypes.Role);

        Authentication.SignIn(new AuthenticationProperties
        {
            IsPersistent = true
        }, identity);

        return RedirectToAction("Index","Site");

    }
</code></pre>

<p>Can someone explain what does this identity variable has? And how do I check the user credentials? That even he is the right person or not?</p>