How to get the logged in username using client context. I tried following code, but got admin as output, where as i want output as user logged in the geometrixx website.
Session session = resourceResolver.adaptTo(Session.class);
i guess this can be done using client context. Can anyone help me out getting username from client context.
Thanks in advance.
have you use admintrator code help?
To get a session in AEM 6 - use
Map<String, Object> param = new HashMap<String, Object>();
ResourceResolver resolver = null;
//Invoke the adaptTo method to create a Session used to create a QueryManager
resolver = resolverFactory.getServiceResourceResolver(param);
session = resolver.adaptTo(Session.class);