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

        mikewiesner Mike Wiesner created issue -
        arjen.poutsma Arjen Poutsma made changes -
        Field Original Value New Value
        Fix Version/s 1.5.4 [ 11016 ]
        arjen.poutsma Arjen Poutsma made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        arjen.poutsma Arjen Poutsma made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          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: