You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jena.apache.org by bu...@apache.org on 2016/11/08 17:58:15 UTC

svn commit: r1000760 - in /websites/staging/jena/trunk/content: ./ documentation/query/http-auth.html documentation/query/service.html

Author: buildbot
Date: Tue Nov  8 17:58:14 2016
New Revision: 1000760

Log:
Staging update by buildbot for jena

Modified:
    websites/staging/jena/trunk/content/   (props changed)
    websites/staging/jena/trunk/content/documentation/query/http-auth.html
    websites/staging/jena/trunk/content/documentation/query/service.html

Propchange: websites/staging/jena/trunk/content/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Tue Nov  8 17:58:14 2016
@@ -1 +1 @@
-1768736
+1768752

Modified: websites/staging/jena/trunk/content/documentation/query/http-auth.html
==============================================================================
--- websites/staging/jena/trunk/content/documentation/query/http-auth.html (original)
+++ websites/staging/jena/trunk/content/documentation/query/http-auth.html Tue Nov  8 17:58:14 2016
@@ -155,10 +155,67 @@
   visibility: hidden;
 }
 h2:hover > .headerlink, h3:hover > .headerlink, h1:hover > .headerlink, h6:hover > .headerlink, h4:hover > .headerlink, h5:hover > .headerlink, dt:hover > .elementid-permalink { visibility: visible }</style>
-<p>From ARQ 2.11.0 through ARQ 3.1.0 there is a Jena-specific unified HTTP operation framework that provides a uniform mechanism for 
-HTTP authentication that also allows ARQ to support a broader range of authentication mechanisms than were previously possible. After ARQ 3.1.0, Jena exposes the underlying HTTP Commons functionality to the same end. This documentation is therefore devided into two sections. The first explains the older Jena-specific functionality, and the second explains how to use HTTP Commons code to the same ends.</p>
-<h2 id="http-authentication-before-arq-310">HTTP Authentication before ARQ 3.1.0<a class="headerlink" href="#http-authentication-before-arq-310" title="Permanent link">&para;</a></h2>
-<h3 id="applying-authentication">Applying Authentication<a class="headerlink" href="#applying-authentication" title="Permanent link">&para;</a></h3>
+<p>After <a href="#http-authentication-from-jena-311">Jena 3.1.0</a>, Jena exposes the underlying HTTP Commons functionality to support a range of authentication mechanisms as well as <a href="https://hc.apache.org/httpcomponents-client-ga/examples.html">other HTTP configuration</a>. From <a href="#http-authentication-from-jena 300-through-310">Jena 3.0.0 through Jena 3.1.0</a> there is a Jena-specific framework that provides a uniform mechanism for HTTP authentication. This documentation is therefore devided into two sections. The first explains how to use HTTP Commons code, and the second explains the older Jena-specific functionality.</p>
+<h2 id="http-authentication-from-jena-311">HTTP Authentication from Jena 3.1.1<a class="headerlink" href="#http-authentication-from-jena-311" title="Permanent link">&para;</a></h2>
+<p>Applying Authentication</p>
+<p>APIs that support authentication typically provide methods for providing an [HttpClient] for use with the given instance of that API class. Since it may not always be possible/practical to configure authenticators on a per-request basis the API includes a means to specify a default client that is used when no other client is explicitly specified.  This may be configured via the 
+<code>setDefaultHttpClient(HttpClient httpClient)</code> method of the <a href="http://jena.apache.org/documentation/javadoc/arq/org/apache/jena/riot/web/HttpOp.html">HttpOp</a> class. This allows for static-scoped configuration of HTTP behavior.</p>
+<h3 id="examples-of-authentication">Examples of authentication<a class="headerlink" href="#examples-of-authentication" title="Permanent link">&para;</a></h3>
+<p>This section includes a series of examples showing how to use HTTP Commons classes to perform authenticated work. Most of them take advantage of <code>HttpOp.setDefaultHttpClient</code> as described above.</p>
+<h4 id="simple-authentication-using-username-and-password">Simple authentication using username and password<a class="headerlink" href="#simple-authentication-using-username-and-password" title="Permanent link">&para;</a></h4>
+<p>First we build an authenticating client:</p>
+<div class="codehilite"><pre><span class="n">CredentialsProvider</span> <span class="n">credsProvider</span> <span class="p">=</span> <span class="n">new</span> <span class="n">BasicCredentialsProvider</span><span class="p">();</span>
+<span class="n">Credentials</span> <span class="n">credentials</span> <span class="p">=</span> <span class="n">new</span> <span class="n">UsernamePasswordCredentials</span><span class="p">(</span>&quot;<span class="n">user</span>&quot;<span class="p">,</span> &quot;<span class="n">passwd</span>&quot;<span class="p">);</span>
+<span class="n">credsProvider</span><span class="p">.</span><span class="n">setCredentials</span><span class="p">(</span><span class="n">AuthScope</span><span class="p">.</span><span class="n">ANY</span><span class="p">,</span> <span class="n">credentials</span><span class="p">);</span>
+<span class="n">HttpClient</span> <span class="n">httpclient</span> <span class="p">=</span> <span class="n">HttpClients</span><span class="p">.</span><span class="n">custom</span><span class="p">()</span>
+    <span class="p">.</span><span class="n">setDefaultCredentialsProvider</span><span class="p">(</span><span class="n">credsProvider</span><span class="p">)</span>
+    <span class="p">.</span><span class="n">build</span><span class="p">();</span>
+<span class="n">HttpOp</span><span class="p">.</span><span class="n">setDefaultHttpClient</span><span class="p">(</span><span class="n">httpclient</span><span class="p">);</span>
+</pre></div>
+
+
+<p>Notice that we gave no scope for use with the credentials (<code>AuthScope.ANY</code>). We can make further use of that parameter if we want to assign a scope for some credentials:</p>
+<div class="codehilite"><pre><span class="n">CredentialsProvider</span> <span class="n">credsProvider</span> <span class="p">=</span> <span class="n">new</span> <span class="n">BasicCredentialsProvider</span><span class="p">();</span>
+<span class="n">Credentials</span> <span class="n">unscopedCredentials</span> <span class="p">=</span> <span class="n">new</span> <span class="n">UsernamePasswordCredentials</span><span class="p">(</span>&quot;<span class="n">user</span>&quot;<span class="p">,</span> &quot;<span class="n">passwd</span>&quot;<span class="p">);</span>
+<span class="n">credsProvider</span><span class="p">.</span><span class="n">setCredentials</span><span class="p">(</span><span class="n">AuthScope</span><span class="p">.</span><span class="n">ANY</span><span class="p">,</span> <span class="n">unscopedCredentials</span><span class="p">);</span>
+<span class="n">Credentials</span> <span class="n">scopedCredentials</span> <span class="p">=</span> <span class="n">new</span> <span class="n">UsernamePasswordCredentials</span><span class="p">(</span>&quot;<span class="n">user</span>&quot;<span class="p">,</span> &quot;<span class="n">passwd</span>&quot;<span class="p">);</span>
+<span class="n">final</span> <span class="n">String</span> <span class="n">host</span> <span class="p">=</span> &quot;<span class="n">http</span><span class="p">:</span><span class="o">//</span><span class="n">example</span><span class="p">.</span><span class="n">com</span><span class="o">/</span><span class="n">sparql</span>&quot;<span class="p">;</span>
+<span class="n">final</span> <span class="n">int</span> <span class="n">port</span> <span class="p">=</span> 80<span class="p">;</span>
+<span class="n">final</span> <span class="n">String</span> <span class="n">realm</span> <span class="p">=</span> &quot;<span class="n">aRealm</span>&quot;<span class="p">;</span>
+<span class="n">final</span> <span class="n">String</span> <span class="n">schemeName</span> <span class="p">=</span> &quot;<span class="n">DIGEST</span>&quot;<span class="p">;</span>
+<span class="n">AuthScope</span> <span class="n">authscope</span> <span class="p">=</span> <span class="n">new</span> <span class="n">AuthScope</span><span class="p">(</span><span class="n">host</span><span class="p">,</span> <span class="n">port</span><span class="p">,</span> <span class="n">realm</span><span class="p">,</span> <span class="n">schemeName</span><span class="p">);</span>
+<span class="n">credsProvider</span><span class="p">.</span><span class="n">setCredentials</span><span class="p">(</span><span class="n">authscope</span><span class="p">,</span> <span class="n">scopedCredentials</span><span class="p">);</span>
+<span class="n">HttpClient</span> <span class="n">httpclient</span> <span class="p">=</span> <span class="n">HttpClients</span><span class="p">.</span><span class="n">custom</span><span class="p">()</span>
+    <span class="p">.</span><span class="n">setDefaultCredentialsProvider</span><span class="p">(</span><span class="n">credsProvider</span><span class="p">)</span>
+    <span class="p">.</span><span class="n">build</span><span class="p">();</span>
+<span class="n">HttpOp</span><span class="p">.</span><span class="n">setDefaultHttpClient</span><span class="p">(</span><span class="n">httpclient</span><span class="p">);</span>
+</pre></div>
+
+
+<h4 id="authenticating-via-a-form">Authenticating via a form<a class="headerlink" href="#authenticating-via-a-form" title="Permanent link">&para;</a></h4>
+<p>For this case we introduce an <a href="https://hc.apache.org/httpcomponents-client-ga/httpclient/apidocs/org/apache/http/client/protocol/HttpClientContext.html">HttpClientContext</a>, which we can use to retrieve the cookie we get from logging into a form. We then use the cookie to authenticate elsewhere.</p>
+<div class="codehilite"><pre><span class="c1">// we&#39;ll use this context to maintain our HTTP &quot;conversation&quot;</span>
+<span class="n">HttpClientContext</span> <span class="n">httpContext</span> <span class="o">=</span> <span class="k">new</span> <span class="n">HttpClientContext</span><span class="p">();</span>
+
+<span class="c1">// first we use a method on HttpOp to log in and get our cookie</span>
+<span class="n">Params</span> <span class="n">params</span> <span class="o">=</span> <span class="k">new</span> <span class="n">Params</span><span class="p">();</span>
+<span class="n">params</span><span class="p">.</span><span class="n">addParam</span><span class="p">(</span><span class="s">&quot;username&quot;</span><span class="p">,</span> <span class="s">&quot;Bob Wu&quot;</span><span class="p">);</span>
+<span class="n">params</span><span class="p">.</span><span class="n">addParam</span><span class="p">(</span><span class="s">&quot;password&quot;</span><span class="p">,</span> <span class="s">&quot;my password&quot;</span><span class="p">);</span>
+<span class="n">HttpOp</span><span class="p">.</span><span class="n">execHttpPostForm</span><span class="p">(</span><span class="s">&quot;http://example.com/loginform&quot;</span><span class="p">,</span> <span class="n">params</span> <span class="p">,</span> <span class="k">null</span><span class="p">,</span> <span class="k">null</span><span class="p">,</span> <span class="k">null</span><span class="p">,</span> <span class="n">httpContext</span><span class="p">);</span>
+
+<span class="c1">// now our cookie is stored in httpContext</span>
+<span class="n">CookieStore</span> <span class="n">cookieStore</span> <span class="o">=</span> <span class="n">httpContext</span><span class="p">.</span><span class="n">getCookieStore</span><span class="p">();</span>
+
+<span class="c1">// lastly we build a client that uses that cookie</span>
+<span class="n">HttpClient</span> <span class="n">httpclient</span> <span class="o">=</span> <span class="n">HttpClients</span><span class="p">.</span><span class="n">custom</span><span class="p">()</span>
+    <span class="p">.</span><span class="n">setDefaultCookieStore</span><span class="p">(</span><span class="n">cookieStore</span><span class="p">)</span>
+    <span class="p">.</span><span class="n">build</span><span class="p">();</span>
+<span class="n">HttpOp</span><span class="p">.</span><span class="n">setDefaultHttpClient</span><span class="p">(</span><span class="n">httpclient</span><span class="p">);</span>
+</pre></div>
+
+
+<h2 id="http-authentication-from-jena-300-through-310">HTTP Authentication from Jena 3.0.0 through 3.1.0<a class="headerlink" href="#http-authentication-from-jena-300-through-310" title="Permanent link">&para;</a></h2>
+<p>Applying Authentication</p>
 <p>APIs that support authentication typically provide two methods for providing authenticators, a <code>setAuthentication(String username, char[] password)</code> method
 which merely configures a <code>SimpleAuthenticator</code>.  There will also be a <code>setAuthenticator(HttpAuthenticator authenticator)</code> method
 that allows you to configure an arbitrary authenticator.</p>
@@ -179,16 +236,16 @@ avoids the needs to cast and manually se
 </pre></div>
 
 
-<h4 id="authenticators">Authenticators<a class="headerlink" href="#authenticators" title="Permanent link">&para;</a></h4>
+<h3 id="authenticators">Authenticators<a class="headerlink" href="#authenticators" title="Permanent link">&para;</a></h3>
 <p>Authentication mechanisms are provided by <a href="http://jena.apache.org/documentation/javadoc/arq/org/apache/jena/atlas/web/auth/HttpAuthenticator.html">HttpAuthenticator</a> implementations of which a number are provided built into ARQ.</p>
 <p>This API provides the authenticator with access to the <code>HttpClient</code>, <code>HttpContext</code> and target <code>URI</code> of the request that is about to be carried 
 out.  This allows for authenticators to add credentials to requests on a per-request basis and/or to use different mechanisms and credentials for different services.</p>
-<h5 id="simpleauthenticator">SimpleAuthenticator<a class="headerlink" href="#simpleauthenticator" title="Permanent link">&para;</a></h5>
+<h4 id="simpleauthenticator">SimpleAuthenticator<a class="headerlink" href="#simpleauthenticator" title="Permanent link">&para;</a></h4>
 <p>The <a href="http://jena.apache.org/documentation/javadoc/arq/org/apache/jena/atlas/web/auth/SimpleAuthenticator.html">simple authenticator</a> is as the name suggests the simplest implementation.  It takes a single set of credentials which is applied to
 any service.</p>
 <p>Authentication however is not preemptive so unless the remote service sends a HTTP challenge (401 Unauthorized or 407 Proxy Authorization
  Required) then credentials will not actually be submitted.</p>
-<h5 id="scopedauthenticator">ScopedAuthenticator<a class="headerlink" href="#scopedauthenticator" title="Permanent link">&para;</a></h5>
+<h4 id="scopedauthenticator">ScopedAuthenticator<a class="headerlink" href="#scopedauthenticator" title="Permanent link">&para;</a></h4>
 <p>The <a href="http://jena.apache.org/documentation/javadoc/arq/org/apache/jena/atlas/web/auth/ScopedAuthenticator.html">scoped authenticator</a> is an authenticator which maps credentials to different service URIs.  This allows you to specify different 
 credentials for different services as appropriate.  Similarly to the simple authenticator this is not preemptive authentication so credentials are 
 not sent unless the service requests them.</p>
@@ -196,11 +253,11 @@ not sent unless the service requests the
 if you define credentialsfor <code>http://example.org</code> then these are used for any request that requires authentication under that URI 
 e.g. <code>http://example.org/some/path</code>.  However if you had also defined credentials for <code>http://example.org/some/path</code> then these would be 
 used in favor of those for <code>http://example.org</code></p>
-<h5 id="serviceauthenticator">ServiceAuthenticator<a class="headerlink" href="#serviceauthenticator" title="Permanent link">&para;</a></h5>
+<h4 id="serviceauthenticator">ServiceAuthenticator<a class="headerlink" href="#serviceauthenticator" title="Permanent link">&para;</a></h4>
 <p>The <a href="http://jena.apache.org/documentation/javadoc/arq/org/apache/jena/atlas/web/auth/ServiceAuthenticator.html">service authenticator</a> is an authenticator which uses information encoded in the ARQ context and basically provides access to the 
 existing credential provision mechanisms provided for the <code>SERVICE</code> clause, see <a href="service.html">Basic Federated Query</a> for more information on 
 configuration for this.</p>
-<h5 id="formsauthenticator">FormsAuthenticator<a class="headerlink" href="#formsauthenticator" title="Permanent link">&para;</a></h5>
+<h4 id="formsauthenticator">FormsAuthenticator<a class="headerlink" href="#formsauthenticator" title="Permanent link">&para;</a></h4>
 <p>The <a href="http://jena.apache.org/documentation/javadoc/arq/org/apache/jena/atlas/web/auth/FormsAuthenticator.html">forms authenticator</a> is an authenticator usable with services that require form based logins and use session cookies to verify login state.
 This is intended for use with services that don't support HTTP's built-in authentication mechanisms for whatever reason.  One example of this 
 are servers secured using Apache HTTP Server <a href="https://httpd.apache.org/docs/2.4/mod/mod_auth_form.html">mod_auth_form</a>.</p>
@@ -228,7 +285,7 @@ we'd need to configure our authenticator
 <p>Note that you can also create a forms authenticator that uses different login forms for different services by creating a <code>Map&lt;URI, FormLogin&gt;</code>
 that maps each service to an associated form login and passing that to the <code>FormsAuthenticator</code> constructor.</p>
 <p>Currently forms based login that require more than just a username and password are not supported.</p>
-<h5 id="preemptivebasicauthenticator">PreemptiveBasicAuthenticator<a class="headerlink" href="#preemptivebasicauthenticator" title="Permanent link">&para;</a></h5>
+<h4 id="preemptivebasicauthenticator">PreemptiveBasicAuthenticator<a class="headerlink" href="#preemptivebasicauthenticator" title="Permanent link">&para;</a></h4>
 <p>This <a href="http://jena.apache.org/documentation/javadoc/arq/org/apache/jena/atlas/web/auth/PreemptiveBasicAuthenticator.html">authenticator</a> is a decorator over another authenticator that enables preemptive basic authentication, this <strong>only</strong> works for servers 
 that support basic authentication and so will cause authentication failures when any other authentication scheme is required.  You should <strong>only</strong>
 use this when you know the remote server uses basic authentication.</p>
@@ -241,10 +298,10 @@ use this when you know the remote server
 <p>Also be aware that basic authentication is very insecure since it sends credentials over the wire with only obfuscation for protection.  Therefore
 many servers will use more secure schemes like Digest authentication which <strong>cannot</strong> be done preemptively as they require more complex
 challenge response sequences.</p>
-<h5 id="delegatingauthenticator">DelegatingAuthenticator<a class="headerlink" href="#delegatingauthenticator" title="Permanent link">&para;</a></h5>
+<h4 id="delegatingauthenticator">DelegatingAuthenticator<a class="headerlink" href="#delegatingauthenticator" title="Permanent link">&para;</a></h4>
 <p>The <a href="http://jena.apache.org/documentation/javadoc/arq/org/apache/jena/atlas/web/auth/DelegatingAuthenticator.html">delegating authenticator</a> allows for mapping different authenticators to different services, this is useful when you need to mix and 
 match the types of authentication needed.</p>
-<h4 id="the-default-authenticator">The Default Authenticator<a class="headerlink" href="#the-default-authenticator" title="Permanent link">&para;</a></h4>
+<h3 id="the-default-authenticator">The Default Authenticator<a class="headerlink" href="#the-default-authenticator" title="Permanent link">&para;</a></h3>
 <p>Since it may not always be possible/practical to configure authenticators on a per-request basis the API includes a means to specify a default 
 authenticator that is used when no authenticator is explicitly specified.  This may be configured via the 
 <code>setDefaultAuthenticator(HttpAuthenticator authenticator)</code> method of the <a href="http://jena.apache.org/documentation/javadoc/arq/org/apache/jena/riot/web/HttpOp.html">HttpOp</a> class.</p>
@@ -253,64 +310,6 @@ backwards compatibility with prior versi
 <p>You can configure the default authenticator to whatever you need so even if you don't directly control the code that is making HTTP requests 
 provided that it is using ARQs APIs to make these then authentication will still be applied.</p>
 <p>Note that the default authenticator may be disabled by setting it to <code>null</code>.</p>
-<h2 id="http-authentication-after-arq-310">HTTP Authentication after ARQ 3.1.0<a class="headerlink" href="#http-authentication-after-arq-310" title="Permanent link">&para;</a></h2>
-<h3 id="applying-authentication_1">Applying Authentication<a class="headerlink" href="#applying-authentication_1" title="Permanent link">&para;</a></h3>
-<p>APIs that support authentication typically provide methods for providing an [HttpClient] for use with the given instance of that API class. <code>HttpClient</code> is <a href="https://hc.apache.org/httpcomponents-client-ga/examples.html">extremely flexible</a> and can handle most scenarios very well. Since it may not always be possible/practical to configure authenticators on a per-request basis the API includes a means to specify a default client that is used when no other client is explicitly specified.  This may be configured via the 
-<code>setDefaultHttpClient(HttpClient httpClient)</code> method of the <a href="http://jena.apache.org/documentation/javadoc/arq/org/apache/jena/riot/web/HttpOp.html">HttpOp</a> class. This allows for static-scoped configuration of HTTP behavior.</p>
-<h4 id="examples-of-authentication">Examples of authentication<a class="headerlink" href="#examples-of-authentication" title="Permanent link">&para;</a></h4>
-<p>This section includes a series of examples showing how to use HTTP Commons classes to perform authenticated work. Most of them take advantage of <code>HttpOp.setDefaultHttpClient</code> as described above.</p>
-<h5 id="simple-authentication-using-username-and-password">Simple authentication using username and password<a class="headerlink" href="#simple-authentication-using-username-and-password" title="Permanent link">&para;</a></h5>
-<p>First we build an authenticating client:</p>
-<div class="codehilite"><pre><span class="n">CredentialsProvider</span> <span class="n">credsProvider</span> <span class="p">=</span> <span class="n">new</span> <span class="n">BasicCredentialsProvider</span><span class="p">();</span>
-<span class="n">Credentials</span> <span class="n">credentials</span> <span class="p">=</span> <span class="n">new</span> <span class="n">UsernamePasswordCredentials</span><span class="p">(</span>&quot;<span class="n">user</span>&quot;<span class="p">,</span> &quot;<span class="n">passwd</span>&quot;<span class="p">);</span>
-<span class="n">credsProvider</span><span class="p">.</span><span class="n">setCredentials</span><span class="p">(</span><span class="n">AuthScope</span><span class="p">.</span><span class="n">ANY</span><span class="p">,</span> <span class="n">credentials</span><span class="p">);</span>
-<span class="n">HttpClient</span> <span class="n">httpclient</span> <span class="p">=</span> <span class="n">HttpClients</span><span class="p">.</span><span class="n">custom</span><span class="p">()</span>
-    <span class="p">.</span><span class="n">setDefaultCredentialsProvider</span><span class="p">(</span><span class="n">credsProvider</span><span class="p">)</span>
-    <span class="p">.</span><span class="n">build</span><span class="p">();</span>
-<span class="n">HttpOp</span><span class="p">.</span><span class="n">setDefaultHttpClient</span><span class="p">(</span><span class="n">httpclient</span><span class="p">);</span>
-</pre></div>
-
-
-<p>Notice that we gave no scope for use with the credentials (<code>AuthScope.ANY</code>). We can make further use of that parameter if we want to assign a scope for some credentials:</p>
-<div class="codehilite"><pre><span class="n">CredentialsProvider</span> <span class="n">credsProvider</span> <span class="p">=</span> <span class="n">new</span> <span class="n">BasicCredentialsProvider</span><span class="p">();</span>
-<span class="n">Credentials</span> <span class="n">unscopedCredentials</span> <span class="p">=</span> <span class="n">new</span> <span class="n">UsernamePasswordCredentials</span><span class="p">(</span>&quot;<span class="n">user</span>&quot;<span class="p">,</span> &quot;<span class="n">passwd</span>&quot;<span class="p">);</span>
-<span class="n">credsProvider</span><span class="p">.</span><span class="n">setCredentials</span><span class="p">(</span><span class="n">AuthScope</span><span class="p">.</span><span class="n">ANY</span><span class="p">,</span> <span class="n">unscopedCredentials</span><span class="p">);</span>
-<span class="n">Credentials</span> <span class="n">scopedCredentials</span> <span class="p">=</span> <span class="n">new</span> <span class="n">UsernamePasswordCredentials</span><span class="p">(</span>&quot;<span class="n">user</span>&quot;<span class="p">,</span> &quot;<span class="n">passwd</span>&quot;<span class="p">);</span>
-<span class="n">final</span> <span class="n">String</span> <span class="n">host</span> <span class="p">=</span> &quot;<span class="n">http</span><span class="p">:</span><span class="o">//</span><span class="n">example</span><span class="p">.</span><span class="n">com</span><span class="o">/</span><span class="n">sparql</span>&quot;<span class="p">;</span>
-<span class="n">final</span> <span class="n">int</span> <span class="n">port</span> <span class="p">=</span> 80<span class="p">;</span>
-<span class="n">final</span> <span class="n">String</span> <span class="n">realm</span> <span class="p">=</span> &quot;<span class="n">aRealm</span>&quot;<span class="p">;</span>
-<span class="n">final</span> <span class="n">String</span> <span class="n">schemeName</span> <span class="p">=</span> &quot;<span class="n">DIGEST</span>&quot;<span class="p">;</span>
-<span class="n">AuthScope</span> <span class="n">authscope</span> <span class="p">=</span> <span class="n">new</span> <span class="n">AuthScope</span><span class="p">(</span><span class="n">host</span><span class="p">,</span> <span class="n">port</span><span class="p">,</span> <span class="n">realm</span><span class="p">,</span> <span class="n">schemeName</span><span class="p">);</span>
-<span class="n">credsProvider</span><span class="p">.</span><span class="n">setCredentials</span><span class="p">(</span><span class="n">authscope</span><span class="p">,</span> <span class="n">scopedCredentials</span><span class="p">);</span>
-<span class="n">HttpClient</span> <span class="n">httpclient</span> <span class="p">=</span> <span class="n">HttpClients</span><span class="p">.</span><span class="n">custom</span><span class="p">()</span>
-    <span class="p">.</span><span class="n">setDefaultCredentialsProvider</span><span class="p">(</span><span class="n">credsProvider</span><span class="p">)</span>
-    <span class="p">.</span><span class="n">build</span><span class="p">();</span>
-<span class="n">HttpOp</span><span class="p">.</span><span class="n">setDefaultHttpClient</span><span class="p">(</span><span class="n">httpclient</span><span class="p">);</span>
-</pre></div>
-
-
-<h5 id="authenticating-via-a-form">Authenticating via a form<a class="headerlink" href="#authenticating-via-a-form" title="Permanent link">&para;</a></h5>
-<p>For this case we introduce an <a href="https://hc.apache.org/httpcomponents-client-ga/httpclient/apidocs/org/apache/http/client/protocol/HttpClientContext.html">HttpClientContext</a>, which we can use to retrieve the cookie we get from logging into a form. We then use the cookie to authenticate elsewhere.</p>
-<div class="codehilite"><pre><span class="c1">// we&#39;ll use this context to maintain our HTTP &quot;conversation&quot;</span>
-<span class="n">HttpClientContext</span> <span class="n">httpContext</span> <span class="o">=</span> <span class="k">new</span> <span class="n">HttpClientContext</span><span class="p">();</span>
-
-<span class="c1">// first we use a method on HttpOp to log in and get our cookie</span>
-<span class="n">Params</span> <span class="n">params</span> <span class="o">=</span> <span class="k">new</span> <span class="n">Params</span><span class="p">();</span>
-<span class="n">params</span><span class="p">.</span><span class="n">addParam</span><span class="p">(</span><span class="s">&quot;username&quot;</span><span class="p">,</span> <span class="s">&quot;Bob Wu&quot;</span><span class="p">);</span>
-<span class="n">params</span><span class="p">.</span><span class="n">addParam</span><span class="p">(</span><span class="s">&quot;password&quot;</span><span class="p">,</span> <span class="s">&quot;my password&quot;</span><span class="p">);</span>
-<span class="n">HttpOp</span><span class="p">.</span><span class="n">execHttpPostForm</span><span class="p">(</span><span class="s">&quot;http://example.com/loginform&quot;</span><span class="p">,</span> <span class="n">params</span> <span class="p">,</span> <span class="k">null</span><span class="p">,</span> <span class="k">null</span><span class="p">,</span> <span class="k">null</span><span class="p">,</span> <span class="n">httpContext</span><span class="p">);</span>
-
-<span class="c1">// now our cookie is stored in httpContext</span>
-<span class="n">CookieStore</span> <span class="n">cookieStore</span> <span class="o">=</span> <span class="n">httpContext</span><span class="p">.</span><span class="n">getCookieStore</span><span class="p">();</span>
-
-<span class="c1">// lastly we build a client that uses that cookie</span>
-<span class="n">HttpClient</span> <span class="n">httpclient</span> <span class="o">=</span> <span class="n">HttpClients</span><span class="p">.</span><span class="n">custom</span><span class="p">()</span>
-    <span class="p">.</span><span class="n">setDefaultCookieStore</span><span class="p">(</span><span class="n">cookieStore</span><span class="p">)</span>
-    <span class="p">.</span><span class="n">build</span><span class="p">();</span>
-<span class="n">HttpOp</span><span class="p">.</span><span class="n">setDefaultHttpClient</span><span class="p">(</span><span class="n">httpclient</span><span class="p">);</span>
-</pre></div>
-
-
 <h2 id="other-concerns">Other concerns<a class="headerlink" href="#other-concerns" title="Permanent link">&para;</a></h2>
 <h3 id="debugging-authentication">Debugging Authentication<a class="headerlink" href="#debugging-authentication" title="Permanent link">&para;</a></h3>
 <p>ARQ uses <a href="http://hc.apache.org">Apache Http Client</a> for all its HTTP operations and this provides detailed logging information that can be used for debugging.  To

Modified: websites/staging/jena/trunk/content/documentation/query/service.html
==============================================================================
--- websites/staging/jena/trunk/content/documentation/query/service.html (original)
+++ websites/staging/jena/trunk/content/documentation/query/service.html Tue Nov  8 17:58:14 2016
@@ -208,7 +208,7 @@ the title already bound from earlier in
 <p>The <code>SERVICE</code> operation in a SPARQL query may be configured via the Context. The values for configuration can be set in the global context (accessed via 
 <code>ARQ.getContext()</code>) or in the per-query execution context.</p>
 <p>The prefix  <code>srv:</code> is the IRI <code>&lt;http://jena.hpl.hp.com/Service#&gt;</code>.</p>
-<h3 id="configuration-for-arq-through-version-310">Configuration for ARQ through version 3.1.0<a class="headerlink" href="#configuration-for-arq-through-version-310" title="Permanent link">&para;</a></h3>
+<h3 id="configuration-for-jena-version-300-through-310">Configuration for Jena version 3.0.0 through 3.1.0<a class="headerlink" href="#configuration-for-jena-version-300-through-310" title="Permanent link">&para;</a></h3>
 <table class="table">
 <thead>
 <tr>
@@ -271,7 +271,7 @@ False</p>
 <p>Provides a mechanism to override system context settings on a per URI basis.</p>
 <p>The value is a <code>Map&lt;String,Context&gt;</code> where the map key is the URI of the service endpoint, and the <code>Context</code> is a set of values to override the default values.</p>
 <p>If a context is provided for the URI the system context is copied and the URI specific values are then copied in.  This ensures that any URI specific settings will be used.</p>
-<h3 id="configuration-for-arq-after-version-310">Configuration for ARQ after version 3.1.0<a class="headerlink" href="#configuration-for-arq-after-version-310" title="Permanent link">&para;</a></h3>
+<h3 id="configuration-from-jena-version-311">Configuration from Jena version 3.1.1<a class="headerlink" href="#configuration-from-jena-version-311" title="Permanent link">&para;</a></h3>
 <table class="table">
 <thead>
 <tr>