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
BedrockMission!

Learn More

View all

Sign in to view all badges

Service Users in AEM 6.4

Avatar

Avatar
Boost 1
Level 1
MihaiAnghel
Level 1

Like

1 like

Total Posts

2 posts

Correct Reply

0 solutions
Top badges earned
Boost 1
View profile

Avatar
Boost 1
Level 1
MihaiAnghel
Level 1

Like

1 like

Total Posts

2 posts

Correct Reply

0 solutions
Top badges earned
Boost 1
View profile
MihaiAnghel
Level 1

06-08-2018

Hello,

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 ?

Thank you

Replies

Avatar

Avatar
Coach
MVP
Arun_Patidar
MVP

Likes

1,260 likes

Total Posts

3,139 posts

Correct Reply

886 solutions
Top badges earned
Coach
Contributor 2
Ignite 10
Give Back 700
Boost 1000
View profile

Avatar
Coach
MVP
Arun_Patidar
MVP

Likes

1,260 likes

Total Posts

3,139 posts

Correct Reply

886 solutions
Top badges earned
Coach
Contributor 2
Ignite 10
Give Back 700
Boost 1000
View profile
Arun_Patidar
MVP

06-08-2018

Hi,

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:

service Mapping => <bundle Symbolic Name>:<Any-serviceName>=<systemuser>

Screen Shot 2018-08-06 at 3.34.49 PM.png

You can get session from service user like below

session = repository.loginService("readService", null);

where readService is service name

Thanks

Arun

Avatar

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,406 likes

Total Posts

12,671 posts

Correct Reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,406 likes

Total Posts

12,671 posts

Correct Reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile
smacdonald2008
Level 10

06-08-2018