title: MVC4 Forms Authentication Custom Identity Cast not working
body: <p>I have implemented openAuth forms authentication in mvc almost same as on this page <a href="http://www.strathweb.com/2012/08/adding-openid-authentication-to-your-asp-net-mvc-4-application/" rel="nofollow">http://www.strathweb.com/2012/08/adding-openid-authentication-to-your-asp-net-mvc-4-application/</a></p>
  
  <p>However I am unable to cast the <code>System.Web.Security.FormsIdentity</code> to <code>OpenIdIdentity</code> when i don't use <code>[OpenIdAuthorize]</code> attribute on my actions.</p>
  
  <pre><code>[OpenIdAuthorize]
  public ActionResult Index()
  {
      return View();
  }
  </code></pre>
  
  <p>If I add <code>[OpenIdAuthorize]</code> attribute and then cast the identity, it works fine. I have an action which should work for both, anonymous and signed in users. However if a user is signed in, I want to get <code>OpenIdIdentity</code> and use it.</p>
  
  <p>The problem is that override of <code>AuthorizeCore</code> does not get called if I don't put an attribute in action.</p>