Web Services authentication - best practices?

前端 未结 3 1737
时光取名叫无心
时光取名叫无心 2020-12-24 14:01

We have SOAP web services in production that are relying on SOAP Headers (containing plain client credentials) for the authentication. The WS are used in heterogeneous envir

相关标签:
3条回答
  • 2020-12-24 14:24

    The way I have tackled this in the past is to use the standard WS-* features.

    Instead of using the authentication feature we set the message header integrity feature on. This requires both sides of the dialog have access to public/private key pair and detects any tampering of the username field in the header. So you can be sure whoever sent the message and set the user id has access to the private key.

    This provides a reasonable level of integrity if the keys are managed properly.

    0 讨论(0)
  • 2020-12-24 14:25

    The easiest way to handle it across a variety of platforms is to use HTTP basic authentication and HTTPS for the transport layer. WS-Security would be good if your needs go beyond simple username/password but the support is going to vary quite a bit between platforms. HTTP authentication is supported by every decent SOAP implementation.

    0 讨论(0)
  • 2020-12-24 14:28

    If you have to roll it all yourself and can't use HTTPS, I'd suggest the hash-based UsernameToken portion of WS-Security. It's pretty secure and fairly easy to implement as long as your libraries have the hashing functions.

    If you're doing web services, I wouldn't rely on HTTP for authentication.

    WS-Security as a whole is way too big.

    0 讨论(0)
提交回复
热议问题