return SessioninfoBean.class;
}
public Sessioninfo build(Authentication auth, String serverName, String sessionid) {
CategoryPrincipal principal = (CategoryPrincipal) auth.getPrincipal();
SessioninfoBean info = new SessioninfoBean(sessionid, serverName, auth.getName(),
principal.getFullname());
info.setCategory(principal.getCategory());
Object details = auth.getDetails();
if (details instanceof WebAuthenticationDetails) {
WebAuthenticationDetails webdetails = (WebAuthenticationDetails) details;
info.setAgent(webdetails.getAgent().getBrowser().toString());
info.setOs(webdetails.getAgent().getOs().toString());
info.setIp(webdetails.getAgent().getIp());
}
return info;
}