}
}
public Element testSTS() throws Exception
{
WSTrustClient client = new WSTrustClient("PicketLinkSTS", "PicketLinkSTSPort",
"http://localhost:8080/picketlink-sts/PicketLinkSTS",
new SecurityInfo("UserB", "PassB"));
Element assertion = null;
try
{
RequestSecurityToken request = new RequestSecurityToken();
request.setTokenType(URI.create(SAMLUtil.SAML2_TOKEN_TYPE));
AttributedString as = new AttributedString();
as.setValue("UserA");
as.setId("UserA");
UsernameTokenType utt = new UsernameTokenType();
utt.setUsername(as);
utt.setId("UserA");
OnBehalfOfType obot = new OnBehalfOfType();
obot.add(utt);
request.setOnBehalfOf(obot);
assertion = client.issueToken(request);
}
catch (WSTrustException wse)
{
log.error("Unable to issue assertion: ", wse);
}