Obtaining session apart from repository.loginAdministrative(null) way. | Community
Skip to main content
New Participant
March 7, 2016
Solved

Obtaining session apart from repository.loginAdministrative(null) way.

  • March 7, 2016
  • 4 replies
  • 1287 views

Hi All,

repository.loginAdministrative(null) is a deprecated method of obtaining a session instance. What would be an alternative that can be used here.

Any thoughts/pointers here, will be helpful.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Kunal_Gaba_

You should use Sling service resource resolver for getting session in
backend services. This is now recommended for getting sessions as  it
restricts the access to the service code only on the required repository
paths unlike loginAdministrative which exposes full permissions to your
services. You can follow the below example-
https://helpx.adobe.com/experience-manager/using/querying-experience-manager-sling.html
 

4 replies

Employee
March 11, 2016

I need to unlock a page through code which is locked by another user. 

Do i need to create a service user similar to admin user which can be used to impersonate and unlock resources? How can this be achieved?

askdctmAuthor
New Participant
March 7, 2016

Hi Kunal/Praveen,

Thank you for your replies.

Kunal_Gaba_
Kunal_Gaba_Accepted solution
New Participant
March 7, 2016

You should use Sling service resource resolver for getting session in
backend services. This is now recommended for getting sessions as  it
restricts the access to the service code only on the required repository
paths unlike loginAdministrative which exposes full permissions to your
services. You can follow the below example-
https://helpx.adobe.com/experience-manager/using/querying-experience-manager-sling.html