Uploaded image for project: 'Spring Web Services'
  1. Spring Web Services
  2. SWS-214

Setting Basic Authentication preemptive through CommonsHttpMessageSender

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.0.1
    • Fix Version/s: 1.5.4
    • Component/s: Core
    • Labels:
      None

      Description

      When using CommonsHttpMessageSender in the WebServiceTemplate to support Basic Authentication (with setCredentials()), it should also delegate the Method getParams().setAuthenticationPreemptive(true) from the underlaying HttpClient to avoid a roundtrip and to always use the actual username/password if it changes during the requests.

      Currently you can do that with this code:

      WebServiceTemplate template = new WebServiceTemplate();
      CommonsHttpMessageSender sender = new CommonsHttpMessageSender();
      sender.setCredentials(new MyCredentials());
      sender.getHttpClient().getParams().setAuthenticationPreemptive(true);
      sender.afterPropertiesSet();
      template.setMessageSender(sender);

        Activity

        Hide
        arjen.poutsma Arjen Poutsma added a comment -

        Closing old issues

        Show
        arjen.poutsma Arjen Poutsma added a comment - Closing old issues

          People

          • Assignee:
            arjen.poutsma Arjen Poutsma
            Reporter:
            mikewiesner Mike Wiesner
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: