Thursday, 5 November 2015

Creating an AEM System User for AEM 6.1

In AEM 6.1, you must create an AEM System User to successfully get a session using code such as:

Map<String, Object> param = new HashMap<String, Object>();
param.put(ResourceResolverFactory.SUBSERVICE, "datawrite");
ResourceResolver resolver = null;

try {
           
    //Invoke the adaptTo method to create a Session used to create a QueryManager
 resolver = resolverFactory.getServiceResourceResolver(param);
    session = resolver.adaptTo(Session.class);

Note - see this article:

Querying Adobe Experience Manager 6 data using the Sling getServiceResourceResolver method

This code will not work in AEM 6.1 using a standard user, 

Note: All AEM 6.x HelpX  Articles will be updated soon to use a System user to obtain a Session object from within an OSGi bundle.

To create a system user, perform these tasks:


  1. Open http://localhost:4502/crx/explorer/index.jsp
  2. Login as admin
  3. Click User Administration
  4. Click Create System User
  5. Set the UserId
  6. Click Save

Once created, you can extend permissions like a normal user using the AEM ACL functionality. 

Join the Adobe Experience Cloud Community 

Join the Adobe Experience Cloud Community by clicking this banner




I (Scott Macdonald) am a Senior Digital Marketing Community Manager at Adobe Systems with 20 years in the high tech industry. I am also a programmer with knowledge in Java, JavaScript, C#,C++, HTML, XML and ActionScript. If  you would like to see more CQ or other Adobe Digital Marketing end to end articles like this, then leave a comment and let me know what content you would like to see.


TwitterFollow the Digital Marketing Customer Care team on Twitter @AdobeExpCare.

YouTube: Subscribe to the AEM Community Channel