[SWS-745] Convenience constructor for SimpleUsernamePasswordCallbackHandler Created: 04/Jan/12  Updated: 04/May/12  Resolved: 24/Jan/12

Status: Closed
Project: Spring Web Services
Component/s: Security
Affects Version/s: 2.0.3
Fix Version/s: 2.0.4

Type: Improvement Priority: Trivial
Reporter: Eirik Lygre Assignee: Arjen Poutsma
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: 0.05h
Original Estimate: Not Specified

Attachments: Text File spring-ws-security.patch    

 Description   

The class org.springframework.ws.soap.security.xwss.callback.SimpleUsernamePasswordCallbackHandler has two properties "username" and "password", and only a default constuctor. When using this class, I always find myself writing this code:

SimpleUsernamePasswordCallbackHandler callback = new SimpleUsernamePasswordCallbackHandler ();
callback.setUsername(username);
callback.setPassword(password);
doSomething(callback);

Of course, I'd love to write this instead, which would be a, hm, productivity booster?

doSomething(new SimpleUsernamePasswordCallbackHandler (username, password));

Hence, the request: Add the required constructors to make this work:

public class SimpleUsernamePasswordCallbackHandler extends AbstractCallbackHandler implements InitializingBean {
   ...
   public SimpleUsernamePasswordCallbackHandler ();
   public SimpleUsernamePasswordCallbackHandler (String username, String password);
   ...
}



 Comments   
Comment by jaminh [ 20/Jan/12 ]

Here is a patch for the new constructor

Comment by Arjen Poutsma [ 04/May/12 ]

Closing old issues

Generated at Mon Dec 18 05:19:17 UTC 2017 using JIRA 6.4.14#64029-sha1:ae256fe0fbb912241490ff1cecfb323ea0905ca5.