FederationRequest wfReq = new FederationRequest();
wfReq.setWa(FederationConstants.ACTION_SIGNIN);
wfReq.setWresult(wresult);
FederationProcessor wfProc = new FederationProcessorImpl();
FederationResponse wfResp = wfProc.processRequest(wfReq, fedContext);
fedContext.close();
Element e = wfResp.getToken();
// Create new Security token with new id.
// Parameters for freshness computation are copied from original IDP_TOKEN
String id = "_" + UUIDGenerator.getUUID();
SecurityToken idpToken = new SecurityToken(id,
wfResp.getTokenCreated(), wfResp.getTokenExpires());
idpToken.setToken(e);
LOG.info("[IDP_TOKEN=" + id + "] for user '" + wfResp.getUsername()
+ "' created from [RP_TOKEN=" + wfResp.getUniqueTokenId()
+ "] issued by home realm [" + whr + "/"
+ wfResp.getIssuer() + "].");
if (LOG.isDebugEnabled()) {
LOG.debug("Created date=" + wfResp.getTokenCreated());
LOG.debug("Expired date=" + wfResp.getTokenExpires());
}
if (LOG.isDebugEnabled()) {
LOG.debug("Validated 'wresult' : "
+ System.getProperty("line.separator") + wresult);
}