asp.net 核心 2.1 和 windows 使用 httpclient 模拟
asp.net core 2.1 and windows impersonation with httpclient
我正在使用 asp.net 核心 mvc 2.1 并且需要调用依赖于 Windows 身份验证的遗留 asp.net 4.6 webapi 端点来验证和授权用户的调用。
这个 article 详细说明了如何冒充 windows 身份,我让它工作了...但是 该页面的下一句话还说
Note that RunImpersonated doesn't support asynchronous operations and
shouldn't be used for complex scenarios. For example, wrapping entire
requests or middleware chains isn't supported or recommended.
我的问题:
如果是 "shouldn't be used" 那么在 windows 域中拨打电话时模拟用户的首选方式是什么?在 asp.net 框架中,您可以简单地将 <identity impersonate="true" />
节点添加到 web.config
来自评论的解决方案:
没有其他解决方案可以在 asp.net 核心中模拟 windows 身份。如果您需要模拟,这是目前 asp.net 核心中唯一的方法。
我正在使用 asp.net 核心 mvc 2.1 并且需要调用依赖于 Windows 身份验证的遗留 asp.net 4.6 webapi 端点来验证和授权用户的调用。
这个 article 详细说明了如何冒充 windows 身份,我让它工作了...但是 该页面的下一句话还说
Note that RunImpersonated doesn't support asynchronous operations and shouldn't be used for complex scenarios. For example, wrapping entire requests or middleware chains isn't supported or recommended.
我的问题:
如果是 "shouldn't be used" 那么在 windows 域中拨打电话时模拟用户的首选方式是什么?在 asp.net 框架中,您可以简单地将 <identity impersonate="true" />
节点添加到 web.config
来自评论的解决方案:
没有其他解决方案可以在 asp.net 核心中模拟 windows 身份。如果您需要模拟,这是目前 asp.net 核心中唯一的方法。