public void submit(RequestContext context) {
Authentication auth = SecurityContextHolder.getContext().getAuthentication();
Assert.isInstanceOf(STSUserDetails.class, auth.getDetails());
final STSUserDetails stsUserDetails = (STSUserDetails) auth.getDetails();
SecurityToken securityToken = stsUserDetails.getSecurityToken();
IDPConfig idpConfig = (IDPConfig)WebUtils.getAttributeFromFlowScope(context, IDP_CONFIG);
WebUtils.putAttributeInExternalContext(context, idpConfig.getRealm(), securityToken);
LOG.info("Token [IDP_TOKEN=" + securityToken.getId()