/// <summary> /// Can only call before openning the host /// </summary> public void ImpersonateAll() { if (State == CommunicationState.Opened) { throw new InvalidOperationException("Host is already opened"); } SecurityHelper.ImpersonateAll(this); }
public void AddBindingParameters(ServiceDescription description, ServiceHostBase serviceHostBase, Collection <ServiceEndpoint> endpoints, BindingParameterCollection parameters) { if (ImpersonateAll) { Debug.Assert(description == serviceHostBase.Description); SecurityHelper.ImpersonateAll(serviceHostBase); } switch (m_Mode) { case ServiceSecurity.None: { ConfigureNone(endpoints); break; } case ServiceSecurity.Anonymous: { ConfigureAnonymous(endpoints); break; } case ServiceSecurity.BusinessToBusiness: { ConfigureBusinessToBusiness(endpoints); break; } case ServiceSecurity.Internet: { ConfigureInternet(endpoints, UseAspNetProviders); break; } case ServiceSecurity.Intranet: { ConfigureIntranet(endpoints); break; } default: { throw new InvalidOperationException(m_Mode + " is unrecognized security mode"); } } }