Hi

I managed to solve it, a bit sloppy work from my side, but now I've got a
different problem you might help me with

I call my sts secured service much like rampart sample 05, setting the
options like this


Token token = stsClient.requestSecurityToken(
                loadPolicy("policy/policy.xml"),
                "http://localhost:10000/axis2/services/EsysbioStSService";,
                loadPolicy("policy/sts_policy.xml"), null);

        TokenStorage store = TrustUtil.getTokenStore(ctx);
        store.add(token);
        System.out.println(token.getToken().toString());

        STSSecureEchoStub stub = new STSSecureEchoStub(ctx);

        ServiceClient client = stub._getServiceClient();
        Options endOptions = new Options();
        endOptions.setAction("http://bccs.uib.no/STSSecureService/SayHi";);
        endOptions.setTo(new EndpointReference(
                "http://localhost:10000/axis2/services/STSSecureEcho";));
        endOptions.setProperty(RampartMessageData.KEY_RAMPART_POLICY,
                loadPolicy("policy/policy.xml"));
        endOptions.setProperty(RampartMessageData.KEY_CUSTOM_ISSUED_TOKEN,
                token.getId());
        client.setOptions(endOptions);

but my service replays with

org.apache.rampart.RampartException: SAML Token missing in request

My supporting tokes element looks like this is the service.xml

<sp:SupportingTokens
                    xmlns:sp="
http://schemas.xmlsoap.org/ws/2005/07/securitypolicy";>
                    <wsp:Policy>
                        <sp:IssuedToken
                            sp:IncludeToken="
http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/AlwaysToRecipient
">
                            <Issuer xmlns="
http://schemas.xmlsoap.org/ws/2005/07/securitypolicy";>
                                <Address xmlns="
http://www.w3.org/2005/08/addressing";>

http://localhost:8080/axis2/services/StSService
                                </Address>
                            </Issuer>
                            <sp:RequestSecurityTokenTemplate>
                                <t:TokenType xmlns:t="
http://schemas.xmlsoap.org/ws/2005/02/trust";>
                                    urn:no:bccs:esysbio:user:role
                            </t:TokenType>
                                <t:KeyType xmlns:t="
http://schemas.xmlsoap.org/ws/2005/02/trust";>

http://schemas.xmlsoap.org/ws/2005/02/trust/SymmetricKey
                                        </t:KeyType>
                                <t:KeySize xmlns:t="
http://schemas.xmlsoap.org/ws/2005/02/trust";>256</t:KeySize>
                            </sp:RequestSecurityTokenTemplate>
                            <wsp:Policy>
                                <sp:RequireInternalReference />
                            </wsp:Policy>
                        </sp:IssuedToken>
                        <sp:SignedParts>
                            <sp:Header Name="To" Namespace="
http://www.w3.org/2005/08/addressing"; />
                        </sp:SignedParts>
                    </wsp:Policy>
                </sp:SupportingTokens>

I see that my token from the sts is inserted in the request, but it's not a
SAML token but should I not be able to pass in any token?

cheers, Håkon

2009/3/16 Nandana Mihindukulasooriya <[email protected]>

> Can you post the complete servcies.xml ?
>
> thanks,
> nandana
>
> 2009/3/16 Håkon Sagehaug <[email protected]>
>
> Hi all
>>
>> I've got a service with a policy with symmetric binding and a token that
>> is required form a sts service, calling the sts service and inserting the
>> token inside the new request to the service goes fine, but the response back
>> from the service is this
>>
>>  org.apache.ws.security.WSSecurityException: General security error
>> (WSSecurityEngine: No crypto propery file supplied for decryption)
>>
>> My rampart config element in  service.xml file looks like this
>>
>> <ramp:RampartConfig xmlns:ramp="http://ws.apache.org/rampart/policy";>
>>                         <ramp:user>service</ramp:user>
>>                         <ramp:encryptionUser>client</ramp:encryptionUser>
>>
>> <ramp:passwordCallbackClass>xPWCBHandler</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">
>>                                    service.jks
>>                             </ramp:property>
>>                                 <ramp:property
>>
>> name="org.apache.ws.security.crypto.merlin.keystore.password">service</ramp:property>
>>                             </ramp:crypto>
>>                         </ramp:signatureCrypto>
>>                         <ramp:encryptionCypto>
>>                             <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">service.jks</ramp:property>
>>                                 <ramp:property
>>
>> name="org.apache.ws.security.crypto.merlin.keystore.password">service</ramp:property>
>>                             </ramp:crypto>
>>                         </ramp:encryptionCypto>
>>                     </ramp:RampartConfig>
>>
>> So as far as I can see rampart has the needed configurations for
>> decryption properties needed, but I might be missing something, do I??
>>
>> cheers, Håkon
>>
>> --
>> Håkon Sagehaug, Scientific Programmer
>> Parallab, Bergen Center for Computational Science (BCCS)
>> UNIFOB AS (University of Bergen Research Company)
>>
>
>
>
> --
> Nandana Mihindukulasooriya
> WSO2 inc.
>
> http://nandana83.blogspot.com/
> http://www.wso2.org
>



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

Reply via email to