Integrità dei dati via HTTP con Windows Communication Foundation

5 pagine in totale: <<Indietro 1 2 [3] 4 5 Avanti >>

Servizio che pubblica informazioni all'esterno tramite utente e password. È importante in questo caso impostare lato client la UserName e la Password nel seguente modo:

credentials.UserNamePassword.UserName = GetUserNameFromCfg();
credentials.UserNamePassword.Password = GetPasswrodFromCfg();

Questa configurazione è utile quando si vogliono offrire informazioni personalizzate a determinati clienti come Fatture, stato degli ordini, ecc.

Servizio:
<bindings>
    <BasicHttpBinding>
        <binding name="UserOverTransport">
            <security mode="Transport">
                <transport clientCredentialType="Certificate"/>
            </security>
        </binding>
    </BasicHttpBinding>
</bindings>

<behaviors>
    <behavior name="CredentialBehavior">
        <clientCredentials>
            <clientCertificate storeLocation="CurrentUser" storeName="My" x509FindType="FindBySubjectName" findValue="MySelf"/>
                <serviceCertificate storeLocation="CurrentUser"
                storeName="My" x509FindType="FindBySubjectDistinguishedName" findValue="cn=PublishSite.com"/>
        </clientCredentials>
    </behavior>
</behaviors>

Client:
<bindings>
    <BasicHttpBinding>
        <binding name="UsernameWithTransport">
            <security mode="Transport">
                <transport clientCredentialType="Certificate"/>
            </security>
        </binding>
    </BasicHttpBinding>
</bindings>

<behaviors>
    <behavior name="CredentialBehavior">
        <serviceCredentials>
            <clientCertificate trustedStoreLocation="LocalMachine"
                revocationMode="Online"/>
            <serviceCertificate storeLocation="LocalMachine"
                storeName="My" findValue="PublishSite.com"
                x509FindType="FindBySubjectDistinguishedName"/>
        </serviceCredentials>
    </behavior>
</behaviors>

Questa configurazione protegge la transazione tramite un certificato X509 le cui specifiche vengono impostate sia sul client che sul service tramite il nodo behavior.

5 pagine in totale: <<Indietro 1 2 [3] 4 5 Avanti >>

Contenuti dell'articolo

Commenti
Dai un voto a questo articolo, ci aiuterà a migliorare il nostro sito (1 è il voto minimo, 5 il massimo).

Per procedere al rating dell'articolo devi essere autenticato.

Aggiungi un nuovo commento »»»
Per inserire un commento, devi registrarti alla nostra community.



TUTORIALS


IN EVIDENZA
MISC