You are viewing a plain text version of this content. The canonical link for it is here.
Posted to rampart-dev@ws.apache.org by "Nico Hoogervorst (JIRA)" <ji...@apache.org> on 2009/06/02 14:30:07 UTC

[jira] Created: (RAMPART-229) There should be a way to add custom tokens to the security header

There should be a way to add custom tokens to the security header
-----------------------------------------------------------------

                 Key: RAMPART-229
                 URL: https://issues.apache.org/jira/browse/RAMPART-229
             Project: Rampart
          Issue Type: New Feature
    Affects Versions: 1.4
         Environment: AXIS2 1.41 ServiceClient, rampart 1.4
            Reporter: Nico Hoogervorst
            Assignee: Ruchith Udayanga Fernando
             Fix For: 1.4


There should be a way to add custom tokens to the security header. 
Currently standard tokens like the UsernameToken are supported, but there are web services that require a custom token.
Preferable this would done with an option on the ServiceClient.

For example, for the Government Gateway Portal Interface, a GatewayToken must be put in the SOAP header security element. 
The GatewayToken is a custom token.

The soap header looks like this:

   <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
      <soapenv:Header>
         <wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
            <wsu:Timestamp xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="Timestamp-d95c4027-cc1a-4c47-94b3-6dc78f46da38">
               <wsu:Created>2009-06-02T12:00:37Z</wsu:Created>
               <wsu:Expires>2009-06-02T12:05:37Z</wsu:Expires>
            </wsu:Timestamp>
            <gateway:GatewayToken xmlns:gateway="urn:GSO-System-Services:external:1.65:gatewaytoken" gateway:TokenId="SecurityToken-4fb0910a-2102-44d1-b8c2-d5f8c14231de">
               <gateway:Created>2009-06-02T12:00:36Z</gateway:Created>
               <gateway:Expires>2009-06-02T16:00:36Z</gateway:Expires>
               <gateway:Usage>Standard</gateway:Usage>
               <gateway:Opaque>qwac=</gateway:Opaque>
            </gateway:GatewayToken>
         </wsse:Security>
         <wsa:To xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/03/addressing">http://www.gateway.gov.uk/soap/2007/02/portal</wsa:To>
         <wsa:ReplyTo xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/03/addressing">
            <wsa:Address>http://schemas.xmlsoap.org/ws/2004/03/addressing/role/anonymous</wsa:Address>
         </wsa:ReplyTo>
         <wsa:Action xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/03/addressing">http://www.gateway.gov.uk/soap/2007/02/portal/GsoEnrol</wsa:Action>
         <wsa:MessageID xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/03/addressing">uuid:84825f4d-4ec1-44f8-bb70-cf3fc65001f7</wsa:MessageID>
      </soapenv:Header>



-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Re: [jira] Created: (RAMPART-229) There should be a way to add custom tokens to the security header

Posted by Håkon Sagehaug <Ha...@bccs.uib.no>.
Hi

Not sure, I might be wrong, but I thought one could add all type of token,
as long as the token has an id attribute of type xml schema ID, with code
similar to this

ServiceClient client = stub._getServiceClient();
Options endOptions = new Options();
endOptions.setProperty(RampartMessageData.KEY_CUSTOM_ISSUED_TOKEN,
                token.getId());
        client.setOptions(endOptions);

Where token is of type org.apache.rahas.Token

Håkon

2009/6/2 Nico Hoogervorst (JIRA) <ji...@apache.org>

> There should be a way to add custom tokens to the security header
> -----------------------------------------------------------------
>
>                 Key: RAMPART-229
>                 URL: https://issues.apache.org/jira/browse/RAMPART-229
>             Project: Rampart
>          Issue Type: New Feature
>    Affects Versions: 1.4
>         Environment: AXIS2 1.41 ServiceClient, rampart 1.4
>            Reporter: Nico Hoogervorst
>            Assignee: Ruchith Udayanga Fernando
>             Fix For: 1.4
>
>
> There should be a way to add custom tokens to the security header.
> Currently standard tokens like the UsernameToken are supported, but there
> are web services that require a custom token.
> Preferable this would done with an option on the ServiceClient.
>
> For example, for the Government Gateway Portal Interface, a GatewayToken
> must be put in the SOAP header security element.
> The GatewayToken is a custom token.
>
> The soap header looks like this:
>
>   <soapenv:Envelope xmlns:soapenv="
> http://schemas.xmlsoap.org/soap/envelope/">
>      <soapenv:Header>
>         <wsse:Security xmlns:wsse="
> http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd
> ">
>            <wsu:Timestamp xmlns:wsu="
> http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
> wsu:Id="Timestamp-d95c4027-cc1a-4c47-94b3-6dc78f46da38">
>               <wsu:Created>2009-06-02T12:00:37Z</wsu:Created>
>               <wsu:Expires>2009-06-02T12:05:37Z</wsu:Expires>
>            </wsu:Timestamp>
>            <gateway:GatewayToken
> xmlns:gateway="urn:GSO-System-Services:external:1.65:gatewaytoken"
> gateway:TokenId="SecurityToken-4fb0910a-2102-44d1-b8c2-d5f8c14231de">
>               <gateway:Created>2009-06-02T12:00:36Z</gateway:Created>
>               <gateway:Expires>2009-06-02T16:00:36Z</gateway:Expires>
>               <gateway:Usage>Standard</gateway:Usage>
>               <gateway:Opaque>qwac=</gateway:Opaque>
>            </gateway:GatewayToken>
>         </wsse:Security>
>         <wsa:To xmlns:wsa="
> http://schemas.xmlsoap.org/ws/2004/03/addressing">
> http://www.gateway.gov.uk/soap/2007/02/portal</wsa:To>
>         <wsa:ReplyTo xmlns:wsa="
> http://schemas.xmlsoap.org/ws/2004/03/addressing">
>            <wsa:Address>
> http://schemas.xmlsoap.org/ws/2004/03/addressing/role/anonymous
> </wsa:Address>
>         </wsa:ReplyTo>
>         <wsa:Action xmlns:wsa="
> http://schemas.xmlsoap.org/ws/2004/03/addressing">
> http://www.gateway.gov.uk/soap/2007/02/portal/GsoEnrol</wsa:Action>
>         <wsa:MessageID xmlns:wsa="
> http://schemas.xmlsoap.org/ws/2004/03/addressing
> ">uuid:84825f4d-4ec1-44f8-bb70-cf3fc65001f7</wsa:MessageID>
>      </soapenv:Header>
>
>
>
> --
> This message is automatically generated by JIRA.
> -
> You can reply to this email to add a comment to the issue online.
>
>


-- 
Håkon Sagehaug, Scientific Programmer
Parallab, Bergen Center for Computational Science (BCCS)
UNIFOB AS (University of Bergen Research Company)