STSConfiguration config = new PicketLinkSTSConfiguration(stsType);
WSTrustServiceFactory factory = WSTrustServiceFactory.getInstance();
// tests the creation of the request handler.
WSTrustRequestHandler handler = factory.createRequestHandler(
"org.picketlink.identity.federation.core.wstrust.StandardRequestHandler", config);
assertNotNull("Unexpected null request handler", handler);
assertTrue("Unexpected request handler type", handler instanceof StandardRequestHandler);
InputStream is = getClass().getClassLoader().getResourceAsStream("wstrust/wstrust-rst-usekey.xml");
assertNotNull(is);
WSTrustParser parser = new WSTrustParser();
RequestSecurityToken token = (RequestSecurityToken) parser.parse(is);
RequestSecurityTokenResponse response = handler.issue(token, new Principal() {
@Override
public String getName() {
return "testuser";
}
});