[jboss-user] [JBoss Web Services] New message: "JBoss 6.0.0 M1 and Authenticator not appearing to work"

Ian Ian do-not-reply at jboss.com
Thu Jan 14 03:28:57 EST 2010

User development,

A new message was posted in the thread "JBoss 6.0.0 M1 and Authenticator not appearing to work":


Author  : Ian Ian
Profile : http://community.jboss.org/people/hirowla

Hi, I'm having some issues with calling an external web service from JBoss 6.0.0 M1. I'm using the "standard" server if that has an impact.
The external web service using basic authentication, so I use Authenticator.setDefault() to set a custom Authenticator, which provides the username and password. However this has no effect and when I debug the server, the Authenticator is never called. This would explain it.
However when I run exactly the same code as a standalone client (I added a main method to the class), the Authenticator is called and everything works how I would expect it.
Is there a restriction on Authenticator.setDefault() in JBoss 6.0.0 M1? Am I not allowed to call Authenticator.setDefault() (or is it silently ignored when I call it)? Or can I do it but then, why is my authenticator not being called?
Here is the basic code that does the call:
    Authenticator.setDefault(new BroadcastAuthenticator(username, password));   // Constructing my authenticator
    CommsIncomingMessageService service = new CommsIncomingMessageService();          // My web service
    CommsIncomingMessage requestInvoker = service.getCommsIncomingMessagePort();     // Getting an instance of it
    BindingProvider provider = (BindingProvider)requestInvoker;
    provider.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, url);
    provider.getRequestContext().put(BindingProvider.USERNAME_PROPERTY, username);
    provider.getRequestContext().put(BindingProvider.PASSWORD_PROPERTY, password);
Any ideas, before I pull out what remaining hair I have?


To reply to this message visit the message page: http://community.jboss.org/message/519962#519962

More information about the jboss-user mailing list