Skip to Content
avatar image
Former Member

dynamic username and password for UsernameToken in Receiver Soap Adapter.

Hi All,

I am using AXIS Frame work for WS Security Authentication in Receiver SOAP channel. I deployed AXIS and used WSDoAllSender handler. I want to set the username and password parameters in the module dynamically. These have to be extracted from the payload.

kindly give me pointers to dynamically assign Username and Password.

Regards,

Saipriya.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • avatar image
    Former Member
    Apr 06, 2010 at 02:04 PM

    Hi,

    Have you looked at the OSS note #1039369 (Axis FAQ), there is an attachment with a lot of useful info and example (you might be interested in "How can I configure a channel to use the UsernameToken authentication of WS-Security?") ?

    Rgds

    Chris

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Apr 13, 2010 at 09:05 PM

    Hi Saipriya,

    Here is how you can configure a series of handlers to generate the UsernameToken security header with the username and password contained in the message.

    For details, you should refer to the Axis adapter FAQ note. There are a few examples of how to use the described handlers. Below I am sketching the configuration.

    First, you need to place a data extraction handler to extract your user and password and set them to the axis's message context. Depending on where in the message you have put your data, there are several options. Here, assuming you have them in the dynamic configuration header, you can use the XI30DynamicConfigurationHandle handler to do this job. Using this handler, you can extract your username and set it to the context property user and extract your password and set it to the context property password. This handler must precede the first XI30OutboundHandler. After this handler, you place the WSDoAllSender handler to generate the UsernameToken. Finally, this is followed by the transport handler.

    Best regards, Yza

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi Saipriya,

      Yes. It is the same mechanism.

      You can use any namespace and name for your ASMA property because the dynamic configuration handler can read any ASMA property.

      In this case, using the handler, you just need to read your parameter and set its value to the appropriate axis context property.

      The user name is represented by property javax.xml.rpc.security.auth.username.

      The password is represented by property javax.xml.rpc.security.auth.password

      You can find other context properties in the axis documentation:

      http://ws.apache.org/axis/java/apiDocs/constant-values.html

      You find some examples in the axis adapter FAQ note.

      Regards, Yza