You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by bu...@apache.org on 2017/05/09 15:58:06 UTC

svn commit: r1011934 - in /websites/staging/sling/trunk/content: ./ documentation/the-sling-engine/service-authentication.html

Author: buildbot
Date: Tue May  9 15:58:06 2017
New Revision: 1011934

Log:
Staging update by buildbot for sling

Modified:
    websites/staging/sling/trunk/content/   (props changed)
    websites/staging/sling/trunk/content/documentation/the-sling-engine/service-authentication.html

Propchange: websites/staging/sling/trunk/content/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Tue May  9 15:58:06 2017
@@ -1 +1 @@
-1794570
+1794603

Modified: websites/staging/sling/trunk/content/documentation/the-sling-engine/service-authentication.html
==============================================================================
--- websites/staging/sling/trunk/content/documentation/the-sling-engine/service-authentication.html (original)
+++ websites/staging/sling/trunk/content/documentation/the-sling-engine/service-authentication.html Tue May  9 15:58:06 2017
@@ -265,18 +265,22 @@ This is configured through an OSGi confi
 </pre></div>
 
 
-<p>The according user must exist at the point in time where <code>ResourceResolverFactory.getServiceResourceResolver(...)</code> or <code>SlingRepository.loginService(...)</code> is called. If you rely on one of those methods in your <code>activate</code> method of an OSGi component you should make sure that you defer starting your OSGi component until the according service user mapping is in place. For that you can reference the OSGi service <code>ServiceUserMapped</code> (<a href="https://issues.apache.org/jira/browse/SLING-4312">SLING-4312</a>), optionally with a target filter on property <code>subServiceName</code> (in case such a subservice name is used). The service <code>ServiceUserMapped</code> does not expose any methods but is only a marker interface exclusively used to defer starting of other OSGi components.</p>
+<p>The according user must exist at the point in time where <code>ResourceResolverFactory.getServiceResourceResolver(...)</code> or <code>SlingRepository.loginService(...)</code> is called. If you rely on one of those methods in your <code>activate</code> method of an OSGi component you should make sure that you defer starting your OSGi component until the according service user mapping is in place. For that you can reference the OSGi service <code>ServiceUserMapped</code> (<a href="https://issues.apache.org/jira/browse/SLING-4312">SLING-4312</a>), optionally with a target filter on property <code>subServiceName</code> (in case such a subservice name is used). The service <code>ServiceUserMapped</code> does not expose any methods but is only a marker interface exclusively used to defer starting of other OSGi components. However this waits only for the mapping configuration to be available, it does not wait for the service user itself to be available.</p>
 <p>Example OSGi DS Component</p>
-<div class="codehilite"><pre><span class="nd">@Component</span>
+<div class="codehilite"><pre><span class="nd">@Component</span><span class="o">(</span>
+    <span class="n">reference</span> <span class="o">=</span> <span class="o">{</span>
+        <span class="c1">// this waits with the activation of this component until a service user mapping with the service name = current bundle&#39;s id and the sub service name &#39;my-subservice-name&#39; is available.</span>
+        <span class="c1">// you can leave out &quot;target&quot; if the sub service name is not used.</span>
+        <span class="c1">// Please note that this only waits for the mapping to be available, it does not wait for the service user itself to be available!</span>
+        <span class="nd">@Reference</span><span class="o">(</span><span class="n">name</span> <span class="o">=</span><span class="s">&quot;scriptsServiceUser&quot;</span><span class="o">,</span> <span class="n">target</span><span class="o">=</span><span class="s">&quot;(subServiceName=my-subservice-name)&quot;</span><span class="o">,</span> <span class="n">service</span><span class="o">=</span><span class="n">ServiceUserMapped</span><span class="o">.</span><span class="na">class</span><span class="o">)</span>
+    <span class="o">}</span>
+<span class="o">)</span>
 <span class="kd">class</span> <span class="nc">MyComponent</span> <span class="o">{</span>
-  <span class="c1">// this waits with the activation of this component until a service user mapping with the service name = current bundle&#39;s id and the sub service name &#39;my-subservice-name&#39; is available.</span>
-  <span class="c1">// you can leave out &quot;target&quot; if the sub service name is not used</span>
-  <span class="nd">@Reference</span><span class="o">(</span><span class="n">target</span> <span class="o">=</span> <span class="s">&quot;(subServiceName=my-subservice-name)&quot;</span><span class="o">)</span>
-  <span class="kd">private</span> <span class="n">ServiceUserMapped</span> <span class="n">serviceUserMapped</span><span class="o">;</span>
 <span class="o">}</span>
 </pre></div>
 
 
+<p>There is a default mapping applied if no OSGi configuration is available for the mapping. The default is: "serviceuser--" + bundleId [ + "--" + subservice-name]. Please note, that these default mappings are not represented as a ServiceUserMapped service and therefore the above mentioned reference does not work.</p>
 <h2 id="deprecation-of-administrative-authentication">Deprecation of administrative authentication<a class="headerlink" href="#deprecation-of-administrative-authentication" title="Permanent link">&para;</a></h2>
 <p>Originally the <code>ResourceResolverFactory.getAdministrativeResourceResolver</code>
 and <code>SlingRepository.loginAdministrative</code> methods have been defined to
@@ -382,7 +386,7 @@ It supports the following configuration
 </tbody>
 </table>
       <div class="timestamp" style="margin-top: 30px; font-size: 80%; text-align: right;">
-        Rev. 1792749 by kwin on Wed, 26 Apr 2017 14:18:16 +0000
+        Rev. 1794603 by cziegeler on Tue, 9 May 2017 15:57:52 +0000
       </div>
       <div class="trademarkFooter"> 
         Apache Sling, Sling, Apache, the Apache feather logo, and the Apache Sling project