Hi Andrew,
HTTP Basic Auth is different from UsernameToken.
This is how you handle HTTP Basic Auth [1]
UsernameToken can be added in two ways, i.e. by using policy or
inflow/outflow configs.
If you want to use policy please refer
samples/policy/sample01/policy.xml.
If you want to use inflow/outflow config please refer
samples/basic/sample02. Here is a good article about it[2]
Regards,
Dimuthu
[1]
HttpTransportProperties.Authenticator auth = new
HttpTransportProperties.Authenticator();
auth.setPreemptiveAuthentication(true);
auth.setAuthSchemes(authSchemes);
auth.setUsername("username");
auth.setPassword("password");
Options options = serviceClient.getOptions();
options.setProperty(HTTPConstants.AUTHENTICATE, auth);
serviceClient.setOptions(options);
[2]http://wso2.org/library/240
On Tue, 2007-07-24 at 06:01 -0700, Andrew Fielden wrote:
> Hi,
>
> I'm trying to use a WS Policy file with Rampart. If I wish to enable
> basic authentication for outflow, the RampartConfig section of the
> ws-policy will look like this:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <wsp:Policy 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>alice</ramp:user>
> <ramp:passwordCallbackClass>InboundPWCallbackHandler
> </ramp:passwordCallbackClass>
> </ramp:RampartConfig>
> </wsp:All>
> </wsp:ExactlyOne>
> </wsp:Policy>
>
>
> My question is, suppose I wish to specify a user for basic
> authentication Inflow. How do I differentiate between usernames for
> basic authentication in both directions (inflow and outflow)?
> There is only one ramp:user element.
>
> Thanks.
> Andrew.
>
>