public void onClick(ClickEvent clickEvent)
{
String sessionId = Cookies.getCookie("JSESSIONID") != null ?
Cookies.getCookie("JSESSIONID") : "";
AuthenticationContext authContext = Registry.get(SecurityService.class).getAuthenticationContext();
Set<Role> roleSet = authContext.getRoles();
StringBuffer roles = new StringBuffer();
for(Role r : roleSet)
{
roles.append(r.getRoleName()).append(" ");
}
StringBuffer sb = new StringBuffer("<h3>User information</h3>");
sb.append("- User: ").append(authContext.getName()).append("<br/>");
sb.append("- Logged in since: ").append(loginDate).append("<br/>");
sb.append("- SID: ").append(sessionId).append("<br/>");
sb.append("- Roles: ").append(roles.toString()).append("<br/>");