Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

What is the best way to register AEM system users with code as configuration?

AEMWizard
Level 4
Level 4

For example, I have 1 AEM author and 4 AEM publishers. I need to register a couple of system users for each and every environment. What is the best way to achieve my goal using code as configuration?

 

How would I do this in:
AEM - Cloud as a service
AEM - Adobe Managed Services

 

I am planning to use https://adobe-consulting-services.github.io/acs-aem-commons/features/ensure-service-users/index.html... is this a good practice?

1 Accepted Solution
kishorekumar14
Correct answer by
Level 10
Level 10

Hi @AEMWizard ,

 

RepoInit Scripts is the recommended way to create Service Users in AEMaaCS.

 

https://experienceleague.adobe.com/docs/experience-manager-cloud-service/implementing/developing/aem...

 

Even in Ensure Service ACS link they are recommending to use the Repo Init Scripts.

 

 

kishorekumar14_0-1632794905239.png

 

 

https://adobe-consulting-services.github.io/acs-aem-commons/features/ensure-service-users/index.html 

View solution in original post

3 Replies
kishorekumar14
Correct answer by
Level 10
Level 10

Hi @AEMWizard ,

 

RepoInit Scripts is the recommended way to create Service Users in AEMaaCS.

 

https://experienceleague.adobe.com/docs/experience-manager-cloud-service/implementing/developing/aem...

 

Even in Ensure Service ACS link they are recommending to use the Repo Init Scripts.

 

 

kishorekumar14_0-1632794905239.png

 

 

https://adobe-consulting-services.github.io/acs-aem-commons/features/ensure-service-users/index.html 

View solution in original post

Asutosh_Jena_
Community Advisor
Community Advisor

Hi @AEMWizard 

 

You can create an OSGi configuration with RepositoryInitializer and it will create appropriate system/service user on any of your AEM instance. This works on both AEM 6.5 and Cloud version as well.

 

To create an OSGi service please follow the below steps:

Create an OSGi service with name like below-

 

/apps/my-app/config.author/org.apache.sling.jcr.repoinit.RepositoryInitializer-author.config

 

Place the script which should contain the service user name along with ACL details.

 

scripts=["
create service user my-data-reader-service

set ACL on /var/my-data
allow jcr:read for my-data-reader-service
end

create path (sling:Folder) /conf/my-app/settings
"]

 

That's it and you are all set!

 

https://experienceleague.adobe.com/docs/experience-manager-cloud-service/implementing/developing/aem...

 

Thanks!