# Credentials/auth in Ruby SOAP libs?

**URL:** <https://www.ruby-forum.com/t/credentials-auth-in-ruby-soap-libs/87178>\
**Category:** Ruby\
**Created:** [March 25, 2006, 9:44pm UTC](https://www.ruby-forum.com/t/credentials-auth-in-ruby-soap-libs/87178 "2006-03-25T21:44:32Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chris\_McMahon](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/74df32/32.png) [@Chris\_McMahon](https://www.ruby-forum.com/u/Chris_McMahon)\
**Post date:** [March 25, 2006, 9:44pm UTC](https://www.ruby-forum.com/t/credentials-auth-in-ruby-soap-libs/87178/1 "2006-03-25T21:44:32Z")

</div>

Hi…

In Java we can do something like this:  
lm = service.getlmapiSoap();  
((Stub)lm).setUsername(userName);  
((Stub)lm).setPassword(password);

In Perl we can do something like this:  
use SOAP::Lite ;  
sub SOAP::Transport::HTTP::Client::get\_basic\_credentials {  
return $USER =\> $PASS;  
}

but I can’t seem to figure out how to pass user/password credentials in  
Ruby, preferably with the WSDLDriver:

soap = SOAP::WSDLDriverFactory.new(WSDL\_URL).createDriver

anyone know how to do this?  
-Chris
