use of com.sun.identity.saml.protocol.AssertionArtifact in project OpenAM by OpenRock.
the class SAMLAwareServlet method createArtifact.
/**
* Creates a list of AssertionArtifact's id.
*
* @param sso the user Session object
* @param target A String representing the target host
* @param targetUrl A URL String representing the target site
* @param version The relying party preferred Assertion version number
* @return a List representing a list of AssertionArtifact's id
* @throws SAMLException if there is an error.
*/
private List createArtifact(Object sso, String target, HttpServletRequest request, HttpServletResponse response, String targetUrl, String version) throws SAMLException {
if (sso == null || target == null || target.length() == 0 || version == null || version.length() == 0) {
throw new SAMLException(SAMLUtils.bundle.getString("createArtifactError"));
}
List artifactList = new ArrayList();
AssertionManager assertManager = AssertionManager.getInstance();
try {
SessionProvider sessionProvider = SessionManager.getProvider();
AssertionArtifact artifact = assertManager.createAssertionArtifact(sessionProvider.getSessionID(sso), target, request, response, targetUrl, version);
if (SAMLUtils.debug.messageEnabled()) {
SAMLUtils.debug.message("AssertionArtifact id = " + artifact.toString());
}
String artid = artifact.getAssertionArtifact();
artifactList.add(artid);
} catch (SessionException se) {
SAMLUtils.debug.error("Couldn't get SessionProvider.");
throw new SAMLException(SAMLUtils.bundle.getString("nullSessionProvider"));
}
return artifactList;
}
Aggregations