Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to do authentication using SOAP?

How do I authenticate users with SOAP?

Will I have to require the user to send his username and password with every SOAP request and I authenticate him against the database?

Doesn't that seem to cause unnecessary queries?

like image 340
YD8877 Avatar asked Apr 29 '10 13:04

YD8877


People also ask

Does SOAP have authentication?

SOAP is just as flexible as REST when it comes to protecting and authenticating a web service. WS-Security is the key extension that supports many authentication models including: basic username/password credentials, SAML, OAuth and more. A common way that SOAP API's are authenticated is via SAML Single Sign On (SSO).

What is authentication type in SOAP message?

Authentication standardsBasic/Digest/NTLM authentication - Uses HTTP headers to identify users. WS-Security SAML and Username Tokens - SOAP/XML based authentication, passes credentials and assertions in SOAP message headers, optionally signed and encrypted.


1 Answers

An easier way would be to authenticate on the first query, build a session record on the server side containing the remote IP address and a token that you give to the client as an authToken. Then have the client pass this authToken in future queries. This authToken has to match the internal session data you keep about the client, but would allow you to avoid having to make round-trips to the database just to do authentication.

That said, @Marcus Adams has a good point below with regard to stateless-ness. There are people out there pushing all sorts of SOAP security models. WS-Security is the current state of the art, here. They all work by putting authentication information in the SOAP header - after all, that's why a SOAP message contains both a header and a bodypart.

like image 64
Chris K Avatar answered Sep 28 '22 16:09

Chris K