You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Dave Cowing <dc...@enpresence.com> on 2006/08/07 20:38:34 UTC

[axis2] User credentials in service

I've been getting acquainted with Rampart and understand a bunch of it
(thanks to Ruchith for his great tutorial).
 
Now I have a question: How can I access user credentials (either the
signature or a username) in my service?
 
I'm performing a transaction and need to ensure that I use the identity I've
authenticated in that transaction.
 
 
Thanks,
Dave

Re: [axis2] User credentials in service

Posted by Ruchith Fernando <ru...@gmail.com>.
Dave,

Yes. It looks like we have some inconsistency in getProperties() and
getProperty() methods.

Deepal can you please shed some light on this? What can we expect from
AbstractContext( or MessageContext)#getProperties()?

Thanks,
Ruchith

On 8/8/06, Dave Cowing <dc...@enpresence.com> wrote:
> Ruchith,
>
> You're right.  Interestingly, when I call getProperties on MessageContect
> (inherited from AbstractContext), it pulls the properties from the context
> object (not from the options):
>     public Map getProperties() {
>         return properties;
>     }
>
> The behavior seems inconsistant (I would have expected the two methods to
> pull consistant properties) - but I can move on with the getProperty(key)
> method you've pointed out.
>
> Best,
> Dave
>
> -----Original Message-----
> From: Ruchith Fernando [mailto:ruchith.fernando@gmail.com]
> Sent: Tuesday, August 08, 2006 11:19 AM
> To: axis-user@ws.apache.org
> Subject: Re: [axis2] User credentials in service
>
> Hi Dave,
>
> Hmm I'm  not sure whether the behaviour you explained is possible.
>
> If you look at the getProperty() method on the MessageContext class [1], its
> clear that the property fetched from the options instance of the particular
> MessageContext instance.
>
> Thanks,
> Ruchith
>
> [1]
> https://svn.apache.org/repos/asf/webservices/axis2/trunk/java/modules/core/s
> rc/org/apache/axis2/context/MessageContext.java
>
> On 8/8/06, Dave Cowing <dc...@enpresence.com> wrote:
> > Ruchith,
> > Thanks.
> > The odd thing is that in the example you refer to, the RECV_RESULTS
> > vector comes from the message context properties.
> >
> > When I run axis, there are no properties in the message context, but
> > if I get the options (msgCtx.getOptions()) from the message context, I
> > can get the RECV_RESULTS vector from the
> > options.getProperty(WSHandlerConstants.RECV_RESULTS).
> >
> > Is this how it's supposed to behave?
> >
> > Best,
> > Dave
> >
> >
> > -----Original Message-----
> > From: Ruchith Fernando [mailto:ruchith.fernando@gmail.com]
> > Sent: Tuesday, August 08, 2006 1:55 AM
> > To: axis-user@ws.apache.org
> > Subject: Re: [axis2] User credentials in service
> >
> > Hi Dave,
> >
> > This [1] should solve your problem:
> >
> > [1] http://www.wso2.net/kb/169
> >
> > Thanks,
> > Ruchith
> >
> > On 8/8/06, Dave Cowing <dc...@enpresence.com> wrote:
> > >
> > >
> > > I've been getting acquainted with Rampart and understand a bunch of
> > > it (thanks to Ruchith for his great tutorial).
> > >
> > > Now I have a question: How can I access user credentials (either the
> > > signature or a username) in my service?
> > >
> > > I'm performing a transaction and need to ensure that I use the
> > > identity I've authenticated in that transaction.
> > >
> > >
> > > Thanks,
> > > Dave
> >
> >
> > --
> > www.ruchith.org
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> > For additional commands, e-mail: axis-user-help@ws.apache.org
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> > For additional commands, e-mail: axis-user-help@ws.apache.org
> >
> >
>
>
> --
> www.ruchith.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>


-- 
www.ruchith.org

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


RE: [axis2] User credentials in service

Posted by Dave Cowing <dc...@enpresence.com>.
Ruchith,

You're right.  Interestingly, when I call getProperties on MessageContect
(inherited from AbstractContext), it pulls the properties from the context
object (not from the options):
    public Map getProperties() {
        return properties;
    }

The behavior seems inconsistant (I would have expected the two methods to
pull consistant properties) - but I can move on with the getProperty(key)
method you've pointed out.

Best,
Dave 

-----Original Message-----
From: Ruchith Fernando [mailto:ruchith.fernando@gmail.com] 
Sent: Tuesday, August 08, 2006 11:19 AM
To: axis-user@ws.apache.org
Subject: Re: [axis2] User credentials in service

Hi Dave,

Hmm I'm  not sure whether the behaviour you explained is possible.

If you look at the getProperty() method on the MessageContext class [1], its
clear that the property fetched from the options instance of the particular
MessageContext instance.

Thanks,
Ruchith

[1]
https://svn.apache.org/repos/asf/webservices/axis2/trunk/java/modules/core/s
rc/org/apache/axis2/context/MessageContext.java

On 8/8/06, Dave Cowing <dc...@enpresence.com> wrote:
> Ruchith,
> Thanks.
> The odd thing is that in the example you refer to, the RECV_RESULTS 
> vector comes from the message context properties.
>
> When I run axis, there are no properties in the message context, but 
> if I get the options (msgCtx.getOptions()) from the message context, I 
> can get the RECV_RESULTS vector from the 
> options.getProperty(WSHandlerConstants.RECV_RESULTS).
>
> Is this how it's supposed to behave?
>
> Best,
> Dave
>
>
> -----Original Message-----
> From: Ruchith Fernando [mailto:ruchith.fernando@gmail.com]
> Sent: Tuesday, August 08, 2006 1:55 AM
> To: axis-user@ws.apache.org
> Subject: Re: [axis2] User credentials in service
>
> Hi Dave,
>
> This [1] should solve your problem:
>
> [1] http://www.wso2.net/kb/169
>
> Thanks,
> Ruchith
>
> On 8/8/06, Dave Cowing <dc...@enpresence.com> wrote:
> >
> >
> > I've been getting acquainted with Rampart and understand a bunch of 
> > it (thanks to Ruchith for his great tutorial).
> >
> > Now I have a question: How can I access user credentials (either the 
> > signature or a username) in my service?
> >
> > I'm performing a transaction and need to ensure that I use the 
> > identity I've authenticated in that transaction.
> >
> >
> > Thanks,
> > Dave
>
>
> --
> www.ruchith.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>


--
www.ruchith.org

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



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


Re: [axis2] User credentials in service

Posted by Ruchith Fernando <ru...@gmail.com>.
Hi Dave,

Hmm I'm  not sure whether the behaviour you explained is possible.

If you look at the getProperty() method on the MessageContext class
[1], its clear that the property fetched from the options instance of
the particular MessageContext instance.

Thanks,
Ruchith

[1] https://svn.apache.org/repos/asf/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/context/MessageContext.java

On 8/8/06, Dave Cowing <dc...@enpresence.com> wrote:
> Ruchith,
> Thanks.
> The odd thing is that in the example you refer to, the RECV_RESULTS vector
> comes from the message context properties.
>
> When I run axis, there are no properties in the message context, but if I
> get the options (msgCtx.getOptions()) from the message context, I can get
> the RECV_RESULTS vector from the
> options.getProperty(WSHandlerConstants.RECV_RESULTS).
>
> Is this how it's supposed to behave?
>
> Best,
> Dave
>
>
> -----Original Message-----
> From: Ruchith Fernando [mailto:ruchith.fernando@gmail.com]
> Sent: Tuesday, August 08, 2006 1:55 AM
> To: axis-user@ws.apache.org
> Subject: Re: [axis2] User credentials in service
>
> Hi Dave,
>
> This [1] should solve your problem:
>
> [1] http://www.wso2.net/kb/169
>
> Thanks,
> Ruchith
>
> On 8/8/06, Dave Cowing <dc...@enpresence.com> wrote:
> >
> >
> > I've been getting acquainted with Rampart and understand a bunch of it
> > (thanks to Ruchith for his great tutorial).
> >
> > Now I have a question: How can I access user credentials (either the
> > signature or a username) in my service?
> >
> > I'm performing a transaction and need to ensure that I use the
> > identity I've authenticated in that transaction.
> >
> >
> > Thanks,
> > Dave
>
>
> --
> www.ruchith.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>


-- 
www.ruchith.org

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


RE: [axis2] User credentials in service

Posted by Dave Cowing <dc...@enpresence.com>.
Ruchith,
Thanks.
The odd thing is that in the example you refer to, the RECV_RESULTS vector
comes from the message context properties.

When I run axis, there are no properties in the message context, but if I
get the options (msgCtx.getOptions()) from the message context, I can get
the RECV_RESULTS vector from the
options.getProperty(WSHandlerConstants.RECV_RESULTS).

Is this how it's supposed to behave?

Best,
Dave
 

-----Original Message-----
From: Ruchith Fernando [mailto:ruchith.fernando@gmail.com] 
Sent: Tuesday, August 08, 2006 1:55 AM
To: axis-user@ws.apache.org
Subject: Re: [axis2] User credentials in service

Hi Dave,

This [1] should solve your problem:

[1] http://www.wso2.net/kb/169

Thanks,
Ruchith

On 8/8/06, Dave Cowing <dc...@enpresence.com> wrote:
>
>
> I've been getting acquainted with Rampart and understand a bunch of it 
> (thanks to Ruchith for his great tutorial).
>
> Now I have a question: How can I access user credentials (either the 
> signature or a username) in my service?
>
> I'm performing a transaction and need to ensure that I use the 
> identity I've authenticated in that transaction.
>
>
> Thanks,
> Dave


--
www.ruchith.org

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



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


Re: [axis2] User credentials in service

Posted by Ruchith Fernando <ru...@gmail.com>.
Hi Dave,

This [1] should solve your problem:

[1] http://www.wso2.net/kb/169

Thanks,
Ruchith

On 8/8/06, Dave Cowing <dc...@enpresence.com> wrote:
>
>
> I've been getting acquainted with Rampart and understand a bunch of it
> (thanks to Ruchith for his great tutorial).
>
> Now I have a question: How can I access user credentials (either the
> signature or a username) in my service?
>
> I'm performing a transaction and need to ensure that I use the identity I've
> authenticated in that transaction.
>
>
> Thanks,
> Dave


-- 
www.ruchith.org

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