I have created a token .NET web API endpoint to get an OAuth bearer token. After retriving the token I call another endpoint of my API and I pass in the authorize header my bearer token but if I check the principal in the RequestContext it is always null. Why my owin server doesn't create a principal object.
Is it right to register my authorization provider like this:
builder.RegisterType<SimpleAuthorizationServerProvider>()
.As<IOAuthAuthorizationServerProvider>()
.PropertiesAutowired()
.SingleInstance();
Or should it be .InstancePerRequest(). But if I use the instance per request I receive an error. Has anyone a working example for this use case. I am very desperately because I have tried multiple example but without resolution. This is even my second thread (Token Based Authentication using ASP.NET Web API 2 and Owin throws 401 unautorized) on this problem but I think my problem resides on autofac because it's the only difference to other working samples.