aspose file tools*
The moose likes Web Services and the fly likes How are you supposed to supply user/password to a web service ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "How are you supposed to supply user/password to a web service ?" Watch "How are you supposed to supply user/password to a web service ?" New topic
Author

How are you supposed to supply user/password to a web service ?

Sol Mayer-Orn
Ranch Hand

Joined: Nov 13, 2002
Posts: 311
Hi,


I need to write a webService with authentication.
Namely: client applications must supply username + password ( which will be checked against our LDAP server ).

I'm new to this, so I'd appreciated it if someone could tell: how should my clients supply the password ?
- Is it customary to supply the username+password through standard HTTP headers (say, 'basic authentication') ?
- Or, is it handled by the webServices/security spec ? Does the < soap:Envelope > message structure keep a dedicated tag for user/password info ? Something like:

<soap:Envelope...>
...
< ! -- dummy tag! -- >
<login user='jelly' password='secret' />
</soap:Envelope...>


Thanks very much.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42264
    
  64
I'll blatantly advertise an article I wrote for the JavaRanch Journal on Web Services Authentication. It explains authentication using both HTTP and WS-Security with example code. You can find it here.


Ping & DNS - my free Android networking tools app
Sol Mayer-Orn
Ranch Hand

Joined: Nov 13, 2002
Posts: 311
Thanks, great article !
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How are you supposed to supply user/password to a web service ?