Toon posts:

[.Net / JDeveloper] Webservice interoperability

Pagina: 1
Acties:

Verwijderd

Topicstarter
We hebben een asp.net 2.0 website die communiceert met een Java webservice (geimplementeerd met JDeveloper).
De website heeft een WSE 3 referentie naar de webservice.

Zonder beveiliging werkt alles probleemloos.
Met beveiliging (UsernameToken) en wachtwoord verstuurd als PasswordOption.SendPlainText gaat het ook goed.

Op het moment dat we het wachtwoord "hashed" (PasswordOption.SendHashed) willen sturen krjigen we de melding "Authentication failed".
Aan de webservice kant wordt ook met JDeveloper ingesteld dat er met een "Digest" wachtwoord gewerkt moet worden.

Met een Oracle test client werkt het wel.

Hieronder de twee SOAP berichten.

Bericht 1 van .Net naar JDeveloper
C++:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<soap:Envelope 
    xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
    xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" 
    xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" 
    xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
   <soap:Header>
   
    <wsa:Action>http://Eloket/ELoketServices.wsdl/geefTechnologies</wsa:Action>
        <wsa:MessageID>urn:uuid:8d51d988-458e-47f3-9c55-a8c0a4434142</wsa:MessageID>
        <wsa:ReplyTo>
                <wsa:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsa:Address>
        </wsa:ReplyTo>
        <wsa:To>http://pc2644.alfa.local:9031/WebServices_sec/ELoketServicesSoapHttpPort</wsa:To>
        
    <wsse:Security soap:mustUnderstand="1">
                <wsu:Timestamp wsu:Id="Timestamp-306fd43c-efe8-48f4-8f56-604d4ff5f62a">
                    <wsu:Created>2006-03-03T14:11:07Z</wsu:Created>
                    <wsu:Expires>2006-03-03T14:16:07Z</wsu:Expires>
                </wsu:Timestamp>
                 <wsse:UsernameToken 
            xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" 
            wsu:Id="SecurityToken-6e7e83bb-c018-44d6-baa6-7a25e4cf25d1">
                    <wsse:Username>orasign</wsse:Username>
                    <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest">G+9h17SoRL3RHvIuvq8NSSLYnWc=</wsse:Password>
                    <wsse:Nonce>ztEn6rzQr8jqSrjgqD6o+A==</wsse:Nonce>
                     <wsu:Created>2006-03-03T14:11:07Z</wsu:Created>
                </wsse:UsernameToken>
        </wsse:Security>
   </soap:Header>
   
   <soap:Body>
      <geefTechnologiesElement xmlns="http://Eloket/ELoketServices.wsdl/types/"/>
   </soap:Body>
</soap:Envelope>


Bericht 2 van JDeveloper naar JDeveloper
C++:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<env:Envelope 
xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" 
xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xmlns:ns0="http://Eloket/ELoketServices.wsdl/types/" 
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">

   <env:Header>

      <wsse:Security 
    xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" 
    xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" 
    xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" 
    env:mustUnderstand="1">

         <wsse:UsernameToken 
        xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" 
        xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
            <wsse:Username>orasign</wsse:Username>
            <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest">76TkPVuwrJUAkNYe0iT/m++YRpU=</wsse:Password>
            <wsse:Nonce>4a07zt5+TJvj+GQXtKb01w==</wsse:Nonce>
            <wsu:Created ValueType="http://www.w3.org/2001/XMLSchema/dateTime">2006-03-03T13:57:24Z</wsu:Created>
         </wsse:UsernameToken>

      </wsse:Security>

   </env:Header>

   <env:Body>
      <ns0:geefTechnologiesElement/>
   </env:Body>

</env:Envelope>


Zoals je ziet is er in essentie geen verschil tussen de twee berichten.

Iemand enig idee waar dit aan kan liggen?

  • Kwistnix
  • Registratie: Juni 2001
  • Laatst online: 16:43
De waarden van de Nonce en Created tags maken ook deel uit van de password digest?

Verwijderd

Topicstarter
FallenAngel666 schreef op vrijdag 03 maart 2006 @ 15:33:
De waarden van de Nonce en Created tags maken ook deel uit van de password digest?
Ja op het moment dat we PasswordOption.SendHashed gebruiken regelt .Net dat automatisch als het goed is?

C++:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
          //invoke proxy web service object          
          ELoketServicesWse javaServices = new ELoketServicesWse();

          // Get the SoapContext associated with the SOAP request.
          SoapContext requestContext = javaServices.RequestSoapContext;

          // Set the period of time in which the SOAP request expires to one minute.
          requestContext.Security.Timestamp.TtlInSeconds = 60;

          //Create usernametoken
          UsernameToken userToken;
          userToken = new UsernameToken("orasign", "pipo1", PasswordOption.SendHashed);          
        
          // Add the UsernameToken token to the SOAP message.
          javaServices.RequestSoapContext.Security.Tokens.Add(userToken);