Sur un projet on est en https, avec un userNameCredential :
<system.webServer>
<modules runAllManagedModulesForAllRequests="true">
<remove name="DomainServiceModule"/>
<add name="DomainServiceModule" preCondition="managedHandler" type="System.ServiceModel.DomainServices.Hosting.DomainServiceHttpModule, System.ServiceModel.DomainServices.Hosting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
</modules>
<validation validateIntegratedModeConfiguration="false" />
</system.webServer>
<system.web>
<httpModules>
<!--<remove name="HttpsDomainServiceModule"/>-->
<add name="HttpsDomainServiceModule" type="System.ServiceModel.DomainServices.Hosting.DomainServiceHttpModule, System.ServiceModel.DomainServices.Hosting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
</httpModules>
<compilation debug="true" targetFramework="4.0" />
<customErrors mode="Off"/>
</system.web>
<system.serviceModel>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true"/>
<behaviors>
<serviceBehaviors>
<behavior name="ComposanteSol_Web.SuiviVolService.ServiceBehavior">
<serviceMetadata httpsGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="true" />
<dataContractSerializer maxItemsInObjectGraph="65536000"/>
<serviceCredentials>
<userNameAuthentication userNamePasswordValidationMode="Custom" customUserNamePasswordValidatorType="ComposanteSol_Web.SuiviVolAuthentication, ComposanteSol_Web"/>
</serviceCredentials>
</behavior>
</serviceBehaviors>
</behaviors>
<bindings>
<customBinding>
<binding name="ComposanteSol_Web.SuiviVolService.binaryHttps" sendTimeout="00:10:00" receiveTimeout="00:10:00">
<transactionFlow/>
<!-- <reliableSession/> -->
<security authenticationMode="UserNameOverTransport"></security>
<binaryMessageEncoding>
<readerQuotas
maxDepth="1734003200"
maxStringContentLength="1734003200"
maxArrayLength="1734003200"
maxBytesPerRead="1734003200"
maxNameTableCharCount="1734003200" />
</binaryMessageEncoding>
<httpsTransport/>
</binding>
</customBinding>
</bindings>
<services>
<service name="ComposanteSol_Web.SuiviVolService" behaviorConfiguration="ComposanteSol_Web.SuiviVolService.ServiceBehavior">
<endpoint name="SuiviVolService" address="" binding="customBinding" bindingConfiguration="ComposanteSol_Web.SuiviVolService.binaryHttps" contract="ComposanteSol_Web.SuiviVolService" >
</endpoint>
<endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange" />
</service>
</services>
</system.serviceModel>
Un avantage, c'est la gestion des droits en dynamique avec OperationContext.Current.ServiceSecurityContext.PrimaryIdentity.Name, un inconvénient, on a pas le [AuthentificationBehavior(Droits = Droits.Consultation)]