Windows服务托管ServiceStack和Windows身份验证?

时间:2013-08-22 09:47:14

标签: servicestack windows-authentication

我有一个Windows服务公开了一些使用Windows身份验证和AD角色限制访问的WCF服务。

其中一项服务是当前作为MMC(Microsoft管理控制台)Snapin实施的管理客户端的服务。

我想对使用ServiceStack和Razorplugin实现的基于浏览器的仪表板进行更改。

开箱即用ServiceStack不支持自我托管服务的Windows身份验证。

之前有人这样做过吗?可能吗?例如,在ServiceStack插件中实现了类似的东西吗?

更新: 我可以像我这样在我的AppHostHttpListenerBase派生的AppHost上启用Windows身份验证。

public override void Start(string urlBase)
{
            if (Listener == null)
            {
                Listener = new HttpListener();
            }

            Listener.AuthenticationSchemes = AuthenticationSchemes.IntegratedWindowsAuthentication | AuthenticationSchemes.Anonymous;
            Listener.AuthenticationSchemeSelectorDelegate = request =>
            {
                return request.Url.LocalPath.StartsWith("/public") ? AuthenticationSchemes.Anonymous : AuthenticationSchemes.IntegratedWindowsAuthentication;
            };

            base.Start(urlBase);
        } 

我真正需要的是使用过滤器访问HttpListenerContext。

此致 安德斯

1 个答案:

答案 0 :(得分:1)

我问了一个类似的question。简短的回答是ServiceStack对Windows身份验证一无所知。请参阅上述问题的解决方案,看看是否对您有帮助。