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 Deep455 <f2...@gmail.com> on 2008/08/14 11:52:12 UTC

AXIS2 WS-Security

I have created a client for a web service(with ws-securtiy). How do I pass
the security token in the soap header?
-- 
View this message in context: http://www.nabble.com/AXIS2-WS-Security-tp18978756p18978756.html
Sent from the Axis - User mailing list archive at Nabble.com.


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


RE: AXIS2 WS-Security

Posted by Martin Gainty <mg...@hotmail.com>.
Here is RampartConfig which configures the client authenticator to use keystores
(services.xml)
<Service name="test">
    <messageReceiver class="org.apache.rahas.STSMessageReceiver"/>

        <!-- Action mapping to accept SCT requests -->
        <actionMapping>http://schemas.xmlsoap.org/ws/2005/02/trust/RST/SCT</actionMapping>

        <actionMapping>http://schemas.xmlsoap.org/ws/2005/02/trust/RST/Issue</actionMapping>
        <actionMapping>http://schemas.xmlsoap.org/ws/2005/02/trust/RST/Renew</actionMapping>
        <actionMapping>http://schemas.xmlsoap.org/ws/2005/02/trust/RST/Cancel</actionMapping>
        <actionMapping>http://schemas.xmlsoap.org/ws/2005/02/trust/RST/SCT/Cancel</actionMapping>
        <actionMapping>http://schemas.xmlsoap.org/ws/2005/02/trust/RST/Validate</actionMapping>
        
    </operation>
    
<!-- Using the config file -->
<parameter name="token-dispatcher-configuration-file">META-INF/token-dispatcher-configuration.xml</parameter>

<!-- Configure Rampart to authenticate clients -->
<wsp:Policy wsu:Id="SigOnly" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
        <wsp:ExactlyOne>
            <wsp:All>                
                <ramp:RampartConfig xmlns:ramp="http://ws.apache.org/rampart/policy"> 
                
                    <ramp:user>ip</ramp:user>
                    <ramp:encryptionUser>useReqSigCert</ramp:encryptionUser>
                    <ramp:passwordCallbackClass>PWCBHandler</ramp:passwordCallbackClass>
                    
                    <ramp:signatureCrypto>
                        <ramp:crypto provider="org.apache.ws.security.components.crypto.Merlin">
                            <ramp:property name="org.apache.ws.security.crypto.merlin.keystore.type">JKS</ramp:property>
                            <ramp:property name="org.apache.ws.security.crypto.merlin.file">META-INF/rahas-sts.jks</ramp:property>
                            <ramp:property name="org.apache.ws.security.crypto.merlin.keystore.password">password</ramp:property>
                        </ramp:crypto>
                    </ramp:signatureCrypto>
                
                </ramp:RampartConfig>
    

Martin Gainty 

______________________________________________ 
Disclaimer and confidentiality note 
Everything in this e-mail and any attachments relates to the official business of Sender. This transmission is of a confidential nature and Sender does not endorse distribution to any party other than intended recipient. Sender does not necessarily endorse content contained within this transmission. 


> From: Sanjay.Vivek@newcastle.ac.uk
> To: axis-user@ws.apache.org
> Date: Fri, 15 Aug 2008 09:14:16 +0100
> Subject: RE: AXIS2 WS-Security
> 
> Yes, you can do this programatically by using the policy based approach to implement Rampart enabled services. There's a good tutorial on the topic at [1]. Cheers.
> 
> 1 - http://wso2.org/library/3190
> 
> Regards
> Sanjay
> 
> >-----Original Message-----
> >From: Deep455 [mailto:f2002455@gmail.com]
> >Sent: 15 August 2008 09:09
> >To: axis-user@ws.apache.org
> >Subject: RE: AXIS2 WS-Security
> >
> >
> >Thanks Sanjay
> >Iam able to run the stanalone client using rampart libraries
> >and mar file.
> >Currently Iam using axis2 configuration file for username and password.
> >Can I do this programatically with out using teh configuration file ?
> >I have used outflowconfiguration below and its working fine.
> >OutflowConfiguration ofc = new OutflowConfiguration();
> >                        ofc.setActionItems("UsernameToken");
> >                        ofc.setPasswordType(WSConstants.PW_TEXT);
> >                        ofc.setUser("UserName");
> >
> >
> >options.setProperty(WSSHandlerConstants.OUTFLOW_SECURITY,ofc.ge
> >tProperty());
> >
> >                        PWCBHandler myCallback=new PWCBHandler();
> >                        myCallback.setUser("userName");
> >                        myCallback.setPass("Password");
> >
> >options.setProperty(WSHandlerConstants.PW_CALLBACK_REF, myCallback);
> >
> >BUt Outflowconfiguration seems to be depracted with rampart 1.3.
> >
> >How do I do this using RampartConfig class?
> >
> >
> >
> >
> >--
> >View this message in context:
> >http://www.nabble.com/AXIS2-WS-Security-tp18978756p18995269.html
> >Sent from the Axis - User mailing list archive at Nabble.com.
> >
> >
> >---------------------------------------------------------------------
> >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
> 

_________________________________________________________________
See what people are saying about Windows Live.  Check out featured posts.
http://www.windowslive.com/connect?ocid=TXT_TAGLM_WL_connect2_082008

RE: AXIS2 WS-Security

Posted by Sanjay Vivek <Sa...@newcastle.ac.uk>.
Yes, you can do this programatically by using the policy based approach to implement Rampart enabled services. There's a good tutorial on the topic at [1]. Cheers.

1 - http://wso2.org/library/3190

Regards
Sanjay

>-----Original Message-----
>From: Deep455 [mailto:f2002455@gmail.com]
>Sent: 15 August 2008 09:09
>To: axis-user@ws.apache.org
>Subject: RE: AXIS2 WS-Security
>
>
>Thanks Sanjay
>Iam able to run the stanalone client using rampart libraries
>and mar file.
>Currently Iam using axis2 configuration file for username and password.
>Can I do this programatically with out using teh configuration file ?
>I have used outflowconfiguration below and its working fine.
>OutflowConfiguration ofc = new OutflowConfiguration();
>                        ofc.setActionItems("UsernameToken");
>                        ofc.setPasswordType(WSConstants.PW_TEXT);
>                        ofc.setUser("UserName");
>
>
>options.setProperty(WSSHandlerConstants.OUTFLOW_SECURITY,ofc.ge
>tProperty());
>
>                        PWCBHandler myCallback=new PWCBHandler();
>                        myCallback.setUser("userName");
>                        myCallback.setPass("Password");
>
>options.setProperty(WSHandlerConstants.PW_CALLBACK_REF, myCallback);
>
>BUt Outflowconfiguration seems to be depracted with rampart 1.3.
>
>How do I do this using RampartConfig class?
>
>
>
>
>--
>View this message in context:
>http://www.nabble.com/AXIS2-WS-Security-tp18978756p18995269.html
>Sent from the Axis - User mailing list archive at Nabble.com.
>
>
>---------------------------------------------------------------------
>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 WS-Security

Posted by Deep455 <f2...@gmail.com>.
Thanks Sanjay
Iam able to run the stanalone client using rampart libraries and mar file. 
Currently Iam using axis2 configuration file for username and password. 
Can I do this programatically with out using teh configuration file ?
I have used outflowconfiguration below and its working fine.
OutflowConfiguration ofc = new OutflowConfiguration();
			ofc.setActionItems("UsernameToken");
			ofc.setPasswordType(WSConstants.PW_TEXT);
			ofc.setUser("UserName");
			
		
options.setProperty(WSSHandlerConstants.OUTFLOW_SECURITY,ofc.getProperty());

			PWCBHandler myCallback=new PWCBHandler();
			myCallback.setUser("userName");
			myCallback.setPass("Password");
			options.setProperty(WSHandlerConstants.PW_CALLBACK_REF, myCallback);

BUt Outflowconfiguration seems to be depracted with rampart 1.3. 

How do I do this using RampartConfig class?




-- 
View this message in context: http://www.nabble.com/AXIS2-WS-Security-tp18978756p18995269.html
Sent from the Axis - User mailing list archive at Nabble.com.


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


RE: AXIS2 WS-Security

Posted by Sanjay Vivek <Sa...@newcastle.ac.uk>.
Hi Pradeep,

I don't think it really matters if the service uses Rampart since Rampart merely implements WS-Security standards. It is the open source implementation of WS-Security standards. So as long as both the service and the client supports WS-Security standards, it shouldn't matter what the web service implementation stack is.

You could look at the wsdl of the service and find out the requirements of the service by looking at the policy side of things. Cheers.

Regards
Sanjay

>-----Original Message-----
>From: Deep455 [mailto:f2002455@gmail.com]
>Sent: 14 August 2008 12:39
>To: axis-user@ws.apache.org
>Subject: Re: AXIS2 WS-Security
>
>
>Thanks for the information.
>Iam not sure whether rampart is used on the webservice server
>side. I want to consume these services so is it possible for
>me to set the security token w/o using rampart.
>
>Incase rampart has to be used,
>my client is java based(not a web application). I have
>generated the client stubs using wsdl2java from Axis2-1.3.
>Please let me know what do i need to do?
>
>Regards
>Pradeep
>
>
>Nunny wrote:
>>
>> You can you Apache Rampart [1], Axis2 security module.
>>
>> These two tutorials may also help.
>> http://www.wso2.org/library/3190
>> http://www.wso2.org/library/3415
>>
>> thanks,
>> nandana
>>
>> [1] -  http://ws.apache.org/rampart/
>>
>>
>>
>> On Thu, Aug 14, 2008 at 3:22 PM, Deep455 <f2...@gmail.com> wrote:
>>
>>>
>>> I have created a client for a web service(with
>ws-securtiy). How do I
>>> pass the security token in the soap header?
>>> --
>>> View this message in context:
>>> http://www.nabble.com/AXIS2-WS-Security-tp18978756p18978756.html
>>> Sent from the Axis - User mailing list archive at Nabble.com.
>>>
>>>
>>>
>---------------------------------------------------------------------
>>> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
>>> For additional commands, e-mail: axis-user-help@ws.apache.org
>>>
>>>
>>
>>
>> --
>> Nandana Mihindukulasooriya
>> WSO2 inc.
>>
>> http://nandana83.blogspot.com/
>> http://www.wso2.org
>>
>>
>
>--
>View this message in context:
>http://www.nabble.com/AXIS2-WS-Security-tp18978756p18979919.html
>Sent from the Axis - User mailing list archive at Nabble.com.
>
>
>---------------------------------------------------------------------
>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 WS-Security

Posted by Deep455 <f2...@gmail.com>.
Thanks for the information.
Iam not sure whether rampart is used on the webservice server side. I want
to consume these services so is it possible for me to set the security token
w/o using rampart.

Incase rampart has to be used, 
my client is java based(not a web application). I have generated the client
stubs using wsdl2java from Axis2-1.3. Please let me know what do i need to
do?

Regards
Pradeep


Nunny wrote:
> 
> You can you Apache Rampart [1], Axis2 security module.
> 
> These two tutorials may also help.
> http://www.wso2.org/library/3190
> http://www.wso2.org/library/3415
> 
> thanks,
> nandana
> 
> [1] -  http://ws.apache.org/rampart/
> 
> 
> 
> On Thu, Aug 14, 2008 at 3:22 PM, Deep455 <f2...@gmail.com> wrote:
> 
>>
>> I have created a client for a web service(with ws-securtiy). How do I
>> pass
>> the security token in the soap header?
>> --
>> View this message in context:
>> http://www.nabble.com/AXIS2-WS-Security-tp18978756p18978756.html
>> Sent from the Axis - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
>> For additional commands, e-mail: axis-user-help@ws.apache.org
>>
>>
> 
> 
> -- 
> Nandana Mihindukulasooriya
> WSO2 inc.
> 
> http://nandana83.blogspot.com/
> http://www.wso2.org
> 
> 

-- 
View this message in context: http://www.nabble.com/AXIS2-WS-Security-tp18978756p18979919.html
Sent from the Axis - User mailing list archive at Nabble.com.


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


Re: AXIS2 WS-Security

Posted by Nandana Mihindukulasooriya <na...@gmail.com>.
You can you Apache Rampart [1], Axis2 security module.

These two tutorials may also help.
http://www.wso2.org/library/3190
http://www.wso2.org/library/3415

thanks,
nandana

[1] -  http://ws.apache.org/rampart/



On Thu, Aug 14, 2008 at 3:22 PM, Deep455 <f2...@gmail.com> wrote:

>
> I have created a client for a web service(with ws-securtiy). How do I pass
> the security token in the soap header?
> --
> View this message in context:
> http://www.nabble.com/AXIS2-WS-Security-tp18978756p18978756.html
> Sent from the Axis - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>


-- 
Nandana Mihindukulasooriya
WSO2 inc.

http://nandana83.blogspot.com/
http://www.wso2.org