WCF REST RequestInterceptor authentication

北慕城南 提交于 2019-12-03 03:46:44

Are you creating the SecureWebServiceHostFactory with your Interceptor?

public class SecureWebServiceHostFactory : ServiceHostFactory
{
    protected override ServiceHost CreateServiceHost(Type serviceType, Uri[] baseAddresses)
    {
         WebServiceHost2 host = new WebServiceHost2(serviceType, true, baseAddresses);
         host.Interceptors.Add(new AuthenticationInterceptor());
         return host;
     }
}

I have used that example and it works, take a closer look to your code, you might be missing something.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!