<transport> de <basicHttpBinding>

Définit les propriétés qui contrôlent les paramètres d'authentification pour le transport HTTP.

Hiérarchie de schéma

<system.serviceModel>
  <bindings>
    <basicHttpBinding>
      <binding>
        <security> de <basicHttpBinding>
          <transport> de <basicHttpBinding>

Syntaxe

<basicHttpBinding>
    <binding>
        <security
        mode="None|Transport|Message|TransportWithMessageCredential|TransportCredentialOnly">
            <transport clientCredentialType="None|Basic|Digest|Ntlm|Windows"
             proxyCredentialType="None|Basic|Digest|Ntlm|Windows" realm="string" >
                <extendedProtectionPolicy
                     policyEnforcement="Never|WhenSupported|Always"
                     protectionScenario="TransportSelected|TrustedProxy">
                    <customServiceNames></customServiceNames>
                        </extendedProtectionPolicy>
            </transport>
        </security>
    </binding>
</basicHttpBinding>

Attributs et éléments

Les sections suivantes décrivent des attributs, des éléments enfants et des éléments parents.

Attributs

Attribut Description

clientCredentialType

  • Spécifie le type d'information d'identification à utiliser lors de l'exécution de l'authentification du client à l'aide de l'authentification par HTTP. La valeur par défaut est None. Cet attribut est de type HttpClientCredentialType.

proxyCredentialType

  • Spécifie le type d'information d'identification à utiliser lors de l'exécution de l'authentification du client à partir d'un domaine à l'aide d'un proxy sur HTTP. Cet attribut est applicable uniquement lorsque l'attribut mode de l'élément security parent est Transport ou TransportCredentialsOnly. Cet attribut est de type HttpProxyCredentialType.

realm

Chaîne qui spécifie le domaine utilisé par la méthode d'authentification HTTP pour l'authentification Digest ou de base. La valeur par défaut est une chaîne vide.

policyEnforcement

Cette énumération spécifie à quel moment ExtendedProtectionPolicy doit être appliqué.

  1. Never : la stratégie n'est jamais appliquée (la protection étendue est désactivée).

  2. WhenSupported : la stratégie est appliquée uniquement si le client prend en charge la protection étendue.

  3. Always : la stratégie est toujours appliquée. Les clients qui ne prennent pas en charge la protection étendue ne pourront pas être authentifiés.

protectionScenario

Cette énumération spécifie le scénario de protection appliqué par la stratégie.

Éléments enfants

Aucune

Éléments parents

Élément Description

<security> de <basicHttpBinding>

Définit les fonctionnalités de sécurité pour le <basicHttpBinding>.

Exemple

L'exemple suivant montre l'utilisation de la sécurité de transport SSL avec la liaison de base. Par défaut, la liaison de base prend en charge la communication HTTP.

<system.serviceModel>
   <services>
      <service 
          type="Microsoft.ServiceModel.Samples.CalculatorService"
          behaviorConfiguration="CalculatorServiceBehavior">
         <endpoint address=""
               binding="basicHttpBinding"
               bindingConfiguration="Binding1" 
               contract="Microsoft.ServiceModel.Samples.ICalculator" />
      </service>
   </services>
    <bindings>
        <basicHttpBinding>
        <!-- Configure basicHttpBinding with Transport security -- >
        <!-- mode and clientCredentialType set to None.-->
           <binding name="Binding1">
               <security mode="Transport">
                   <transport clientCredentialType="None"
                              proxyCredentialType="None">
                       <extendedProtectionPolicy
                          policyEnforcement="WhenSupported"
                          protectionScenario="TransportSelected">
                    <customServiceNames></customServiceNames>
                       </extendedProtectionPolicy>
               </security>
           </binding>
        </basicHttpBinding>
    </bindings>
</system.serviceModel>

Voir aussi

Référence

Transport
Transport
HttpTransportSecurityElement
HttpTransportSecurity

Concepts

<binding>

Autres ressources

Securing Services and Clients
Windows Communication Foundation Bindings
Configuring System-Provided Bindings
Using Bindings to Configure Services and Clients