SecurityManager sm = System.getSecurityManager();
if (sm != null)
sm.checkPermission(PicketLinkCoreSTS.rte);
SAMLProtocolContext samlProtocolContext = (SAMLProtocolContext) context;
NameIDType issuerID = samlProtocolContext.getIssuerID();
XMLGregorianCalendar issueInstant;
try {
issueInstant = XMLTimeUtil.getIssueInstant();
} catch (ConfigurationException e) {
throw logger.processingError(e);
}
ConditionsType conditions = samlProtocolContext.getConditions();
SubjectType subject = samlProtocolContext.getSubjectType();
List<StatementAbstractType> statements = samlProtocolContext.getStatements();
// generate an id for the new assertion.
String assertionID = IDGenerator.create("ID_");
AssertionType assertionType = SAMLAssertionFactory.createAssertion(assertionID, issuerID, issueInstant, conditions,
subject, statements);
try {
AssertionUtil.createTimedConditions(assertionType, ASSERTION_VALIDITY, CLOCK_SKEW);
} catch (ConfigurationException e) {
throw logger.processingError(e);
} catch (IssueInstantMissingException e) {
throw logger.processingError(e);
}
try {
this.tokenRegistry.addToken(assertionID, assertionType);
} catch (IOException e) {
throw logger.processingError(e);
}
samlProtocolContext.setIssuedAssertion(assertionType);
}