You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-user@axis.apache.org by Vivian Wang <vi...@yahoo.com> on 2009/03/06 01:12:58 UTC
rampart/c usage get-started questions
Hi There,
I am starting to use rampart/c for ws-security purpose together with axis2/c in a web service client application. I have the following get-me-started questions:
(1) As a web service client, all the security configurations can be done in a policy file, there is no need to programmatically set the security parameters in my source code, all I need to do is to set the policy file location when I create the web service client. Is this right?
I am asking this because when I browsed the rampart/c sample source code, I noticed that in some samples like saml_echo, you created a saml assertion and set it into client config, like this:
assertion = create_saml_assertion(env);
saml = rampart_saml_token_create(env, assertion, RAMPART_ST_CONFIR_TYPE_SENDER_VOUCHES);
rampart_saml_token_set_token_type(saml, env, RP_PROPERTY_SIGNED_SUPPORTING_TOKEN);
rampart_config_add_saml_token(client_config, env, saml);
Can this be done in the policy configuration file so I don't have to do this in my source code?
(2) And vice versa, can all the ws-securiy parameters done configured programmatically without using a policy file? I think for some applications, this will be more flexible.
(3) When I (the web service client) subscribe to several services from different service providers, can I have multiple policy files with one for each service? and similarly I one service contains several operations, can I have more than one policy files with one for each operation?
(4) With regard to ws-security username and password token, there is a parameter called password type, which can be Text or Digest. My question is this: If I choose to specify passwordType as Digest, can the actual password I set be in plainText? I mean in this case will rampart/c convert it into Digest format for me before sending? If I need to provide the Digest format, what algorithm should I use or what tool is available to me?
Thanks in advance for answering my newbie questions.
Vivian
Re: rampart/c usage get-started questions
Posted by Manjula Peiris <ma...@wso2.com>.
On Thu, 2009-03-05 at 16:12 -0800, Vivian Wang wrote:
> Hi There,
> I am starting to use rampart/c for ws-security purpose together with axis2/c in a web service client application. I have the following get-me-started questions:
>
> (1) As a web service client, all the security configurations can be done in a policy file, there is no need to programmatically set the security parameters in my source code, all I need to do is to set the policy file location when I create the web service client. Is this right?
> I am asking this because when I browsed the rampart/c sample source code, I noticed that in some samples like saml_echo, you created a saml assertion and set it into client config, like this:
>
> assertion = create_saml_assertion(env);
> saml = rampart_saml_token_create(env, assertion, RAMPART_ST_CONFIR_TYPE_SENDER_VOUCHES);
> rampart_saml_token_set_token_type(saml, env, RP_PROPERTY_SIGNED_SUPPORTING_TOKEN);
> rampart_config_add_saml_token(client_config, env, saml);
>
> Can this be done in the policy configuration file so I don't have to do this in my source code?
I think this can be done. Need to go through the code for an specific
answer.
>
> (2) And vice versa, can all the ws-securiy parameters done configured programmatically without using a policy file? I think for some applications, this will be more flexible.
You can't do this for all the policies. But [1] and [2] do this to a
some extent.
>
> (3) When I (the web service client) subscribe to several services from different service providers, can I have multiple policy files with one for each service? and similarly I one service contains several operations, can I have more than one policy files with one for each operation?
You can create different policies keep them and call
axis2_svc_client_set_policy() before invoking the service.
>
> (4) With regard to ws-security username and password token, there is a parameter called password type, which can be Text or Digest. My question is this: If I choose to specify passwordType as Digest, can the actual password I set be in plainText? I mean in this case will rampart/c convert it into Digest format for me before sending? If I need to provide the Digest format, what algorithm should I use or what tool is available to me?
Converting to digest is done by Rampart/C. You don't need to worry about
it.
[1] http://wso2.org/projects/wsclient
[2] http://wso2.org/projects/wsf/php
--
Manjula Peiris
Senior Software Engineer
WSO2 Inc.
Oxygenating the Web Service Platform.
http://wso2.org/
Blog: http://manjula-peiris.blogspot.com/