[Fedora-suds-list] https authentication failing

Bruce Edge bruce.edge at lsi.com
Mon Jun 22 15:33:01 UTC 2009


On Mon, Jun 22, 2009 at 6:45 AM, Jeff Ortel <jortel at redhat.com> wrote:

> Hey Bruce,
>
> Can you paste the <service/> node from the wsdl?
>
> -jeff
>

Here's the service def node:

<service name="xxxService">
    <port binding="tns:xxxBinding" name="xxxPort">
      <soap:address location="https://localhost:8443/service-war/xxx"/>
    </port>
</service>

I did get it working.

This works:

url = 'https://localhost:8443/service-war/dpmcore?wsdl'
client = Client(url, username="username", password="password")
client.service.getOemKey()

This does not:

security = Security()
token = UsernameToken('username', 'password')
security.tokens.append(token)
url = 'https://kaan-01.wlv.lsi.com:8443/service-war/dpmcore?wsdl'
client = Client(url, wsse=security)
client.service.getOemKey()

I was making it harder than it needed to be. What is the difference is
between these above two client authentication mechanisms?
Will either one of these support digest passwords some time in the future?

One last somewhat off-topic question, (for today anyway) Is there a way to
easily obfuscate the userid/passwd in code?
Can we use suds with  ssl certs and something like an authorized keys file?

Thanks

-Bruce




>
> Edge, Bruce wrote:
>
>> If that was the problem wouldn't the client instantiation fail?
>> I'm able to inatantiate a client and do a:
>>      print client.service
>> But then any methods called on the service fail.
>>
>> -Bruce
>>
>> Sent from my iPhone
>>
>> On Jun 20, 2009, at 8:46 AM, David Norton <david at nortoncrew.com <mailto:
>> david at nortoncrew.com>> wrote:
>>
>>  Hello Bruce,
>>>
>>> Does the WSDL specify a different URL for the service? I have had to use
>>> the following code because the WSDLs I'm using specify "localhost:8080":
>>>
>>> client = Client(url+"?wsdl")
>>> client.wsdl.service.setlocation(url)
>>>
>>> Best,
>>> David Norton
>>>
>>> On Jun 19, 2009, at 8:02 PM, Bruce Edge wrote:
>>>
>>>  I'm having a problem with https basic authentication
>>>>
>>>> Is there something I'm doing wrong here?
>>>>
>>>> security = Security()
>>>> token = UsernameToken('username', 'password')
>>>> security.tokens.append(token)
>>>> url = ' <https://targetboc:8443/service-war/dpmcore?wsdl>
>>>> https://targetboc:8443/service-war/dpmcore?wsdl'
>>>>
>>>> c = Client(url, wsse=security)
>>>> print c.service
>>>>
>>>> # OK so far
>>>>
>>>> c.service.getOemKey(wsse=security)
>>>>
>>>> # fails with
>>>>
>>>> Traceback (most recent call last):
>>>>  File "<input>", line 1, in <module>
>>>>  File "wsenv.py", line 22, in <module>
>>>>    c.service.getOemKey(wsse=security)
>>>>  File "suds/client.py", line 240, in __call__
>>>>    return target.call(*args, **kwargs)
>>>>  File "suds/client.py", line 379, in call
>>>>    return method(*args, **kwargs)
>>>>  File "suds/client.py", line 240, in __call__
>>>>    return target.call(*args, **kwargs)
>>>>  File "suds/client.py", line 422, in call
>>>>    return client.invoke(args, kwargs)
>>>>  File "suds/client.py", line 480, in invoke
>>>>    result = self.send(msg)
>>>>  File "suds/client.py", line 504, in send
>>>>    reply = transport.send(request)
>>>>  File "suds/transport/https.py", line 64, in send
>>>>    return HttpTransport.send(self, request)
>>>>  File "suds/transport/http.py", line 78, in send
>>>>    fp = self.__open(u2request)
>>>>  File "suds/transport/http.py", line 99, in __open
>>>>    return self.urlopener.open(u2request)
>>>>  File "/usr/lib/python2.6/urllib2.py", line 383, in open
>>>>    response = self._open(req, data)
>>>>  File "/usr/lib/python2.6/urllib2.py", line 401, in _open
>>>>    '_open', req)
>>>>  File "/usr/lib/python2.6/urllib2.py", line 361, in _call_chain
>>>>    result = func(*args)
>>>>  File "/usr/lib/python2.6/urllib2.py", line 1138, in https_open
>>>>    return self.do_open(httplib.HTTPSConnection, req)
>>>>  File "/usr/lib/python2.6/urllib2.py", line 1105, in do_open
>>>>    raise URLError(err)
>>>> URLError: <urlopen error [Errno 111] Connection refused>
>>>> >>>
>>>>
>>>> I tried the beta with the same result.
>>>>
>>>> I know the service is OK because I can do this:
>>>>
>>>>  curl -ku username:password <
>>>> https://localhost:8443/service-war/dpmcore/getOemKey>
>>>> https://localhost:8443/service-war/dpmcore/getOemKey
>>>> <soap:Envelope xmlns:soap=" <http://schemas.xmlsoap.org/soap/envelope/>
>>>> http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><getOemKeyResponse
>>>> xmlns=" <http://lsi.com/dpm/core/types>http://lsi.com/dpm/core/types"
>>>> xmlns:ns2=" <http://lsi.com/dpm/types>http://lsi.com/dpm/types"><oemKey>LSI</oemKey></getOemKeyResponse></soap:Body></soap:Envelope>
>>>>
>>>>
>>>>
>>>> Thanks, Bruce
>>>> _______________________________________________
>>>> fedora-suds-list mailing list
>>>> <mailto:fedora-suds-list at redhat.com>fedora-suds-list at redhat.com<mailto:
>>>> fedora-suds-list at redhat.com>
>>>> https://www.redhat.com/mailman/listinfo/fedora-suds-list
>>>>
>>>
>>>
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> fedora-suds-list mailing list
>> fedora-suds-list at redhat.com
>> https://www.redhat.com/mailman/listinfo/fedora-suds-list
>>
>
> _______________________________________________
> fedora-suds-list mailing list
> fedora-suds-list at redhat.com
> https://www.redhat.com/mailman/listinfo/fedora-suds-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/fedora-suds-list/attachments/20090622/b02414d4/attachment.htm>


More information about the fedora-suds-list mailing list