How to get current user session in osgi service?
Is it possible to get the current user session from osgi service like from slingrequest. I need to get the user session so that I can use the current user permission to replicate some assets.
Is it possible to get the current user session from osgi service like from slingrequest. I need to get the user session so that I can use the current user permission to replicate some assets.
Hi @lukasz-m
But still I need session to call replicator.
replicator.replicate(session, ReplicationActionType.TEST, path, options);
Thanks
@thatsmeadarsh, I think that the simplest option will be to have/use service user for replication. So it could look like this, assuming you have access to resource resolver for system user:
In general, I do not think there will be an easy way to get session object for specific user in your use case. You can try to use impersonation functionality, but to do this you will need session of admin user anyway.
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.