axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ruchith Fernando" <ruchith.ferna...@gmail.com>
Subject Re: [Axis2][Rampart]setOperationContext does not get a chance to run
Date Tue, 12 Jun 2007 02:28:58 GMT
The rampart inflow handlers are invoked way before the message
receiver. And the MessageContext.getCurrentContext() will only work
after the message receiver is invoked. Therefore calling
MessageContext.getCurrentContext() will not yield anything.

Also at the moment we cannot access the message context from the
password callback handler.

Thanks,
Ruchith

On 6/12/07, Chad DeBauch <cdebauch@gmail.com> wrote:
> Deepal...that is what I don't understand.  The MessageContext is not passed
> to the PasswordCallback.  Here is an example PasswordCallback:
>
> import java.io.IOException;
>  import javax.security.auth.callback.Callback;
>  import javax.security.auth.callback.CallbackHandler;
>  import
> javax.security.auth.callback.UnsupportedCallbackException;
>  import org.apache.ws.security.WSPasswordCallback;
>
>  public class PWCallback implements CallbackHandler {
>      public void handle(Callback[] callbacks) throws IOException,
> UnsupportedCallbackException {
>          for (int i = 0; i < callbacks.length; i++) {
>              if (callbacks[i] instanceof WSPasswordCallback) {
>                  WSPasswordCallback pc =
> (WSPasswordCallback)callbacks[i];
>                  // set the password given a username
>                  if ("wss4j".equals(pc.getIdentifer())) {
>                      pc.setPassword("security");
>                  }
>              } else {
>                  throw new UnsupportedCallbackException(callbacks[i],
> "Unrecognized Callback");
>              }
>          }
>      }
>  }
>
> In Axis1 I could call MessageContext.getCurrentContext();
> and get the MessageContext within the PasswordCallback class.  But in Axis2
> if I call MessageContext.getCurrentMessageContext(); it
> returns null.  Any ideas?
>
> Thanks
> Chad
>
>
> On 6/11/07, Deepal Jayasinghe <deepal@opensource.lk> wrote:
> > Hi Chad ,
> > What I told was , Message context is available to security handler , and
> > security handler is the one who call PasswordCallback , so that handler
> > should pass the MC to the PasswordCallback.
> >
> > Thanks
> > Deepal
> > > Thanks Deepal for your response.  If I understand you correctly it is
> > > possible to get the MessageContext from within the PasswordCallback.
> > > Can you give an example?
> > >
> > > Thanks
> > > Chad
> > >
> > > On 6/11/07, *Deepal Jayasinghe* <deepal@opensource.lk
> > > <mailto:deepal@opensource.lk>> wrote:
> > >
> > >     Hi Chad ,
> > >     > With Axis1 this was possible by calling
> > >     > MessageContext.getCurrentContext();  This doesn't
> appear to be
> > >     > possible in Axis2, is that right?
> > >     It does , but only for the service impl class, not for others.
> > >     Since all
> > >     the handlers have access to message context directly.
> > >
> > >     Thanks
> > >     Deepal
> > >
> > >
> > >
> ---------------------------------------------------------------------
> > >     To unsubscribe, e-mail:
> axis-user-unsubscribe@ws.apache.org
> > >     <mailto: axis-user-unsubscribe@ws.apache.org>
> > >     For additional commands, e-mail: axis-user-help@ws.apache.org
> > >     <mailto:axis-user-help@ws.apache.org>
> > >
> > >
> >
> > --
> > Thanks,
> > Deepal
> >
> ................................................................
> > "The highest tower is built one brick at a time"
> >
> >
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> axis-user-unsubscribe@ws.apache.org
> > For additional commands, e-mail: axis-user-help@ws.apache.org
> >
> >
>
>


-- 
www.ruchith.org
www.wso2.org

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


Mime
View raw message