{"id":16456,"date":"2014-12-22T16:22:56","date_gmt":"2014-12-22T10:52:56","guid":{"rendered":"http:\/\/www.tothenew.com\/blog\/?p=16456"},"modified":"2014-12-22T16:22:56","modified_gmt":"2014-12-22T10:52:56","slug":"access-content-repository-via-getserviceresourceresolver-in-aem6sling7","status":"publish","type":"post","link":"https:\/\/www.tothenew.com\/blog\/access-content-repository-via-getserviceresourceresolver-in-aem6sling7\/","title":{"rendered":"Access Content Repository via getServiceResourceResolver() in AEM6\/Sling7"},"content":{"rendered":"<p>JCR Sessions and Sling Based Authentication are always the important in code where someone\u00a0need to get an access of the Content Repository. But this same way to get an access over content repository was remains controversial due to its administrative privileges . So with the new AEM6 version below methods have been deprecated to get an access of admin sessions which can cause the security vulnerabilities :<\/p>\n<p>1) ResourceResolverFactory.getAdministrativeResourceResolver<br \/>\n2) ResourceProviderFactory.getAdministrativeResourceProvider<br \/>\n3) SlingRepository.loginAdministrative<\/p>\n<p>Latest release of Sling provide an alternative to access the repository without using admin session via Service Based Authentication. In Service Based authentication each service will bind to specific set of users which will have different access privileges. These users also refer as the service users. Below is the implementation steps of service based authentication .<\/p>\n<p>Step 1 : Create two users with different access privileges, gives one to read and other to read\/write.<br \/>\nStep 2 : Create two services which try to write some property inside node :<\/p>\n<p>WriteOpService<\/p>\n<p>[java]<br \/>\n@Service<br \/>\n@Component(immediate = true)<br \/>\npublic class WriteOpServiceImpl implements WriteOpService{<br \/>\n    private final Logger logger = LoggerFactory.getLogger(WriteOpServiceImpl.class);<br \/>\n    @Reference<br \/>\n    private ResourceResolverFactory resolverFactory;<br \/>\n    @Override<br \/>\n    public void writePropToNode(String resourcePath) {<br \/>\n        Map&lt;String, Object&gt; serviceParams = new HashMap&lt;String, Object&gt;();<br \/>\n        serviceParams.put(ResourceResolverFactory.SUBSERVICE, &quot;writeService&quot;);<br \/>\n        ResourceResolver resolver = null;<br \/>\n        try {<br \/>\n            resolver = resolverFactory.getServiceResourceResolver(serviceParams);<br \/>\n            logger.info(resolver.getUserID());<br \/>\n            Resource res = resolver.getResource(resourcePath+&quot;\/jcr:content&quot;);<br \/>\n            logger.info(&quot;Path is ::: &quot;+res.getPath());<br \/>\n            ModifiableValueMap modMap = res.adaptTo(ModifiableValueMap.class);<br \/>\n            if(modMap != null){<br \/>\n                modMap.put(&quot;propname&quot;, &quot;propValue&quot;);<br \/>\n                resolver.commit();<br \/>\n                logger.info(&quot;Successfully saved&quot;);<br \/>\n            }<br \/>\n        } catch (Exception e) {<br \/>\n            logger.error(&quot;Exceptions is ::: &quot;,e);<br \/>\n        }finally{<br \/>\n            if(resolver != null){<br \/>\n                resolver.close();<br \/>\n            }<br \/>\n        }<br \/>\n    }[\/java]<\/p>\n<p>ReadOpService :<\/p>\n<p>[java]<br \/>\n@Service<br \/>\n@Component(immediate = true)<br \/>\npublic class ReadOpServiceImpl implements ReadOpService {<\/p>\n<p>    private final Logger logger = LoggerFactory.getLogger(ReadOpServiceImpl.class);<\/p>\n<p>    @Reference<br \/>\n    private ResourceResolverFactory resolverFactory;<\/p>\n<p>    @Override<br \/>\n    public void readPropFromNode(String resourcePatb) {<br \/>\n        Map&lt;String, Object&gt; serviceParams = new HashMap&lt;String, Object&gt;();<br \/>\n        serviceParams.put(ResourceResolverFactory.SUBSERVICE, &quot;readService&quot;);<br \/>\n        ResourceResolver resolver = null;<br \/>\n        try {<br \/>\n            resolver = resolverFactory.getServiceResourceResolver(serviceParams);<br \/>\n            logger.info(resolver.getUserID());<br \/>\n            Resource res = resolver.getResource(resourcePatb+&quot;\/jcr:content&quot;);<br \/>\n            logger.info(&quot;Path is ::: &quot;+res.getPath());<br \/>\n            ModifiableValueMap modMap = res.adaptTo(ModifiableValueMap.class);<br \/>\n            if(modMap != null){<br \/>\n                modMap.put(&quot;propname&quot;, &quot;propValue&quot;);<br \/>\n                resolver.commit();<br \/>\n                logger.info(&quot;Successfully saved&quot;);<br \/>\n            }<br \/>\n        } catch (Exception e) {<br \/>\n            logger.error(&quot;Exceptions is ::: &quot;,e);<br \/>\n        }finally{<br \/>\n            if(resolver != null){<br \/>\n                resolver.close();<br \/>\n            }<br \/>\n        }<br \/>\n    }<br \/>\n[\/java]<\/p>\n<p>Step 3 : Configure the Apache Sling Service User Mapper service via Felix Console as below:<\/p>\n<p><a href=\"\/blog\/wp-ttn-blog\/uploads\/2014\/12\/console.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-16459\" src=\"\/blog\/wp-ttn-blog\/uploads\/2014\/12\/console-300x74.png\" alt=\"console\" width=\"300\" height=\"74\" srcset=\"https:\/\/www.tothenew.com\/blog\/wp-content\/uploads\/2014\/12\/console-300x74.png 300w, https:\/\/www.tothenew.com\/blog\/wp-content\/uploads\/2014\/12\/console-1024x255.png 1024w, https:\/\/www.tothenew.com\/blog\/wp-content\/uploads\/2014\/12\/console.png 1148w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>Syntax will be \u00a0: <strong>[bundle-symbolic-name]:[subServiceName]=[Service-User]\u00a0<\/strong><\/p>\n<p>Step 4 : Create some authering stuff, in such a way we will pass the page path then on submit, property propname with value propValue\u00a0will be set to the page.<br \/>\nStep 5 : Below is the sample associated component script :<\/p>\n<p>[java]&lt;%@include file=&quot;\/libs\/foundation\/global.jsp&quot;%&gt;<br \/>\n&lt;%@page session=&quot;false&quot; %&gt;<br \/>\n&lt;% String prop = properties.get(&quot;pagePath&quot;,&quot;&quot;);<br \/>\ncom.aem.services.WriteOpService writeOpService = sling.getService(com.aem.services.WriteOpService.class);<br \/>\ncom.aem.services.ReadOpService readOpService = sling.getService(com.aem.services.ReadOpService.class);<br \/>\n\/\/readOpService.readPropFromNode(prop);<br \/>\nwriteOpService.writePropToNode(prop); %&gt;<br \/>\n[\/java]<\/p>\n<p>If we look both the services they are performing the write operation but in the success will depends on via which user you logged in &amp; which operation you call, as different services are associated with different service users. Refer the below link for further information :<br \/>\n<a href=\"https:\/\/cwiki.apache.org\/confluence\/display\/SLING\/Service+Authentication\">https:\/\/cwiki.apache.org\/confluence\/display\/SLING\/Service+Authentication<\/a><\/p>\n<p>Vivek Dhiman<\/p>\n","protected":false},"excerpt":{"rendered":"<p>JCR Sessions and Sling Based Authentication are always the important in code where someone\u00a0need to get an access of the Content Repository. But this same way to get an access over content repository was remains controversial due to its administrative privileges . So with the new AEM6 version below methods have been deprecated to get [&hellip;]<\/p>\n","protected":false},"author":128,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":7,"footnotes":""},"categories":[1],"tags":[1581,1580,1360],"class_list":["post-16456","post","type-post","status-publish","format-standard","hentry","category-technology","tag-aem6","tag-apache-sling","tag-jcr"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.0.1 - aioseo.com -->\n\t<meta name=\"description\" content=\"JCR Sessions and Sling Based Authentication are always the important in code where someone need to get an access of the Content Repository. But this same way to get an access over content repository was remains controversial due to its administrative privileges . So with the new AEM6 version below methods have been deprecated to get\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Vivek Dhiman\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/www.tothenew.com\/blog\/access-content-repository-via-getserviceresourceresolver-in-aem6sling7\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.0.1\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"TO THE NEW BLOG\" \/>\n\t\t<meta property=\"og:type\" content=\"blog\" \/>\n\t\t<meta property=\"og:title\" content=\"Access Content Repository via getServiceResourceResolver() in AEM6\/Sling7 | TO THE NEW Blog\" \/>\n\t\t<meta property=\"og:description\" content=\"JCR Sessions and Sling Based Authentication are always the important in code where someone need to get an access of the Content Repository. But this same way to get an access over content repository was remains controversial due to its administrative privileges . So with the new AEM6 version below methods have been deprecated to get\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/www.tothenew.com\/blog\/access-content-repository-via-getserviceresourceresolver-in-aem6sling7\/\" \/>\n\t\t<meta property=\"og:image\" content=\"https:\/\/www.tothenew.com\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png\" \/>\n\t\t<meta property=\"og:image:secure_url\" content=\"https:\/\/www.tothenew.com\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary\" \/>\n\t\t<meta name=\"twitter:site\" content=\"@tothenew\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Access Content Repository via getServiceResourceResolver() in AEM6\/Sling7 | TO THE NEW Blog\" \/>\n\t\t<meta name=\"twitter:description\" content=\"JCR Sessions and Sling Based Authentication are always the important in code where someone need to get an access of the Content Repository. But this same way to get an access over content repository was remains controversial due to its administrative privileges . So with the new AEM6 version below methods have been deprecated to get\" \/>\n\t\t<meta name=\"twitter:image\" content=\"https:\/\/www.tothenew.com\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/access-content-repository-via-getserviceresourceresolver-in-aem6sling7\\\/#article\",\"name\":\"Access Content Repository via getServiceResourceResolver() in AEM6\\\/Sling7 | TO THE NEW Blog\",\"headline\":\"Access Content Repository via getServiceResourceResolver() in AEM6\\\/Sling7\",\"author\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/vivek-dhiman\\\/#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#organization\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"\\\/blog\\\/wp-ttn-blog\\\/uploads\\\/2014\\\/12\\\/console-300x74.png\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/access-content-repository-via-getserviceresourceresolver-in-aem6sling7\\\/#articleImage\"},\"datePublished\":\"2014-12-22T16:22:56+05:30\",\"dateModified\":\"2014-12-22T16:22:56+05:30\",\"inLanguage\":\"en-US\",\"commentCount\":3,\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/access-content-repository-via-getserviceresourceresolver-in-aem6sling7\\\/#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/access-content-repository-via-getserviceresourceresolver-in-aem6sling7\\\/#webpage\"},\"articleSection\":\"Technology, AEM6, Apache Sling, JCR\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/access-content-repository-via-getserviceresourceresolver-in-aem6sling7\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.tothenew.com\\\/blog\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/category\\\/technology\\\/#listItem\",\"name\":\"Technology\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/category\\\/technology\\\/#listItem\",\"position\":2,\"name\":\"Technology\",\"item\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/category\\\/technology\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/access-content-repository-via-getserviceresourceresolver-in-aem6sling7\\\/#listItem\",\"name\":\"Access Content Repository via getServiceResourceResolver() in AEM6\\\/Sling7\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/access-content-repository-via-getserviceresourceresolver-in-aem6sling7\\\/#listItem\",\"position\":3,\"name\":\"Access Content Repository via getServiceResourceResolver() in AEM6\\\/Sling7\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/category\\\/technology\\\/#listItem\",\"name\":\"Technology\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#organization\",\"name\":\"TO THE NEW Blog\",\"url\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/vivek-dhiman\\\/#author\",\"url\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/vivek-dhiman\\\/\",\"name\":\"Vivek Dhiman\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/access-content-repository-via-getserviceresourceresolver-in-aem6sling7\\\/#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4781e65c4f74fa6ccddbbe6f8d11a675c4ecc5b562fbbcc59e20d18804c0c5d1?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"Vivek Dhiman\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/access-content-repository-via-getserviceresourceresolver-in-aem6sling7\\\/#webpage\",\"url\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/access-content-repository-via-getserviceresourceresolver-in-aem6sling7\\\/\",\"name\":\"Access Content Repository via getServiceResourceResolver() in AEM6\\\/Sling7 | TO THE NEW Blog\",\"description\":\"JCR Sessions and Sling Based Authentication are always the important in code where someone need to get an access of the Content Repository. But this same way to get an access over content repository was remains controversial due to its administrative privileges . So with the new AEM6 version below methods have been deprecated to get\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/access-content-repository-via-getserviceresourceresolver-in-aem6sling7\\\/#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/vivek-dhiman\\\/#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/vivek-dhiman\\\/#author\"},\"datePublished\":\"2014-12-22T16:22:56+05:30\",\"dateModified\":\"2014-12-22T16:22:56+05:30\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/\",\"name\":\"TO THE NEW Blog\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Access Content Repository via getServiceResourceResolver() in AEM6\/Sling7 | TO THE NEW Blog","description":"JCR Sessions and Sling Based Authentication are always the important in code where someone need to get an access of the Content Repository. But this same way to get an access over content repository was remains controversial due to its administrative privileges . So with the new AEM6 version below methods have been deprecated to get","canonical_url":"https:\/\/www.tothenew.com\/blog\/access-content-repository-via-getserviceresourceresolver-in-aem6sling7\/","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.tothenew.com\/blog\/access-content-repository-via-getserviceresourceresolver-in-aem6sling7\/#article","name":"Access Content Repository via getServiceResourceResolver() in AEM6\/Sling7 | TO THE NEW Blog","headline":"Access Content Repository via getServiceResourceResolver() in AEM6\/Sling7","author":{"@id":"https:\/\/www.tothenew.com\/blog\/author\/vivek-dhiman\/#author"},"publisher":{"@id":"https:\/\/www.tothenew.com\/blog\/#organization"},"image":{"@type":"ImageObject","url":"\/blog\/wp-ttn-blog\/uploads\/2014\/12\/console-300x74.png","@id":"https:\/\/www.tothenew.com\/blog\/access-content-repository-via-getserviceresourceresolver-in-aem6sling7\/#articleImage"},"datePublished":"2014-12-22T16:22:56+05:30","dateModified":"2014-12-22T16:22:56+05:30","inLanguage":"en-US","commentCount":3,"mainEntityOfPage":{"@id":"https:\/\/www.tothenew.com\/blog\/access-content-repository-via-getserviceresourceresolver-in-aem6sling7\/#webpage"},"isPartOf":{"@id":"https:\/\/www.tothenew.com\/blog\/access-content-repository-via-getserviceresourceresolver-in-aem6sling7\/#webpage"},"articleSection":"Technology, AEM6, Apache Sling, JCR"},{"@type":"BreadcrumbList","@id":"https:\/\/www.tothenew.com\/blog\/access-content-repository-via-getserviceresourceresolver-in-aem6sling7\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/www.tothenew.com\/blog#listItem","position":1,"name":"Home","item":"https:\/\/www.tothenew.com\/blog","nextItem":{"@type":"ListItem","@id":"https:\/\/www.tothenew.com\/blog\/category\/technology\/#listItem","name":"Technology"}},{"@type":"ListItem","@id":"https:\/\/www.tothenew.com\/blog\/category\/technology\/#listItem","position":2,"name":"Technology","item":"https:\/\/www.tothenew.com\/blog\/category\/technology\/","nextItem":{"@type":"ListItem","@id":"https:\/\/www.tothenew.com\/blog\/access-content-repository-via-getserviceresourceresolver-in-aem6sling7\/#listItem","name":"Access Content Repository via getServiceResourceResolver() in AEM6\/Sling7"},"previousItem":{"@type":"ListItem","@id":"https:\/\/www.tothenew.com\/blog#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/www.tothenew.com\/blog\/access-content-repository-via-getserviceresourceresolver-in-aem6sling7\/#listItem","position":3,"name":"Access Content Repository via getServiceResourceResolver() in AEM6\/Sling7","previousItem":{"@type":"ListItem","@id":"https:\/\/www.tothenew.com\/blog\/category\/technology\/#listItem","name":"Technology"}}]},{"@type":"Organization","@id":"https:\/\/www.tothenew.com\/blog\/#organization","name":"TO THE NEW Blog","url":"https:\/\/www.tothenew.com\/blog\/"},{"@type":"Person","@id":"https:\/\/www.tothenew.com\/blog\/author\/vivek-dhiman\/#author","url":"https:\/\/www.tothenew.com\/blog\/author\/vivek-dhiman\/","name":"Vivek Dhiman","image":{"@type":"ImageObject","@id":"https:\/\/www.tothenew.com\/blog\/access-content-repository-via-getserviceresourceresolver-in-aem6sling7\/#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/4781e65c4f74fa6ccddbbe6f8d11a675c4ecc5b562fbbcc59e20d18804c0c5d1?s=96&d=mm&r=g","width":96,"height":96,"caption":"Vivek Dhiman"}},{"@type":"WebPage","@id":"https:\/\/www.tothenew.com\/blog\/access-content-repository-via-getserviceresourceresolver-in-aem6sling7\/#webpage","url":"https:\/\/www.tothenew.com\/blog\/access-content-repository-via-getserviceresourceresolver-in-aem6sling7\/","name":"Access Content Repository via getServiceResourceResolver() in AEM6\/Sling7 | TO THE NEW Blog","description":"JCR Sessions and Sling Based Authentication are always the important in code where someone need to get an access of the Content Repository. But this same way to get an access over content repository was remains controversial due to its administrative privileges . So with the new AEM6 version below methods have been deprecated to get","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/www.tothenew.com\/blog\/#website"},"breadcrumb":{"@id":"https:\/\/www.tothenew.com\/blog\/access-content-repository-via-getserviceresourceresolver-in-aem6sling7\/#breadcrumblist"},"author":{"@id":"https:\/\/www.tothenew.com\/blog\/author\/vivek-dhiman\/#author"},"creator":{"@id":"https:\/\/www.tothenew.com\/blog\/author\/vivek-dhiman\/#author"},"datePublished":"2014-12-22T16:22:56+05:30","dateModified":"2014-12-22T16:22:56+05:30"},{"@type":"WebSite","@id":"https:\/\/www.tothenew.com\/blog\/#website","url":"https:\/\/www.tothenew.com\/blog\/","name":"TO THE NEW Blog","inLanguage":"en-US","publisher":{"@id":"https:\/\/www.tothenew.com\/blog\/#organization"}}]},"og:locale":"en_US","og:site_name":"TO THE NEW BLOG","og:type":"blog","og:title":"Access Content Repository via getServiceResourceResolver() in AEM6\/Sling7 | TO THE NEW Blog","og:description":"JCR Sessions and Sling Based Authentication are always the important in code where someone need to get an access of the Content Repository. But this same way to get an access over content repository was remains controversial due to its administrative privileges . So with the new AEM6 version below methods have been deprecated to get","og:url":"https:\/\/www.tothenew.com\/blog\/access-content-repository-via-getserviceresourceresolver-in-aem6sling7\/","og:image":"https:\/\/www.tothenew.com\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png","og:image:secure_url":"https:\/\/www.tothenew.com\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png","twitter:card":"summary","twitter:site":"@tothenew","twitter:title":"Access Content Repository via getServiceResourceResolver() in AEM6\/Sling7 | TO THE NEW Blog","twitter:description":"JCR Sessions and Sling Based Authentication are always the important in code where someone need to get an access of the Content Repository. But this same way to get an access over content repository was remains controversial due to its administrative privileges . So with the new AEM6 version below methods have been deprecated to get","twitter:image":"https:\/\/www.tothenew.com\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png"},"aioseo_meta_data":{"post_id":"16456","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"Article","isEnabled":true},"graphs":[]},"schema_type":null,"schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"limit_modified_date":false,"created":"2021-04-29 19:50:04","updated":"2024-02-29 09:31:27","focus_keyword":null,"additional_keywords":null,"truseo_locale":null,"ai":null,"breadcrumb_settings":null,"seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.tothenew.com\/blog\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.tothenew.com\/blog\/category\/technology\/\" title=\"Technology\">Technology<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tAccess Content Repository via getServiceResourceResolver() in AEM6\/Sling7\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/www.tothenew.com\/blog"},{"label":"Technology","link":"https:\/\/www.tothenew.com\/blog\/category\/technology\/"},{"label":"Access Content Repository via getServiceResourceResolver() in AEM6\/Sling7","link":"https:\/\/www.tothenew.com\/blog\/access-content-repository-via-getserviceresourceresolver-in-aem6sling7\/"}],"_links":{"self":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/16456","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/users\/128"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/comments?post=16456"}],"version-history":[{"count":0,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/16456\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/media?parent=16456"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/categories?post=16456"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/tags?post=16456"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}