axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Takashi Saruhashi" <TSaruha...@valueprice.eu>
Subject [Axis2] How can I get Authentication information from WebService in AXIS2
Date Mon, 26 May 2008 08:50:58 GMT
 Hello all,

Currently, I don't know how to get Authentication information (username) from WebService in
AXIS2.

I set Authentication information to WebService Client like this,

===
// Define client to access to the Web Service. 
ServiceClient sc = stub._getServiceClient(); 

// Engage modules for the authentication sc.engageModule("rampart"); 

// Set Options for authentication purpose. 
Options options = sc.getOptions();
options.setUserName("Test");
options.setPassword("test");
===

Those Authentication information is sent to Password Callback Class from Client.
I think this one is using JAAS.

Is it possible to get Authentication information(username) from WebService in AXIS2??

If I'm right, in case of AXIS1, I can fetch the value using " SimpleAuthenticationHandler
" like this,

===
org.apache.axis.handlers.SimpleAuthenticationHandler
public class SimpleAuthenticationHandler extends BasicHandler {

  public void invoke(MessageContext msgContext) throws AxisFault {
    SecurityProvider provider = (SecurityProvider)msgContext.getProperty("securityProvider");
    if (provider != null) {
      String  userID = msgContext.getUsername();
      if ( userID == null || userID.equals("")) 
          throw new AxisFault( "Server.Unauthenticated",........);
      String passwd = msgContext.getPassword();
      AuthenticatedUser authUser = provider.authenticate(msgContext);
      if ( authUser == null)
                    throw new AxisFault( "Server.Unauthenticated",........);
      msgContext.setProperty(MessageContext.AUTHUSER, authUser);
    }
 }
};
===


However, in case of AXIS2, I can't find any Class like this for fetching Authentication Information.
Does someone know the way to fetch Authentication information in AXIS2??
Any suggestions are quite appreciated.


May Tnanks

Takashi

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


Mime
View raw message