Welcome screen shows user DN of ldap user next to "sign out" link | AEM 6.2

Issue

In AEM6.2, when LDAP users log in and go to /welcome.html, the Classic UI Welcome screen shows their full LDAP DN next to the "sign-out" link on the upper right of the screen.

Cause

This is an issue with Classic UI in AEM6.2.

Resolution

To fix this problem, you can modify the product code by adding an overlay of welcome.jsp.

  1. Go to http://host:port/crx/de/index.jsp and log in as admin.
  2. Browse to /apps and create the folder structure /apps/cq/core/components.
  3. Click Save All.
  4. Browse to /libs/cq/core/components.
  5. Right click the welcome subnode and select Copy.
  6. Browse back to /apps/cq/core/components.
  7. Right click the components node and select Paste.
  8. Open the file /apps/cq/core/components/welcome/welcome.jsp for editing.
  9. Add this code [1] after these lines [2].
  10. Click Save All.

When users log in, they see their full names displayed.

[1]

org.apache.jackrabbit.api.security.user.UserManager userManager = resourceResolver.adaptTo(org.apache.jackrabbit.api.security.user.UserManager.class);
org.apache.jackrabbit.api.security.user.Authorizable authorizable = userManager.getAuthorizable(auth.getPrincipal());
if (authorizable.hasProperty("profile/familyName")) {
name = authorizable.getProperty("profile/familyName")[0].getString(); 
}
if (authorizable.hasProperty("profile/givenName")) {
name = authorizable.getProperty("profile/givenName")[0].getString() + ((name.length() > 0)?" " + name:"");
}

[2]

String name = auth == null ? null : auth.getPrincipal().getName();
if (name == null) {
// workaround if user manager service is not ready yet.
name = session.getUserID();
}

Download

 Adobe

Få hjælp hurtigere og nemmere

Ny bruger?