I am trying to implement an event listener in AEM 6.4 and apparently the SlingRepository.loginAdministrative() has been deprecated. According to the documentation, service users should be used instead for obtaining a session. The issue is that the documentation on using service users in the code is quite light. Other than Service Users in AEM , which describes the creation of service users, I haven't found anything detailed about actually using q service user for getting a session object.
Can you please point to any relevant documentation ?
Once you created system user and gave all the necessary permission. The you need to create a mapping to configure a bundle-to-user mapping, for that you can create new config like below:
You can get session from service user like below
session = repository.loginService("readService", null);
where readService is service name