Hi Hardev,
We have an example that may help you (we don´t know exactly if is the same
case):
We invoke a STS service that provide us with a SAML token into a Token
object.
After this, we invoke the Service Provider using the SAML token obtained
previously.

>>>>>>>>>You can do this with these lines of code:
Token responseToken = getSecurityResponseToken(context, policysec, stsEPR,
properties);
options.setProperty(RampartMessageData.KEY_CUSTOM_ISSUED_TOKEN,
responseToken.getId());context, policysec, stsEPR, properties);
options.setProperty(RampartMessageData.KEY_CUSTOM_ISSUED_TOKEN,
responseToken.getId)); KEY_CUSTOM_ISSUED_TOKEN, responseToken.getId());

>>>>>>>>>>>>>And use the service client including these options.
sender = new ServiceClient(ctx, null);new ServiceClient(ctx, null);
sender.setOptions(options);


>>>>>>>>>>>>>where the method getSecurityResponseToken is the following:
private Token getSecurityResponseToken(ConfigurationContext ctx, Policy
servicePolicy, String stsEPR, Properties properties) throws
CTLDataException{
Token responseToken=null;
STSClient stsClient;
try {
Policy stsPolicy = loadPolicy(properties,properties.getProperty(
ConstantsUtils.STSPOLICY));
stsClient = new STSClient(ctx);
stsClient.setRstTemplate(getRSTTemplate());
String action = TrustUtil.getActionValue(ConstantsUtils.RAHASVERSION,
RahasConstants.RST_ACTION_ISSUE);
stsClient.setAction(action);
responseToken = stsClient.requestSecurityToken(servicePolicy, stsEPR,
stsPolicy, null);
} catch (TrustException e) {
logger.error(e.getMessage() + ". Not possible to obtain security token");
} catch (Exception e) {
logger.error(e.getMessage() + ". Not possible to obtain security token");
}
return responseToken;
}

You have to take into account that the service will be invoked inmediately
after the STS is received.

We hope this helps,
good luck!

Reply via email to