AEM ClientContext doesn't recognize me as logged in
I have a custom identity provider that extends ExternalIdentityProvider and I have everything configured to where I can successfully login to AEM on author/publish/dispatcher using a user from the API. The user is also synced with all of the custom properties. In my authenticate method, I have the following
@Override public ExternalUser authenticate(Credentials credentials) throws ExternalIdentityException, LoginException { SimpleCredentials simpleCredentials = (SimpleCredentials)credentials; JSONObject login = UserService.login(simpleCredentials); Map<String, Object> userProperties = UserHelper.getUserProperties(login); if (userProperties.containsKey("customProperty")) { log.info("** USER IS LOGGED IN **"); return createIdentity(simpleCredentials.getUserID(), userProperties); } throw new LoginException("Error Logging In"); }This successfully is executed and the info log is output correctly. I see the user created in CRXDE in it's correct location also.
I then have a filter that checks for a specific location under the page path, let's just says it's "/content/site/en" and that the extension is HTML, if those conditions are true, i check to see if the user is logged in using the following code
public static Boolean isLoggedIn(SlingHttpServletRequest request) { logger.debug("** Checking if User is logged in **"); User user = request.getResourceResolver().adaptTo(User.class); try { if (user == null || user.getID().equals("anonymous")) { logger.debug("** User is NOT logged in **"); return false; } logger.debug("** User IS logged in: " + user.getID() + " **"); return true; } catch(Exception e) { return false; } }My log is successfully outputting that the user is logged in on every page load.
If I then check the CQ_Analytics.ProfileDataMgr object, it does NOT recognize me as logged in. This is the output
data: Object authorizableId: "anonymous" authorizableId_xss: "anonymous" avatar: "/etc/designs/default/images/social/avatar.png" formattedName: "anonymous" formattedName_xss: "anonymous" isLoggedIn: "false" isLoggedIn_xss: "false" path: "/home/users/W/WiGREN12Dh6nHZhH0v_6/profile"
However, if I look at the "initProperty" object, it has all of my custom profile properties and also specifies that i'm logged in
initProperty: Object AUTO_FILL_CON: "Y" AUTO_FILL_CON_xss: "Y" AUTO_FILL_REQ: "Y" AUTO_FILL_REQ_xss: "Y" AUTO_FILL_SHP: "Y" AUTO_FILL_SHP_xss: "Y" AUTO_FILL_TPB: "N" AUTO_FILL_TPB_xss: "N" BOL_DEFAULT_TEMP: "" BOL_DEFAULT_TEMP_xss: "" BOL_PREVIOUS: "Y" BOL_PREVIOUS_xss: "Y" CALENDAR: "Y" CALENDAR_xss: "Y" CHG_CALC_LIST: "Y" CHG_CALC_LIST_xss: "Y" COMDTY_DISPLAY_OPT: "A" COMDTY_DISPLAY_OPT_xss: "A" CONTACT_AUTOLOAD: "D" CONTACT_AUTOLOAD_xss: "D" accountNumber: "005012" accountNumber_xss: "005012" authorizableId: "005012" authorizableId_xss: "005012" avatar: "http://www.gravatar.com/avatar/email@email.com?d=mm&s=32&r=g" firstName: "NAME" firstName_xss: "NAME" formattedName: "NAME NAME" formattedName_xss: "NAME NAME" isLoggedIn: true isLoggedIn_xss: "true"
Why cannot access the user information on the profile object? This is preventing me from grabbing the information i need for displaying user information on the web site.
This is AEM 6.1 with all hot fixes.