axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Takashi Saruhashi" <>
Subject [AXIS2] How can I get Authentication information from WebService in AXIS2
Date Mon, 26 May 2008 15:22:20 GMT
 Hello all,

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

I created WebService using POJO deployment. I want to fetch UserAuthentication information
from the Service side.

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();

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,

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


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message