Posted on: 2/2/2014 6:48:17 PM | Views : 1451

Hi,
currently I am working on a single page application with durandal and breeze. The authentification I did with the new ASP.net Identity and OAuthAuthorizationServerProvider. This work fine so far. I can excess the user in the ApiController. But my BusinessLayer need the IPrincipal as well. I use Autofac to inject the IPrincipal. But it is always null.
Each of this code doesn't work.
            builder.Register(c => System.Security.Claims.ClaimsPrincipal.Current).As<IPrincipal>().InstancePerLifetimeScope();             builder.Register(c => c.Resolve<HttpRequestMessage>().GetOwinContext().Authentication.User).As<IPrincipal>().InstancePerLifetimeScope();             builder.Register(c => HttpContext.Current.User).As<IPrincipal>().Insta ...

Go to the complete details ...