Hi
Please have a look at this Stackoverflow question :
Link:- http://stackoverflow.com/questions/33132102/aem-get-current-userid
//
if you want to get user in java, you can user Resource Resolver API.
Session session = resourceResolver.adaptTo(Session.class); session.getUserID();
if you want to get user on Front end, you could use Profile Data Manager API
<script> CQ_Analytics.ProfileDataMgr.data </script>
Link:- http://help-forums.adobe.com/content/adobeforums/en/experience-manager-forum/adobe-experience-manager.topic.html/forum__ujsa-hi_team_i_needt.html (Almost Same Question)
Link:- http://stackoverflow.com/questions/22549502/how-to-get-the-cq5-userinfo-in-java-or-jsp-by-using-jackrabbit/22549922#22549922
//
Session session = resourceResolver.adaptTo(Session.class); UserManager userManager = resourceResolver.adaptTo(UserManager.class); /* to get the current user */ Authorizable auth = userManager.getAuthorizable(session.getUserID()); /* to get the property of the authorizable. Use relative path */ Value[] names = auth.getProperty("./profile/familyName"); /* to get the groups it is member of */ Iterator<Group> groups = auth.memberOf();To list all the users or groups, you can use findAuthorizables() method available in the UserManger.
You can also obtain the User info in JS using CQ.User.getCurrentUser() which would return an instance of the current User, with which you can access the user's properties.
Link:- https://helpx.adobe.com/experience-manager/using/using-ajax-requests-display-cq.html (Community article)
//Using AJAX requests to display Adobe CQ users in a grid control
I hope this would help you.
Thanks and Rerards
Kautuk Sahni