Vivek Dhiman
Vivek Dhiman

Reputation: 1995

SubServices in Apache Sling and Adobe AEM

I would like to know the concept of subservices in OSGi, I tried to find the documentation, but not able to get any material in regards of AEM. I have snippet code.

ResourceResolverFactory.SUBSERVICE, "datawrite"

I tried to check in Felix console, I am able to find ResourceResolverFactory in service tab. But how can i check SUBSERVICE, and the various options available like datawrite etc. & what they standfor.

Thanks

Upvotes: 2

Views: 3237

Answers (2)

apurvc
apurvc

Reputation: 750

Let me try and explain it in the context of Sling Authentication.

As of AEM6 there are changes in API to stop the abuse of AdministrativeResourceResolver which has been utilized by many developers to get admin resourceResolver without passing any credentials.

As this has been deprecated in AEM6 you need to call getServiceResourceResolver(..) and pass it with subservice name which is mapped to a user via ServiceUserMapper configuration.

e.g. a configuration for writeservice could be AEM-bundle:datawrite=datawriteuser. here we are saying that datawrite which is part of AEM-bundle is mapped to datawriteuser and the privilege available to this user is what will be used by datawrite service.

A Service can be composed of many subservice and those subservices will be mapped to different users quoting sling documentation mail transfer service can be composed of smtp, queue, deliver subsystem and these subsystem can be mapped to mta:smtp, mta:queue, mta:deliver users respectively.

Check these references:

inside Blog entry

Sling Authentication

Upvotes: 4

Christian Schneider
Christian Schneider

Reputation: 19606

It is the Name of the authentication information property providing the Subservice Name for the service requesting a resource resolver.

See http://sling.apache.org/apidocs/sling7/org/apache/sling/api/resource/ResourceResolverFactory.html#SUBSERVICE

Upvotes: 0

Related Questions