Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convenience constructor for SimpleUsernamePasswordCallbackHandler [SWS-745] #834

Closed
gregturn opened this issue Jan 4, 2012 · 2 comments
Closed
Assignees
Milestone

Comments

@gregturn
Copy link
Member

@gregturn gregturn commented Jan 4, 2012

Eirik Lygre opened SWS-745 and commented

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);
   ...
}

Affects: 2.0.3

Attachments:

Referenced from: commits 0f277d4

@gregturn
Copy link
Member Author

@gregturn gregturn commented Jan 20, 2012

jaminh commented

Here is a patch for the new constructor

@gregturn
Copy link
Member Author

@gregturn gregturn commented May 4, 2012

Arjen Poutsma commented

Closing old issues

@gregturn gregturn closed this May 4, 2012
@gregturn gregturn added this to the 2.0.4 milestone Sep 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.