I'm using the owin TestServer class to unit test my web api. It's working great except that I'm unsure how to authenticate requests, so I can't really test endpoints that require authentication, other than to make sure that unauthenticated requests are unauthorized.
I am configuring WebApi to use only bearer token authentication as indicated here:
// Web API configuration and services
// Configure Web API to use only bearer token authentication.
config.SuppressDefaultHostAuthentication();
config.Filters.Add(new HostAuthenticationFilter(OAuthDefaults.AuthenticationType));
Any ideas how I could do this easily?