CallbackHandler does not work with RealmAuthenticationAdapter

View: New views
4 Messages — Rating Filter:   Alert me  

CallbackHandler does not work with RealmAuthenticationAdapter

by metro-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I am running Metro 1.1 on Weblogic 10.0. Previously I have successfully setup a RealmAuthenticationAdapter for UsernameToken validation.

When I now added a simple Server-side CallbackHandler (similar to the one in thread http://forums.java.net/jive/thread.jspa?threadID=37688&tstart=90) the UsernameToken validation fails (see stack trace below). It appears that RealmAuthenticationAdapter is somehow not used when CallbackHandlerConfiguration exists. Btw. the CallbackHandler works well if I do not specify a UsernameToken.

Do you have any idea what might cause this issue?

regards
Martti

SEVERE: WSS0225.error.PasswordValidationCallback
com.sun.xml.wss.XWSSecurityException: Error: No PasswordValidator Configured for
 UsernameToken Validation
        at com.sun.xml.wss.impl.misc.DefaultSecurityEnvironmentImpl.authenticate
User(DefaultSecurityEnvironmentImpl.java:912)
        at com.sun.xml.ws.security.opt.impl.incoming.UsernameTokenHeader.validat
e(UsernameTokenHeader.java:128)
        at com.sun.xml.ws.security.opt.impl.incoming.processor.SecurityHeaderPro
cessor.createHeader(SecurityHeaderProcessor.java:139)
        at com.sun.xml.ws.security.opt.impl.incoming.SecurityRecipient.handleEnc
ryptedData(SecurityRecipient.java:481)
        at com.sun.xml.ws.security.opt.impl.incoming.SecurityRecipient.handleSec
urityHeader(SecurityRecipient.java:365)
        at com.sun.xml.ws.security.opt.impl.incoming.SecurityRecipient.cacheHead
ers(SecurityRecipient.java:252)
        at com.sun.xml.ws.security.opt.impl.incoming.SecurityRecipient.validateM
essage(SecurityRecipient.java:198)
        at com.sun.xml.wss.jaxws.impl.SecurityPipeBase.verifyInboundMessage(Secu
rityPipeBase.java:445)
        at com.sun.xml.wss.jaxws.impl.SecurityServerPipe.process(SecurityServerP
ipe.java:187)
        at com.sun.xml.ws.api.pipe.helper.PipeAdapter.processRequest(PipeAdapter
.java:115)
        at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:595)
        at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:554)
        at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:539)
        at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:436)
        at com.sun.xml.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:24
3)
[Message sent by forum member 'kaumar' (kaumar)]

http://forums.java.net/jive/thread.jspa?messageID=263168

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Re: CallbackHandler does not work with RealmAuthenticationAdapter

by metro-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I think I found the reason for this myself. If a server-side CallbackHandler is defined in the configuration, WSIT just instantiates this without passing the appropriate RealmAuthenticationAdapter instance as a parameter (see com/sun/xml/wss/jaxws/impl/SecurityServerPipe.java, method configureServerHandler):
...
Object obj = handler.newInstance();
...
 
If no CallbackHandler has been defined, the DefaultCallbackHandler is instantiated with a constructor that also receives the RealmAuthenticationAdapter as a parameter.
...
RealmAuthenticationAdapter adapter = getRealmAuthenticationAdapter(((ServerPipeConfiguration)pipeConfig).getEndpoint())  
return new DefaultCallbackHandler("server", props, adapter);
...

I'll try to modify my CallbackHandler so that it also retrieves the RealmAuthenticationAdapter from the ServerPipeConfiguration before instantiating the DefaultCallbackHandler.

regards
Martti
[Message sent by forum member 'kaumar' (kaumar)]

http://forums.java.net/jive/thread.jspa?messageID=263307

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Re: CallbackHandler does not work with RealmAuthenticationAdapter

by metro-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Also i have the same problem but with tomcat
i installed metro with tomcat 5.5
and test it by deploy web service from metro samples
and then i deployed custom web service that use UsernameToken
the web service deployed, but when i send valid request contains valid UserName Token in the header of SOAP message, i got these message:

com.sun.xml.ws.security.opt.impl.incoming.UsernameTokenHeader validate
SEVERE: WSS1408: UsernameToken Authentication Failed
[Message sent by forum member 'tarek7elmy' (tarek7elmy@...)]

http://forums.java.net/jive/thread.jspa?messageID=370464

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Re: CallbackHandler does not work with RealmAuthenticationAdapter

by suresh-22 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

metro@... wrote:

> Also i have the same problem but with tomcat
> i installed metro with tomcat 5.5
> and test it by deploy web service from metro samples
> and then i deployed custom web service that use UsernameToken
> the web service deployed, but when i send valid request contains valid UserName Token in the header of SOAP message, i got these message:
>
> com.sun.xml.ws.security.opt.impl.incoming.UsernameTokenHeader validate
> SEVERE: WSS1408: UsernameToken Authentication Failed
> [Message sent by forum member 'tarek7elmy' (tarek7elmy@...)]
>
> http://forums.java.net/jive/thread.jspa?messageID=370464
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@...
> For additional commands, e-mail: users-help@...
>
>  
means the username and password in the username token do not match with
what are there in the tomcat users list or in the validator's list...
are you using username validator on the server side?
basically the exception tells the username/password on the client side  
and server side did not match..
thanks
suresh

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...