How to do authentication using SOAP?

后端 未结 4 1099
夕颜
夕颜 2020-12-30 06:47

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 d

4条回答
  •  佛祖请我去吃肉
    2020-12-30 07:09

    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.

提交回复
热议问题