Re: why WSPasswordCallback.getPassword is null when I try my soap request

robert lazarski <[email protected]>
Newsgroups gmane.text.xml.axis.user
Message-ID <CABpPLBWhyMYeRB+NQOebTS5u4-h1cWsembPyQtH3XhX0cszAyQ@mail.gmail.com>
On Fri, May 10, 2013 at 4:26 AM, Tania Marinova <[email protected]> wrote:
> Hi thank you!
>
> So the callback  number is 0 (sorry for forgetting
>
> the usage is really 'Username_Token';
>

From what I gather, the WSPasswordCallback went thru major changes
recently and WSPasswordCallback.USERNAME_TOKEN_UNKNOWN is no longer an
option. You probably are running WSS4J 1.6 , please confirm the jar
version.

http://coheigea.blogspot.com.br/2011/02/usernametoken-processing-changes-in.html

http://coheigea.blogspot.com.br/2011/04/wss4j-16-introducing-validators.html

For your purposes it seems you need to override a method,
UsernameTokenValidator.verifyPlaintextPassword() , as explained here :

"So what if you want to validate the plaintext password against a
directory store, rather than have the CallbackHandler set the
password? Instead of implementing this behaviour in your
CallbackHandler implementation, you can simply @Override the
verifyPlaintextPassword(UsernameToken usernameToken) method in the
validator instead. "

I'd look at the source to get started, make sure it matches your jar version.

http://svn.apache.org/repos/asf/webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/validate/UsernameTokenValidator.java

 -R
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.