身份验证 – 向Microsoft.Owin.Testing.TestServer验证请求

前端之家收集整理的这篇文章主要介绍了身份验证 – 向Microsoft.Owin.Testing.TestServer验证请求前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我正在使用owin TestServer类单元测试我的web api.除了我不确定如何验证请求之外,它的工作非常好,所以我不能真正测试需要身份验证的端点,而不是确保未经身份验证的请求是未经授权的. @H_404_1@我正在将WebApi配置为仅使用承载令牌验证,如下所示:

// Web API configuration and services
// Configure Web API to use only bearer token authentication.
config.SuppressDefaultHostAuthentication();
config.Filters.Add(new HostAuthenticationFilter(OAuthDefaults.AuthenticationType));
@H_404_1@任何想法,我怎么能这样容易吗

原文链接:https://www.f2er.com/windows/369439.html

猜你在找的Windows相关文章