<docbook><section><title>WebIDTLSDelegationWhatWhyHow</title><para> </para>
<title> WebID+TLS+Delegation Usage Guide</title> WebID+TLS+Delegation Usage Guide
<bridgehead class="http://www.w3.org/1999/xhtml:h2"> What is it?</bridgehead>
<para>WebID+TLS+Delegation is an open standards based multi-protocol authentication layer that provides fine-grained attributed-based access controls (ABAC) to protected resources (HTTP-accessible documents, folders, services [via their endpoints], and SPARQL named graphs).
 In a nutshell, this solution uses logic expressed in the nature of entity relationships to address issues such as identity, authorization, and restriction.</para>
<figure><graphic fileref="WebIDTLSDelegationWhatWhyHow/VirtWebIdTlsDelegationArchDiag.png" /></figure><bridgehead class="http://www.w3.org/1999/xhtml:h3"> Key Components</bridgehead>
<para>The key components of this solution are:</para>
<itemizedlist mark="bullet" spacing="compact"><listitem>HTTP URI (Hyperlink) based Entity Identifiers (Names) </listitem>
<listitem>TLS based data transmission </listitem>
<listitem>RDF Language based Statements representing Entity Relationships and      Entity Relationship Types </listitem>
<listitem>Ontology of terms from shared vocabularies such as <itemizedlist mark="bullet" spacing="compact"><listitem>&lt;<ulink url="http://www.w3.org/ns/auth/acl#Authorization">http://www.w3.org/ns/auth/acl#Authorization</ulink>&gt; </listitem>
<listitem>&lt;<ulink url="http://www.openlinksw.com/ontology/acl#">http://www.openlinksw.com/ontology/acl#</ulink>&gt; </listitem>
<listitem>&lt;<ulink url="http://www.openlinksw.com/ontology/restrictions#">http://www.openlinksw.com/ontology/restrictions#</ulink>&gt; </listitem>
<listitem>&lt;<ulink url="http://www.openlinksw.com/schemas/cert#">http://www.openlinksw.com/schemas/cert#</ulink>&gt; </listitem>
<listitem>and others </listitem>
</itemizedlist></listitem>
<listitem>Entity Relationship Type Semantics — including the nature of      relationships that exist between Software Applications and their Users      via &lt;<ulink url="http://www.openlinksw.com/schemas/cert#onBehalfOf">http://www.openlinksw.com/schemas/cert#onBehalfOf</ulink>&gt;</listitem>
</itemizedlist><para> </para>
<bridgehead class="http://www.w3.org/1999/xhtml:h3"> Primary Features</bridgehead>
<para>Collectively, the components above enable:</para>
<itemizedlist mark="bullet" spacing="compact"><listitem>Unambiguous Naming for Software Applications (Agents or Bots) and      their Users </listitem>
<listitem>Identity Claims Construction </listitem>
<listitem>Identity Claims Verification </listitem>
<listitem>Resource Access Rules (Authorizations) Creation &amp; Evaluation </listitem>
<listitem>Resource Access Rate Rules (Restrictions) Creation &amp; Evaluation .</listitem>
</itemizedlist><bridgehead class="http://www.w3.org/1999/xhtml:h2"> Why is it important?</bridgehead>
<para>Explicitly distinguishing the identity of an user and an application is a fundamental requirement for practical attribute-based access controls that leverage open standards such as:</para>
<itemizedlist mark="bullet" spacing="compact"><listitem>URIs — Entity Denotation </listitem>
<listitem>HTTP — Data Access Protocol </listitem>
<listitem>HTTP URIs — Entity Identification (Denotation &amp; Connotation via      in-built interpretation using Denotation-&gt;Connotation redirection) </listitem>
<listitem>RDF Language Statements — enabling construction of Profile      Documents using machine- and human-comprehensible sentences/statements </listitem>
<listitem>X.509 — Identity Cards (Certificates) that include references to      Profile Documents via Subject Alternative Name field </listitem>
<listitem>TLS — Data Encryption and Basic Identity Verification that scales      to the Internet and Web.</listitem>
</itemizedlist><bridgehead class="http://www.w3.org/1999/xhtml:h2"> How do I use it?</bridgehead>
<bridgehead class="http://www.w3.org/1999/xhtml:h3"> Server Setup</bridgehead>
<para>   A Virtuoso Server instance with the WebID+TLS+Delegation feature available needs to be installed on any OS it is available for.
 Once installed the Virtuoso server needs to be configured to Listen on Secure SSL HTTP (i.e., https) and SQL ports using your own  as detailed at:</para>
<itemizedlist mark="bullet" spacing="compact"><listitem><ulink url="http://virtuoso.openlinksw.com/dataspace/doc/dav/wiki/Main/VirtSetupSSL">Configuring Virtuoso Server HTTPS Listener Endpoint</ulink> </listitem>
<listitem><ulink url="http://docs.openlinksw.com/virtuoso/odbcimplementation.html#secureodbcclisrvsetup">Configuring Virtuoso Server SQL TLS/SSL Listener Port</ulink></listitem>
</itemizedlist><bridgehead class="http://www.w3.org/1999/xhtml:h4"> Additional Virtuoso Components to be installed</bridgehead>
<para>The following Virtuoso application should be installed from the <emphasis>System Admin -&gt; Packages</emphasis> tab of the Conductor:</para>
<itemizedlist mark="bullet" spacing="compact"><listitem>Sponger Cartridge VAD - To enable querying of remote resource URIs </listitem>
<listitem>Faceted Browser VAD - To provide human readable form of Web ID Profile documents and ACLs </listitem>
<listitem>Virtuoso Authentication Layer (VAL) VAD - To enable ACLs for be setup and enforced <itemizedlist mark="bullet" spacing="compact"><listitem>URIQA DefaultHost in INI file must be set to valid hostname to be used by VAL</listitem>
</itemizedlist></listitem>
</itemizedlist><bridgehead class="http://www.w3.org/1999/xhtml:h3"> Software Agent Certificate Generation</bridgehead>
<para>A Software agent server certificate needs to be generated or provided and associated with a suitable WebID as its SAN (Subject Alternate Name).
 The <ulink url="OpenLink">OpenLink</ulink> <ulink url="http://id.myopenlink.net/youid/">YouID Certificate Generation</ulink> service can be used for the create of such certificates, or any other suitable external service can be used.</para>
<bridgehead class="http://www.w3.org/1999/xhtml:h3"> Software Agent PKCS#12 generation</bridgehead>
<para>A PKCS#12 binary format certificate needs to to generated storing the server certificate, any intermediate certificates, and the private key into a single encrypt able password protected file.
 If intermediary file to complete the chain of trust are not included in the PKCS#12 file then them must either be registered in the Operating System Key store/chain or public keys passed with the -T param during connection.</para>
<bridgehead class="http://www.w3.org/1999/xhtml:h3"> Software Agents and Users Web IDs generation and uploading</bridgehead>
<para>WebID profile documents need to be generate for the software agent and user connections are to be delegated on behalf of and accessible from suitably accessible URI.</para>
<bridgehead class="http://www.w3.org/1999/xhtml:h4"> Web ID Profile Document Entries</bridgehead>
<itemizedlist mark="bullet" spacing="compact"><listitem>Add oplcert:onBehalfOf relations to the Agent&#39;s WebID-Profile Document that associates it with authorized Users </listitem>
<listitem>Add an entry in the WebID-Profile doc of each User that associates them with the Agent </listitem>
<listitem>Load WebID-Profile Documents into Virtuoso&#39;s Quad Store (using the various options it supports: Sponger, SPARQL Load, ODS-Briefcase, etc.)</listitem>
</itemizedlist><emphasis>Note:</emphasis> In situations where there are massive numbers of users and a single agent, a single Turtle document can hold data from points 1&amp;2 above.<bridgehead class="http://www.w3.org/1999/xhtml:h4"> Example documents</bridgehead>
<itemizedlist mark="bullet" spacing="compact"><listitem><ulink url="http://kingsley.idehen.net/DAV/home/kidehen/agent-profile-document.ttl">http://kingsley.idehen.net/DAV/home/kidehen/agent-profile-document.ttl</ulink> -- WebID-Profile Document </listitem>
<listitem><ulink url="http://kingsley.idehen.net/DAV/home/kidehen/profile.ttl">http://kingsley.idehen.net/DAV/home/kidehen/profile.ttl</ulink> -- User WebID-Profile </listitem>
<listitem>Sample WebID-Profile Document TTL snippet — <programlisting>@prefix oplacl: &lt;http://www.openlinksw.com/ontology/acl#&gt;

## User Credentials (OnBehalfOf relation participants)

&lt;{your-webid}&gt; oplacl:hasIdentityDelegate &lt;http://kingsley.idehen.net/DAV/home/kidehen/agent-profile-document.ttl#i&gt;
.

&lt;http://kingsley.idehen.net/DAV/home/kidehen/agent-profile-document.ttl#i&gt;

cert:key [
                 cert:exponent &quot;65537&quot;^^xsd:integer ;
                 cert:modulus   
&quot;b1d61bb0e90d226f60c428f59ddee81159017adbb64f82436834bec1177ee1a2ef45002a14d04473eb14784d054416333156c124c9363c38553437c570e047703cf1bb5ed37ff662b31ff52dc3ef3f0de88b36780214f59304d51587b9c7350be7f29451a9f2ecb0df8409244c1513f68ac2bc40751ffdb5bb67981bc16c619dc0b753f1f73e3fa0190a44166463258c1d505d4db913dd69f0a32ee9102ce6713a31764ed907a5eb82f19fe4d3ce560a571c4bd64519a3a0e24dba90bc6684f447af0224efccefbdc6aef73eabb6b41bc26240ac6571739c570c9aa3345c4210da0b4151148c17d451753cd0a44572007059ef209f636ed116f61e3febc76809&quot;^^xsd:hexBinary
] .
</programlisting> </listitem>
</itemizedlist><bridgehead class="http://www.w3.org/1999/xhtml:h3"> Virtuoso Authentication Layer (VAL) ACL Setup</bridgehead>
<para>VAL, the <ulink url="http://virtuoso.openlinksw.com/dataspace/doc/dav/wiki/Main/ValWhatWhyHow">Virtuoso Authentication Layer</ulink>, is an open-standards-based, multi-protocol authentication layer, that provides fine-grained, attributed-based access controls (<ulink url="http://csrc.nist.gov/projects/abac/">ABAC</ulink>) to protected resources (HTTP-accessible documents, folders, services [via their endpoints], and SPARQL named graphs).</para>
<para>Virtuoso provides access to data across two distinct (but interlinked) functionality realms: HTTP and SQL.
 Thus, configuring VAL requires creation of Authorization and Restrictions rules that target each of the aforementioned realms, individually.</para>
<para>VAL Authorizations apply to HTTP and/or SQL realms distinctly.
 Basically, you have an ACL Scope by Virtuoso Realms matrix per basic unit of ABAC functionality.</para>
<para>ABAC ACLs are created by writing a collection of RDF language statements to a special VAL system named graph.
 These statements describe an instance of an authorization, and where additional restrictions apply they are also used to describe resource usage rate restrictions.</para>
<para>The <ulink url="http://virtuoso.openlinksw.com/dataspace/doc/dav/wiki/Main/ValWhatWhyHow">VAL</ulink> documentation details how the ABAC ACLs in the various functional Realms can be created.
 Typically these are created in the following forms:</para>
<itemizedlist mark="bullet" spacing="compact"><listitem>HTTP Realm ACLs </listitem>
<listitem>HTTP Realm Restrictions </listitem>
<listitem>SQL Realm ACLS </listitem>
<listitem>SQL Realm Restrictions</listitem>
</itemizedlist><para>Examples of such ACLs are detailed in the <ulink url="#ExamplACLScript">Sample ACL Script</ulink> used for the live QA demo below.</para>
<bridgehead class="http://www.w3.org/1999/xhtml:h3"> Client Application Setup</bridgehead>
<para>To use the generated software agent certificate the CA certificate need to be registered with Operating System Keystore or use of PEM file based CA Root Cert bundle passed as part of the client application connection string.</para>
<bridgehead class="http://www.w3.org/1999/xhtml:h4"> ODBC Connection</bridgehead>
<para>An ODBC WebID+TLS+Delegation DSN can be configured as detailed below.
 In this test scenario the WebID of the user (identified by value of AppUser parameter) is the only identity to which protected resource access has been granted.</para>
<orderedlist spacing="compact"><listitem>Open the ODBC Administrator and create an ODBC DSN for the OpenLink Virtuoso Driver.
    <figure><graphic fileref="WebIDTLSDelegationWhatWhyHow/WebisTlsDelegationOdbcConfig-01.png" /></figure>  </listitem>
<listitem>Chose and name for the ODBC DSN , enter the hostname &amp; SSL SQL port the Virtuoso server is running on and select the <emphasis>This server requires secure connection (SSL)</emphasis> check box option     <figure><graphic fileref="WebIDTLSDelegationWhatWhyHow/WebisTlsDelegationOdbcConfig-02.png" /></figure>  </listitem>
<listitem>Select the <emphasis>Public key authentication protocol</emphasis> of the Authentication Method drop down list box; set the name of the <emphasis>p12</emphasis> certificate of the software agent to be used and <emphasis>password</emphasis>; set the AppUser to the name of the WebID profile document of the used the connection delegation is to be on behalf of.
    <figure><graphic fileref="WebIDTLSDelegationWhatWhyHow/WebisTlsDelegationOdbcConfig-03.png" /></figure>  </listitem>
<listitem>For SPARQL request the option in the dialog below can be left blank, or can be set if making SQL requests.
 Click the <emphasis>Finish</emphasis> button to complete the DSN creation.
    <figure><graphic fileref="WebIDTLSDelegationWhatWhyHow/WebisTlsDelegationOdbcConfig-04.png" /></figure> </listitem>
</orderedlist><bridgehead class="http://www.w3.org/1999/xhtml:h3"> Sample Client Application Usage</bridgehead>
<para>WebID+TLS+Delegation connections can be tested with various client application to verify the ACLs applied are being enforced.</para>
<bridgehead class="http://www.w3.org/1999/xhtml:h4"> Virtuoso Interactive SQL (isql)</bridgehead>
<para>In this scenario the identity of the software user and the software (application/agent/bot) are distinct, i.e., you have a WebID for the software and a WebID for the software user.
 In this test scenario the WebID of the user (identified by value of -W parameter) is the only identity to which protected resource access has been granted.
</para>
<programlisting>./isql {virtuoso-hostname}:{SSL-SQL-Port#} &quot;&quot; {app-or-agent-pkcs-file-access-pwd} -X {app-or-agent-pkcs-file} -T {ca-cert-bundle} -W {user-webid}
</programlisting><para> For example: </para>
<programlisting>$ ./isql uriburner.com:1113 &quot;&quot; 1234 -X software_agent.p12 -T ca_list_shop_2016.pem -W http://kingsley.idehen.net/public_home/kidehen/profile.ttl#i
Connected to OpenLink Virtuoso
Driver: 07.20.3217 OpenLink Virtuoso ODBC Driver
OpenLink Interactive SQL (Virtuoso), version 07.20.3217.
Type HELP; for help and EXIT; to exit.
SQL&gt; sparql SELECT COUNT (*) FROM &lt;OpenPermID-bulk-assetClass-20151111_095807.ttl.gz&gt; WHERE {?s ?p ?o};
callret-0
INTEGER
_______________________________________________________________________________

5454

1 Rows. -- 819 msec.
SQL&gt;
</programlisting><para> </para>
<bridgehead class="http://www.w3.org/1999/xhtml:h4"> ODBC CPPDemo Interactive SQL Application</bridgehead>
<para>The CPPDemo application bundle the the Virtuoso Client Connectivity Kit can be used for testing and ODBC connection using the DSN created previously:</para>
<orderedlist spacing="compact"><listitem>Start the CPPDemo application.
    <figure><graphic fileref="WebIDTLSDelegationWhatWhyHow/WebisTlsDelegationOdbcConfig-00.png" /></figure>  </listitem>
<listitem>The <emphasis>CPPDemo</emphasis> sample ODBC interactive SQL application can be used for testing the ODBC connection.
 Select the <emphasis>Open Connection</emphasis> item under the <emphasis>Environment</emphasis> menu.
    <figure><graphic fileref="WebIDTLSDelegationWhatWhyHow/WebisTlsDelegationOdbcConfig-05.png" /></figure>  </listitem>
<listitem>Choose the DSN created previously from the list presented.
    <figure><graphic fileref="WebIDTLSDelegationWhatWhyHow/WebisTlsDelegationOdbcConfig-06.png" /></figure>  </listitem>
<listitem>Enter the password of the <emphasis>p12</emphasis> certificate for the software agent in the login dialog present and click the <emphasis>OK</emphasis> button to connect.
    <figure><graphic fileref="WebIDTLSDelegationWhatWhyHow/WebisTlsDelegationOdbcConfig-07.png" /></figure>  </listitem>
<listitem>Select the <emphasis>Execute SQL</emphasis> item of the SQL menu to load text windows to enter query to run.
    <figure><graphic fileref="WebIDTLSDelegationWhatWhyHow/WebisTlsDelegationOdbcConfig-08.png" /></figure>  </listitem>
<listitem>Enter the query to be executed and click on the <emphasis>OK</emphasis> button; example: <programlisting>sparql SELECT COUNT (*) FROM &lt;OpenPermID-bulk-assetClass-20151111_095807.ttl.gz&gt; WHERE {?s ?p ?o}
</programlisting>    <figure><graphic fileref="WebIDTLSDelegationWhatWhyHow/WebisTlsDelegationOdbcConfig-09.png" /></figure>  </listitem>
<listitem>The query result set will be returned.
    <figure><graphic fileref="WebIDTLSDelegationWhatWhyHow/WebisTlsDelegationOdbcConfig-10.png" /></figure> </listitem>
</orderedlist><para> </para>
<bridgehead class="http://www.w3.org/1999/xhtml:h4"> HTTP connection using cURL</bridgehead>
<para>In this usage scenario we make use of the &quot;<ulink url="OnBehalfOf">OnBehalfOf</ulink>:&quot; custom HTTP request header.
 The value of this header takes the form of a WebID that identifies the user of an application/agent/bot accessing a protected resource via the HTTP protocol.
</para>
<programlisting>curl -iLk --cert-type P12 --cert {app-or-agent-pkcs-file}:{pkcs-file-access-pwd} --cacert {ca-cert-bundle} -H &quot;OnBehalfOf: {user-webid}&quot; &quot;{uri-for-accessing-protected-resource}&quot;
</programlisting><para> For example: </para>
<programlisting>curl -iLk --cert-type P12 --cert VirtuosoLODConnectivity.p12:1234 --cacert ca_list_shop_2016.pem -H &quot;On-Behalf-Of: http://kingsley.idehen.net/public_home/kidehen/profile.ttl#i&quot; &quot;https://linkeddata.uriburner.com/sparql/?default-graph-uri=&amp;query=select+distinct+*+from+%3COpenPermID-bulk-industry-20151111_095806.ttl.gz%3E++where+%7B%5B%5D+a+%3FEntityType%7D+limit+50&amp;should-sponge=&amp;format=text%2Fcsv%2Btr&amp;CXML_redir_for_subjs=121&amp;CXML_redir_for_hrefs=&amp;timeout=30000000&quot;
</programlisting><para> Note, to protect the certificate password from possible <ulink url="https://attack.mitre.org/techniques/T1139/">Bash History Exploit Vulnerability</ulink>, the P12 certificate can be converted to a password protected PEM file with the command: </para>
<programlisting>openssl app-or-agent-pkcs-file -out app-or-agent-pem-file
</programlisting><para> and the PEM file (app-or-agent-pem-file) specified instead instead of the P12 file with the {pkcs-file-access-pwd} removed, in which case curl will prompt for the password, which would then not be part of the users bash history.</para>
<bridgehead class="http://www.w3.org/1999/xhtml:h2"> Sample Use case against Virtuoso Live URIBurner service</bridgehead>
<para>The <ulink url="OpenLink">OpenLink</ulink> <ulink url="http://linkeddata.uriburner.com">URIBurner</ulink> services has been set up with WebID+TLS+Delegation support enabled, with a number of ACLs in place to control access to resources by software agents and there associated delegated users.</para>
<para>Assuming the following scenario:</para>
<para>A publisher of a document seeks to constrain its access to a specific user or group of users.
 As part of this effort, the following are desired with regards to user experience:</para>
<itemizedlist mark="bullet" spacing="compact"><listitem>An X.509 Certificate is only created for the software agent (e.g., cURL, Web Browser, ODBC compliant app, etc.) used to access the protected document </listitem>
<listitem>Document access controls are scoped to the application user, as opposed to software being used.</listitem>
</itemizedlist><bridgehead class="http://www.w3.org/1999/xhtml:h3"> Sample Resources</bridgehead>
<itemizedlist mark="bullet" spacing="compact"><listitem>&lt;OpenPermID-bulk-assetClass-20151111_095807.ttl.gz&gt; — Protected      Named Graph accessible to any NetID (which includes WebIDs) via HTTP Realm scoped ACLs </listitem>
<listitem>&lt;OpenPermID-bulk-industry-20151111_095806.ttl.gz&gt; — Protected Named      Graph accessible to a specific WebID list via SQL or HTTP Realm scoped ACLs</listitem>
</itemizedlist><bridgehead class="http://www.w3.org/1999/xhtml:h3"> Certificates and their Subjects</bridgehead>
<itemizedlist mark="bullet" spacing="compact"><listitem>LODConnectivity Cert — required for WebID+TLS testing using our      setup on <ulink url="http://linkeddata.uriburner.com/">URIBurner</ulink> <itemizedlist mark="bullet" spacing="compact"><listitem>Sample LODConnectivity Cert — <ulink url="https://download3.openlinksw.com/certificates/software_agent.p12">https://download3.openlinksw.com/certificates/software_agent.p12</ulink> </listitem>
</itemizedlist></listitem>
<listitem>CA Certificate Bundle for verifying Certs issued by <ulink url="http://youid.openlinksw.com/">YouID</ulink> and <ulink url="http://linkeddata.uriburner.com/">URIBurner</ulink>      (requested via Shop Agent re.
 LOD Connectivity Certs) <itemizedlist mark="bullet" spacing="compact"><listitem>Sample CA Certificate Bundle — <ulink url="https://download3.openlinksw.com/certificates/ca_list_shop_2016.pem">https://download3.openlinksw.com/certificates/ca_list_shop_2016.pem</ulink> </listitem>
</itemizedlist></listitem>
<listitem>WebID for which access has been granted to the resource identified      by &lt;OpenPermID-bulk-industry-20151111_095806.ttl.gz&gt;</listitem>
</itemizedlist><bridgehead class="http://www.w3.org/1999/xhtml:h3"> ACL Definitions Example Script</bridgehead>
<para><ulink url="#ExamplACLScript">See sample, below</ulink>.</para>
<bridgehead class="http://www.w3.org/1999/xhtml:h3"> Web ID+TLS ISQL/ODBC using TLS Connection Tests</bridgehead>
<bridgehead class="http://www.w3.org/1999/xhtml:h4"> Template ACL for Web ID+TLS ISQL/ODBC using TLS</bridgehead>
<programlisting>./isql linkeddata.uriburner.com:1113 &quot;&quot; {app-or-agent-pkcs-file-access-pwd} -X {app-or-agent-pkcs-file} -T {ca-cert-bundle}
</programlisting><para> </para>
<bridgehead class="http://www.w3.org/1999/xhtml:h4"> Sample ACLs for Web ID+TLS ISQL/ODBC using TLS</bridgehead>
<orderedlist spacing="compact"><listitem> <programlisting>isql linkeddata.uriburner.com:1113 &quot;&quot; 1234 -X VirtuosoLODConnectivity.p12 -T ca_list_shop_2016.pem
</programlisting></listitem>
<listitem> <programlisting>isql linkeddata.uriburner.com:1113 &quot;&quot; 1234 -X kidehen_dot_net.p12 -T ca_list_shop_2016.pem
</programlisting> </listitem>
</orderedlist><bridgehead class="http://www.w3.org/1999/xhtml:h4"> ACL Test Queries for Web ID+TLS ISQL/ODBC using TLS</bridgehead>
<orderedlist spacing="compact"><listitem> <programlisting>SPARQL 
SELECT COUNT (*) 
FROM &lt;OpenPermID-bulk-assetClass-20151111_095807.ttl.gz&gt; 
WHERE {?s ?p ?o};
</programlisting></listitem>
<listitem> <programlisting>SPARQL 
SELECT COUNT (*) 
FROM &lt;OpenPermID-bulk-industry-20151111_095806.ttl.gz&gt; 
WHERE {?s ?p ?o};
</programlisting> </listitem>
</orderedlist><bridgehead class="http://www.w3.org/1999/xhtml:h4"> Results</bridgehead>
<para>You will have count of &quot;0&quot; as the solution for queries performed by identities that fail protected resource ACL test.</para>
<bridgehead class="http://www.w3.org/1999/xhtml:h3"> Web ID+TLS via HTTP (using cURL) Connection Tests</bridgehead>
<bridgehead class="http://www.w3.org/1999/xhtml:h4"> ACL Template for Web ID+TLS via HTTP (using cURL)</bridgehead>
<programlisting>curl -iLk --cert-type P12 --cert {app-or-agent-pkcs-file}:{app-or-agent-pkcs-file-access-pwd} &quot;https://linkeddata.uriburner.com/sparql/?default-graph-uri=&amp;query=select+distinct+*+from+%3COpenPermID-bulk-assetClass-20151111_095807.ttl.gz%3E++where+%7B%5B%5D+a+%3FEntityType%7D+limit+50&amp;should-sponge=&amp;format=text%2Fcsv%2Btr&amp;CXML_redir_for_subjs=121&amp;CXML_redir_for_hrefs=&amp;timeout=30000000&quot;
</programlisting><para> </para>
<bridgehead class="http://www.w3.org/1999/xhtml:h4"> Sample ACLs for Web ID+TLS via HTTP (using cURL)</bridgehead>
<orderedlist spacing="compact"><listitem> <programlisting>curl -iLk --cert-type P12 --cert VirtuosoLODConnectivity.p12:1234 &quot;https://linkeddata.uriburner.com/sparql/?default-graph-uri=&amp;query=select+distinct+*+from+%3COpenPermID-bulk-assetClass-20151111_095807.ttl.gz%3E++where+%7B%5B%5D+a+%3FEntityType%7D+limit+50&amp;should-sponge=&amp;format=text%2Fcsv%2Btr&amp;CXML_redir_for_subjs=121&amp;CXML_redir_for_hrefs=&amp;timeout=30000000&quot;
</programlisting></listitem>
<listitem> <programlisting>curl -iLk --cert-type P12 --cert VirtuosoLODConnectivity.p12:1234 &quot;https://linkeddata.uriburner.com/sparql/?default-graph-uri=&amp;query=select+distinct+*+from+%3COpenPermID-bulk-industry-20151111_095806.ttl.gz%3E++where+%7B%5B%5D+a+%3FEntityType%7D+limit+50&amp;should-sponge=&amp;format=text%2Fcsv%2Btr&amp;CXML_redir_for_subjs=121&amp;CXML_redir_for_hrefs=&amp;timeout=30000000&quot;
</programlisting> </listitem>
</orderedlist><bridgehead class="http://www.w3.org/1999/xhtml:h4"> Results</bridgehead>
<para>You will have empty solutions for queries performed by identities that fail protected resource ACL tests.</para>
<bridgehead class="http://www.w3.org/1999/xhtml:h3"> Web ID+TLS+Delegation ISQL/ODBC/JDBC using TLS Connection Tests</bridgehead>
<para>In this scenario the identity of the software user and the software (application/agent/bot) are distinct, i.e., you have a WebID for the software and a WebID for the software user.
 In this test scenario, the WebID of the user (identified by value of the -W parameter) is the only identity to which protected resource access has been granted.</para>
<bridgehead class="http://www.w3.org/1999/xhtml:h4"> ACL Template for Web ID+TLS+Delegation ISQL/ODBC/JDBC using TLS</bridgehead>
<programlisting>./isql linkeddata.uriburner.com:1113 &quot;&quot; {app-or-agent-pkcs-file-access-pwd} -X {app-or-agent-pkcs-file} -T {ca-cert-bundle} -W {user-webid}
</programlisting><para> </para>
<programlisting>iodbctest &quot;Driver={OpenLink Virtuoso ODBC Driver};HOST=linkeddata.uriburner.com:1113;UID=;PWD={app-or-agent-pkcs-file-access-pwd};ENCRYPT={app-or-agent-pkcs-file};SERVERCERT={ca-cert-bundle};Delegate={user-webid}&quot;
</programlisting><para> </para>
<programlisting>ConnectString url = &quot;jdbc:virtuoso://linkeddata.uriburner.com:1113/charset=UTF-8/SSL/kpass={app-or-agent-pkcs-file-access-pwd}/kpath={app-or-agent-pkcs-file}/ts={ca-cert-bundle}/delegate=&#39;{user-webid}&#39;&quot;
</programlisting><para> </para>
<bridgehead class="http://www.w3.org/1999/xhtml:h4"> Sample ACLs for Web ID+TLS+Delegation ISQL/ODBC/JDBC using TLS</bridgehead>
<para>    1 . </para>
<programlisting>isql linkeddata.uriburner.com:1113 &quot;&quot; 1234 -X VirtuosoLODConnectivity.p12 -T ca_list_shop_2016.pem -W http://kingsley.idehen.net/public_home/kidehen/profile.ttl#i
</programlisting><para>    2.
</para>
<programlisting>iodbctest &quot;Driver={OpenLink Virtuoso ODBC Driver};HOST=linkeddata.uriburner.com:1113;UID=;PWD=1234;ENCRYPT=VirtuosoLODConnectivity.p12;SERVERCERT=ca_list_shop_2016.pem;Delegate=http://kingsley.idehen.net/public_home/kidehen/profile.ttl#i&quot;
</programlisting><para>    3.
</para>
<programlisting>ConnectString url = &quot;jdbc:virtuoso://linkeddata.uriburner.com:1113/charset=UTF-8/SSL/kpass=1234/kpath=VirtuosoLODConnectivity.p12/ts=ca_list_shop_2016.pem/delegate=&#39;http://kingsley.idehen.net/public_home/kidehen/profile.ttl#i&#39;&quot;
</programlisting><para> </para>
<bridgehead class="http://www.w3.org/1999/xhtml:h4"> ACL Test Queries</bridgehead>
<orderedlist spacing="compact"><listitem> <programlisting>SPARQL 
SELECT COUNT (*) 
FROM &lt;OpenPermID-bulk-assetClass-20151111_095807.ttl.gz&gt; 
WHRE {?s ?p ?o};
</programlisting></listitem>
<listitem> <programlisting>SPARQL 
SELECT COUNT (*) 
FROM &lt;OpenPermID-bulk-industry-20151111_095806.ttl.gz&gt; 
WHERE {?s ?p ?o};
</programlisting> </listitem>
</orderedlist><bridgehead class="http://www.w3.org/1999/xhtml:h4"> Results</bridgehead>
<para>You will have count of &quot;0&quot; as the solution for queries performed by identities that fail protected resource ACL test.</para>
<para> </para>
<bridgehead class="http://www.w3.org/1999/xhtml:h3"> Web ID+TLS+Delegate via HTTPS (using cURL) Connection Tests</bridgehead>
<para>In this usage scenario we make use of the &quot;OnBehalfOf:&quot; custom HTTP request header.
 The value of this header takes the form of a WebID that identifies the user of an application/agent/bot accessing a protected resource via the HTTP protocol.</para>
<bridgehead class="http://www.w3.org/1999/xhtml:h4"> ACL Template for Web ID+TLS+Delegate via HTTPS (using cURL)</bridgehead>
<programlisting>curl -iLk --cert-type P12 --cert {app-or-agent-pkcs-file}:{pkcs-file-access-pwd} --cacert {ca-cert-bundle} -H &quot;OnBehalfOf: {user-webid}&quot; &quot;{uri-for-accessing-protected-resource}&quot;
</programlisting><para> </para>
<bridgehead class="http://www.w3.org/1999/xhtml:h4"> Sample ACLs for Web ID+TLS+Delegate via HTTPS (using cURL)</bridgehead>
<orderedlist spacing="compact"><listitem> <programlisting>curl -iLk --cert-type P12 --cert VirtuosoLODConnectivity.p12:1234 --cacert ca_list_shop_2016.pem -H &quot;On-Behalf-Of: http://kingsley.idehen.net/public_home/kidehen/profile.ttl#i&quot; &quot;https://linkeddata.uriburner.com/sparql/?default-graph-uri=&amp;query=select+distinct+*+from+%3COpenPermID-bulk-industry-20151111_095806.ttl.gz%3E++where+%7B%5B%5D+a+%3FEntityType%7D+limit+50&amp;should-sponge=&amp;format=text%2Fcsv%2Btr&amp;CXML_redir_for_subjs=121&amp;CXML_redir_for_hrefs=&amp;timeout=30000000&quot;
</programlisting></listitem>
<listitem> <programlisting>curl -iLk --cert-type P12 --cert VirtuosoLODConnectivity.p12:1234 --cacert ca_list_shop_2016.pem -H &quot;On-Behalf-Of: http://kingsley.idehen.net/public_home/kidehen/profile.ttl#i&quot; &quot;https://linkeddata.uriburner.com/sparql/?default-graph-uri=&amp;query=select+distinct+*+from+%3COpenPermID-bulk-assetClass-20151111_095807.ttl.gz%3E++where+%7B%5B%5D+a+%3FEntityType%7D+limit+50&amp;should-sponge=&amp;format=text%2Fcsv%2Btr&amp;CXML_redir_for_subjs=121&amp;CXML_redir_for_hrefs=&amp;timeout=30000000&quot;
</programlisting></listitem>
</orderedlist><bridgehead class="http://www.w3.org/1999/xhtml:h4"> Results</bridgehead>
<para>You will have empty solutions for queries performed by identities that fail protected resource ACL tests.</para>
<bridgehead class="http://www.w3.org/1999/xhtml:h3"> Web ID+TLS+Delegate to SPARQL Endpoint and Faceted Browser UI&#39;s using OSDS Connection Tests</bridgehead>
<para>The <ulink url="http://osds.openlinksw.com">OpenLink Structured Data Sniffer</ulink> (OSDS) version 2.10.8+ can be used as a vehicle for injecting On-Behalf-Of: request header with the value from the configured and selected WebID into HTTP requests.
 The is passed by setting the <emphasis>Preferred User ID</emphasis> value in the <emphasis>Options</emphasis> configuration dialog of OSDS as indicated in the following dialog:</para>
<figure><graphic fileref="WebIDTLSDelegationWhatWhyHow/WebisTlsDelegationOdbcConfig-11.png" /></figure><para>In this example the <emphasis>Preferred User ID</emphasis> is set to <ulink url="http://kingsley.idehen.net/public_home/kidehen/profile.ttl#i">http://kingsley.idehen.net/public_home/kidehen/profile.ttl#i</ulink>.</para>
<para>Import the Software Agent certificate (p12 file) into the Chrome or <ulink url="FireFox">FireFox</ulink> Browser, supported by OSDS, that is to be used.</para>
<bridgehead class="http://www.w3.org/1999/xhtml:h4"> Web ID+TLS+Delegate to SPARQL Endpoint UI</bridgehead>
<orderedlist spacing="compact"><listitem>Go to the <ulink url="http://linkeddata.uriburner.com/sparql">http://linkeddata.uriburner.com/sparql</ulink> SPARQL Endpoint and click on the <emphasis>Login</emphasis> link.
<figure><graphic fileref="WebIDTLSDelegationWhatWhyHow/WebisTlsDelegationOdbcConfig-12.png" /></figure> </listitem>
<listitem>From the presented VAL Login Dialog select the <emphasis>WebID-TLS</emphasis> icon to make a WebID login.
<figure><graphic fileref="WebIDTLSDelegationWhatWhyHow/WebisTlsDelegationOdbcConfig-13.png" /></figure> </listitem>
<listitem>From the presented certificates select the software agent certificate for the connection <figure><graphic fileref="WebIDTLSDelegationWhatWhyHow/WebisTlsDelegationOdbcConfig-14.png" /></figure> </listitem>
<listitem>When logged in the <ulink url="http://kingsley.idehen.net/public_home/kidehen/profile.ttl#i">http://kingsley.idehen.net/public_home/kidehen/profile.ttl#i</ulink> delegated user is presented as the logged in user.
 At this point, a query can be executed, depending on the ACLs in place.
<figure><graphic fileref="WebIDTLSDelegationWhatWhyHow/WebisTlsDelegationOdbcConfig-15.png" /></figure> <itemizedlist mark="bullet" spacing="compact"><listitem><ulink url="http://tinyurl.com/hpphdq8">SPARQL Query Results page</ulink> where the query targets entity relationships in a protected database (a/k/a Named Graph or Document) that&#39;s only accessible to specific Users authenticated via any of the presented protocols, i.e., <ulink url="NetIDs">NetIDs</ulink> Condition Group ACL for &lt;<ulink url="OpenPermID">OpenPermID</ulink>-bulk-assetClass-20151111_095807.ttl.gz&gt;.
 Returns the following based on the ACLs in place: <figure><graphic fileref="WebIDTLSDelegationWhatWhyHow/WebisTlsDelegationOdbcConfig-16.png" /></figure> </listitem>
<listitem><ulink url="http://tinyurl.com/zbcqvfz">SPARQL Query Results page</ulink> where the query targets entity relationships in a protected database (a/k/a Named Graph or Document) that&#39;s only accessible to specific Users identified by a WebID (HTTP URI or Hyperlink that identifies a Person, Organization, or Software Agent), i.e., specific WebID ACL for &lt;<ulink url="OpenPermID">OpenPermID</ulink>-bulk-assetClass-20151111_095806.ttl.gz&gt;.
 Returns no results as the ACLs do not allow it.</listitem>
</itemizedlist></listitem>
</orderedlist><bridgehead class="http://www.w3.org/1999/xhtml:h4"> Web ID+TLS+Delegate to Faceted Browser UI</bridgehead>
<orderedlist spacing="compact"><listitem>Go to the Faceted Browser, <ulink url="http://linkeddata.uriburner.com/fct">http://linkeddata.uriburner.com/fct</ulink>,  and click on the Login link.
<figure><graphic fileref="WebIDTLSDelegationWhatWhyHow/WebisTlsDelegationOdbcConfig-17.png" /></figure> </listitem>
<listitem>From the presented VAL Login Dialog, select the <emphasis>WebID-TLS</emphasis> icon to make a WebID login.
<figure><graphic fileref="WebIDTLSDelegationWhatWhyHow/WebisTlsDelegationOdbcConfig-13.png" /></figure> </listitem>
<listitem>From the presented certificates select the software agent certificate for the connection <figure><graphic fileref="WebIDTLSDelegationWhatWhyHow/WebisTlsDelegationOdbcConfig-14.png" /></figure> </listitem>
<listitem>When logged in, the delegated user, http://kingsley.idehen.net/public_home/kidehen/profile.ttl#i, is presented as the logged in user.
 At which point a query can be executed and depending on the ACLs in place.
<figure><graphic fileref="WebIDTLSDelegationWhatWhyHow/WebisTlsDelegationOdbcConfig-18.png" /></figure> <orderedlist spacing="compact"><listitem><ulink url="http://tinyurl.com/hss58dw">SPARQL Query Results page</ulink> where the query targets entity relationships in a protected database (a/k/a Named Graph or Document) that&#39;s only accessible to specific Users authenticated via any of the presented protocols, i.e., <ulink url="NetIDs">NetIDs</ulink> Condition Group ACL for &lt;<ulink url="OpenPermID">OpenPermID</ulink>-bulk-assetClass-20151111_095807.ttl.gz&gt;.
 Returns the following based on the ACLs in place: <figure><graphic fileref="WebIDTLSDelegationWhatWhyHow/WebisTlsDelegationOdbcConfig-19.png" /></figure> </listitem>
<listitem><ulink url="http://tinyurl.com/hj9rjeq">SPARQL Query Results page</ulink> where the query targets entity relationships in a protected database (a/k/a Named Graph or Document) that&#39;s only accessible to specific Users identified by a WebID (HTTP URI or Hyperlink that identifies a Person, Organization, or Software Agent), i.e., specific WebID ACL for &lt;<ulink url="OpenPermID">OpenPermID</ulink>-bulk-assetClass-20151111_095806.ttl.gz&gt;.
 Returns no results, as the ACLs do not allow it.</listitem>
</orderedlist></listitem>
</orderedlist><bridgehead class="http://www.w3.org/1999/xhtml:h2"> Related</bridgehead>
 <itemizedlist mark="bullet" spacing="compact"><listitem><ulink url="VirtWTDStepByStepConfigGuide">Virtuoso WebID+TLS+Delegation Step by Step Configuration Guide</ulink> </listitem>
<listitem><ulink url="ValWhatWhyHow">Virtuoso Authentication Layer (VAL) - What, Why and How</ulink> </listitem>
<listitem><ulink url="ValQuickStartGuide">Virtuoso Authentication Layer - ACL System QuickStart Guide</ulink> </listitem>
<listitem><ulink url="http://docs.openlinksw.com/virtuoso/odbcimplementation.html#secureodbcx509">Using X509 Certificates With ODBC Connection</ulink></listitem>
</itemizedlist></section></docbook>