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>().InstancePerLifetimeScope();
How can I achive this.
Thanks