load user menu in overview
This commit is contained in:
parent
d854a452a2
commit
a60b3fedd9
|
@ -16,12 +16,12 @@ public class OverviewServlet extends HttpServlet {
|
|||
|
||||
boolean isAuthenticated = !SecurityContextHolder.getContext().getAuthentication().getPrincipal().toString()
|
||||
.equals("anonymousUser");
|
||||
System.out.println("Authenticated ? " + isAuthenticated);
|
||||
|
||||
if (isAuthenticated) {
|
||||
OIDCAuthenticationToken authentication = (OIDCAuthenticationToken) SecurityContextHolder.getContext().getAuthentication();
|
||||
StringBuilder name = new StringBuilder().append(authentication.getUserInfo().getGivenName().charAt(0));
|
||||
name.append(authentication.getUserInfo().getFamilyName().charAt(0));
|
||||
request.getSession().setAttribute("authenticated", isAuthenticated);
|
||||
request.getSession().setAttribute("name", name.toString());
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue