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 2014/05/15 11:48:54 UTC

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

Author: buildbot
Date: Thu May 15 09:48:54 2014
New Revision: 908894

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

Propchange: websites/staging/jena/trunk/content/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Thu May 15 09:48:54 2014
@@ -1 +1 @@
-1594837
+1594839

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 Thu May 15 09:48:54 2014
@@ -170,21 +170,24 @@ used in favor of those for <code>http://
 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>
 <h4 id="formsauthenticator">FormsAuthenticator</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 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>
+<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>
 <p>This is one of the more complex authenticators to configure because it requires you to know certain details of the form login mechanism of 
 the service you are authenticating against.  In the simplest case where a site is using Apache <a href="https://httpd.apache.org/docs/2.4/mod/mod_auth_form.html">mod_auth_form</a> in its default configuration you
-can do the following to configure an authenticator:</p>
+merely need to know the URL to which login requests should be POSTed and your credentials.  Therefore you can do the following to configure 
+an authenticator:</p>
 <div class="codehilite"><pre><span class="n">URI</span> <span class="n">targetService</span> <span class="p">=</span> <span class="n">new</span> <span class="n">URI</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">org</span><span class="o">/</span><span class="n">sparql</span>&quot;<span class="p">);</span>
 <span class="n">FormLogin</span> <span class="n">formLogin</span> <span class="p">=</span> <span class="n">new</span> <span class="n">ApacheModAuthFormLogin</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">org</span><span class="o">/</span><span class="n">login</span>&quot;<span class="p">,</span> &quot;<span class="n">user</span>&quot;<span class="p">,</span> &quot;<span class="n">password</span>&quot;<span class="p">.</span><span class="n">toCharArray</span><span class="p">());</span>
 <span class="n">FormsAuthenticator</span> <span class="n">authenticator</span> <span class="p">=</span> <span class="n">new</span> <span class="n">FormsAuthenticator</span><span class="p">(</span><span class="n">targetService</span><span class="p">,</span> <span class="n">formLogin</span><span class="p">);</span>
 </pre></div>
 
 
-<p>However if the service is using a more complicated forms login setup you will need to know what the names of the form fields used to submit
-the username and password.  For example say we were authenticating to a service where the form fields were called <strong>id</strong> and <strong>pwd</strong> we'd
-need to configure our authenticator as follows:</p>
+<p>In the above example the service we want to authenticate against is <code>http://example.org/sparql</code> and it requires us to first login by POSTing
+our credentials to <code>http://example.org/login</code>.</p>
+<p>However if the service is using a more complicated forms login setup you will additionally need to know what the names of the form fields used 
+to submit the username and password.  For example say we were authenticating to a service where the form fields were called <strong>id</strong> and <strong>pwd</strong>
+we'd need to configure our authenticator as follows:</p>
 <div class="codehilite"><pre><span class="n">URI</span> <span class="n">targetService</span> <span class="p">=</span> <span class="n">new</span> <span class="n">URI</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">org</span><span class="o">/</span><span class="n">sparql</span>&quot;<span class="p">);</span>
 <span class="n">FormLogin</span> <span class="n">formLogin</span> <span class="p">=</span> <span class="n">new</span> <span class="n">ApacheModAuthFormLogin</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">org</span><span class="o">/</span><span class="n">login</span>&quot;<span class="p">,</span> &quot;<span class="n">id</span>&quot;<span class="p">,</span> &quot;<span class="n">pwd</span>&quot;<span class="p">,</span> &quot;<span class="n">user</span>&quot;<span class="p">,</span> &quot;<span class="n">password</span>&quot;<span class="p">.</span><span class="n">toCharArray</span><span class="p">());</span>
 <span class="n">FormsAuthenticator</span> <span class="n">authenticator</span> <span class="p">=</span> <span class="n">new</span> <span class="n">FormsAuthenticator</span><span class="p">(</span><span class="n">targetService</span><span class="p">,</span> <span class="n">formLogin</span><span class="p">);</span>
@@ -192,7 +195,8 @@ need to configure our authenticator as f
 
 
 <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>
+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>
 <h4 id="preemptivebasicauthenticator">PreemptiveBasicAuthenticator</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>