DotVVM Authentication get null exception
<p>When is called method SignIn I get error NullReferenceExepction.</p>

<p>Here is my ViewModel:</p>

<pre><code>public Masterpage1ViewModel() {
        UserIdentity user = new UserIdentity("Admin");
        var claimsIdentity = new ClaimsIdentity(user);

        Context.OwinContext.Authentication.SignIn(claimsIdentity);
  }
</code></pre>

<p>Here is class for UserIdentity:</p>

<pre><code>public class UserIdentity : IIdentity
{
    public string AuthenticationType
    {
        get { return DefaultAuthenticationTypes.ApplicationCookie; }
    }

    public bool IsAuthenticated { get; set; }

    public string Name { get; private set; }

    public UserIdentity(string name)
    {
        Name = name;
    }
}
</code></pre>

<p>Also I added to Startup.cs:</p>

<pre><code>app.UseCookieAuthentication(new CookieAuthenticationOptions()
        {
            AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie,
            Provider = new CookieAuthenticationProvider()
            {
                OnApplyRedirect = e =&gt; DotvvmAuthenticationHelper.ApplyRedirectResponse(e.OwinContext, e.RedirectUri)
            }
        });
</code></pre>