1

I have a Windows Service that is exposing some WCF services where access is restricted using Windows Authentication and AD roles.

One of the services is a service for an admin client currently implemented as an MMC (Microsoft Management Console) Snapin.

I would like to change this for a browser based dashboard implemented with ServiceStack and the Razorplugin.

Out of the box ServiceStack does not support Windows Authentication for self hosted services.

Has someone done this before? Is it possible? For example implemented something like this in a ServiceStack plugin?

UPDATE: I can enable the Windows Authentication on my AppHostHttpListenerBase derived AppHost like this.

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);
        } 

What I really need is access to the HttpListenerContext from with Filters.

Regards, Anders

Amunk
  • 11
  • 2

1 Answers1

1

I asked a similar question. The short answer is ServiceStack doesn't know anything about Windows Authentication. See the solution to my question above to see if that helps you.

Community
  • 1
  • 1
BrandonG
  • 876
  • 11
  • 20
  • I have looked into Filter but the thing is that you need access to the HttpListenerContext. As I see it you only have access to the HttpListenerRequest: public override void Execute(IHttpRequest req, IHttpResponse res, object requestDto) { var request = req.OriginalRequest as HttpListenerRequest; } – Amunk Aug 23 '13 at 12:37