// we store the principal name instead of the principal itself
session.setAttribute(CREDENTIALS_ATTRIBUTE, principal.getName());
credentialsToken = new CredentialsToken(principal);
}
SlideToken token = new SlideTokenImpl(credentialsToken);
token.setEnforceLockTokens(true);
// store session attributes in token parameters to pass them through
// to the stores
for(Enumeration e = session.getAttributeNames(); e.hasMoreElements();) {
String name = (String)e.nextElement();
token.addParameter(name, session.getAttribute(name));
}
return token;
}