To assist in this area, we'll add the ability to view the current account to the JBCP Calendar application. We'll use this page to illustrate how the richer person
and inetOrgPerson
LDAP schemas can provide additional (optional) information to your LDAP-enabled application.
You may have noticed that this chapter came with an additional controller named AccountController
. You can see the relevant code as follows:
src/main/java/com/packtpub/springsecurity/web/controllers/AccountController.java
... @RequestMapping("/accounts/my") public String view(Model model) { Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); // null check on authentication omitted Object principal = authentication.getPrincipal(); model.addAttribute("user", principal); model.addAttribute("isLdapUserDetails", principal instanceof LdapUserDetails); model.addAttribute("isLdapPerson", principal instanceof Person); model.addAttribute...