4
我需要每个请求的WCF服务如何从WCF请求拦截Authorization头
认证
public class AuthenticationInterceptor : RequestInterceptor
{
public AuthenticationInterceptor() : base(false)
{
}
public override void ProcessRequest(ref System.ServiceModel.Channels.RequestContext requestContext)
{
//How to access Request Header (Authorization header) from here?
}
}
我没有有非常相同的设置,所以需要这个让它工作:var requestContext = OperationContext.Current.RequestContext; –