<docbook><section><title>VirtOAuthSPARQL</title><title> Securing your SPARQL Endpoint via OAuth</title> Securing your SPARQL Endpoint via OAuth
<para>SPARQL endpoints are easy for random visitors to accidentally overload.
 Virtuoso allows you to secure your SPARQL endpoint against such abuses in various ways, including OAuth.</para>
<bridgehead class="http://www.w3.org/1999/xhtml:h2">Sample scenario</bridgehead>
<para>The following sample scenario demonstrates the OAuth keys and Protected SPARQL Endpoint features of the Virtuoso Auth UI:</para>
<orderedlist spacing="compact"><listitem>Download and install the Virtuoso Open Source Edition v7.2 <ulink url="https://download3.openlinksw.com/uda/vad-vos-packages/7.2/ods_framework_dav.vad"> ODS Framework VAD</ulink> (VADs for other Open Source versions must be built <ulink url="https://github.com/openlink/virtuoso-opensource/">from source</ulink>) </listitem>
<listitem>Go to <emphasis>http://&lt;cname&gt;:&lt;port&gt;/conductor</emphasis>, where &lt;cname&gt;:&lt;port&gt; are replaced by your local server values.
</listitem>
<listitem>Log in as user &quot;<emphasis>dba</emphasis>&quot; or another user with DBA privileges </listitem>
<listitem>Go to System Admin-&gt; User Accounts: <figure><graphic fileref="VirtOAuthSPARQL/so1.png" /></figure> </listitem>
<listitem>Click &quot;Create New Account&quot;: <figure><graphic fileref="VirtOAuthSPARQL/so2.png" /></figure> </listitem>
<listitem>In the presented form enter respectively: <itemizedlist mark="bullet" spacing="compact"><listitem>Account name, for ex:<emphasis>demo1</emphasis>; enter password and then confirm it; </listitem>
<listitem>User type: SQL/ODBC and <ulink url="WebDAV">WebDAV</ulink> </listitem>
<listitem>Account role: SPARQL_UPDATE <figure><graphic fileref="VirtOAuthSPARQL/so3.png" /></figure> </listitem>
</itemizedlist></listitem>
<listitem>Click &quot;Save&quot;.
</listitem>
<listitem>The created user should be shown in the list of registered users: <figure><graphic fileref="VirtOAuthSPARQL/so4.png" /></figure> </listitem>
<listitem>Go to <emphasis>http://&lt;cname&gt;:&lt;port&gt;/oauth/</emphasis>, where &lt;cname&gt;:&lt;port&gt; are replaced by your local server values.
<figure><graphic fileref="VirtOAuthSPARQL/so5.png" /></figure> </listitem>
<listitem>Click the &quot;<emphasis>OAuth Keys</emphasis>&quot; link: <figure><graphic fileref="VirtOAuthSPARQL/so6.png" /></figure> </listitem>
<listitem>Log in as user <emphasis>demo1</emphasis>: <figure><graphic fileref="VirtOAuthSPARQL/so7.png" /></figure> </listitem>
<listitem>The OAuth application registration form will be shown.
<figure><graphic fileref="VirtOAuthSPARQL/so8.png" /></figure> </listitem>
<listitem>Select <emphasis>SPARQL</emphasis> from the &quot;<emphasis>Application name</emphasis>&quot; list, and click the &quot;<emphasis>Generate Keys</emphasis>&quot; button.
</listitem>
<listitem>A Consumer Key for SPARQL will be generated: <programlisting>90baa79108b1d972525bacc76c0279c02d6421e8
</programlisting><figure><graphic fileref="VirtOAuthSPARQL/so9.png" /></figure> </listitem>
<listitem>Click the &quot;<emphasis>Back to main menu</emphasis>&quot; link.
<figure><graphic fileref="VirtOAuthSPARQL/so10.png" /></figure> </listitem>
<listitem>Click the &quot;<emphasis>Protected SPARQL Endpoint</emphasis>&quot; link.
</listitem>
<listitem>The <ulink url="OpenLink">OpenLink</ulink> Virtuoso SPARQL Query form will be shown: <figure><graphic fileref="VirtOAuthSPARQL/so11.png" /></figure> <figure><graphic fileref="VirtOAuthSPARQL/so12.png" /></figure> </listitem>
<listitem>Enter a simple query, for ex: <programlisting>SELECT * 
WHERE 
  {
    ?s ?p ?o
  }
LIMIT 10
</programlisting></listitem>
<listitem>For &quot;<emphasis>OAuth token</emphasis>&quot;, enter the Consumer Key value which was generated above, i.e., <programlisting>90baa79108b1d972525bacc76c0279c02d6421e8
</programlisting><figure><graphic fileref="VirtOAuthSPARQL/so13.png" /></figure> </listitem>
<listitem>Click the &quot;<emphasis>Run Query</emphasis>&quot; button.
</listitem>
<listitem>In the OAuth Authorization Service form, enter the password for user <emphasis>demo1</emphasis> and click the &quot;<emphasis>Login</emphasis>&quot; button.
<figure><graphic fileref="VirtOAuthSPARQL/so16.png" /></figure> </listitem>
<listitem>Next you should authorize the request: <figure><graphic fileref="VirtOAuthSPARQL/so15.png" /></figure> </listitem>
<listitem>On successful authentication and authorization, the query results should be shown: <figure><graphic fileref="VirtOAuthSPARQL/so14.png" /></figure></listitem>
</orderedlist><bridgehead class="http://www.w3.org/1999/xhtml:h2">Related</bridgehead>
<itemizedlist mark="bullet" spacing="compact"><listitem><ulink url="VirtSPARQLEndpointProtection">Safeguarding your Virtuoso-hosted SPARQL Endpoint</ulink> </listitem>
<listitem><ulink url="VirtTipsAndTricksGuideSPARQLEndpointProtection">SPARQL Endpoint Protection Methods Collection</ulink> </listitem>
<listitem><ulink url="http://docs.openlinksw.com/virtuoso/">Virtuoso documentation</ulink> <itemizedlist mark="bullet" spacing="compact"><listitem><ulink url="http://docs.openlinksw.com/virtuoso/rdfsparql.html#rdfsupportedprotocolendpoint">SPARQL Service Endpoint</ulink> </listitem>
<listitem><ulink url="http://docs.openlinksw.com/virtuoso/rdfsparql.html#rdfsupportedprotocolendpointuri">Service Endpoint Security</ulink> </listitem>
<listitem><ulink url="http://docs.openlinksw.com/virtuoso/rdfsparql.html#sparqwebservicetbl">Managing a SPARQL Web Service Endpoint</ulink> </listitem>
<listitem><ulink url="http://docs.openlinksw.com/virtuoso/rdfsparql.html">SPARQL</ulink> </listitem>
</itemizedlist></listitem>
<listitem><ulink url="VirtTipsAndTricksGuide">Virtuoso Tips and Tricks Collection</ulink> <itemizedlist mark="bullet" spacing="compact"><listitem><ulink url="VirtSPARQLDET">SPARQL Endpoint DET Configuration Guide</ulink> </listitem>
<listitem><ulink url="VirtSPARQLSecurityWebID">WebID Protocol &amp; SPARQL Endpoint ACLs Tutorial</ulink> </listitem>
<listitem><ulink url="VirtTipsAndTricksGuideSPARQLEndpoints">Securing SPARQL endpoints</ulink> </listitem>
</itemizedlist></listitem>
<listitem><ulink url="http://ods.openlinksw.com/wiki/ODS/OdsSPARQLAuth">SPARUL over SPARQL using the http://cname:port/sparql-auth endpoint</ulink> </listitem>
<listitem><ulink url="VirtAuthServerUI">Virtuoso Authentication Server UI</ulink> </listitem>
<listitem><ulink url="VirtSPARQLSSL">Manage a SPARQL-WebID based Endpoint</ulink> </listitem>
<listitem><ulink url="VirtSetupSSL">Configure Virtuoso instance as an X.509 Certificate Authority and HTTPS listener</ulink> </listitem>
<listitem><ulink url="http://ods.openlinksw.com/wiki/ODS/ODSSetupSSL">Configure Virtuoso+ODS instance as an X.509 Certificate Authority and HTTPS listener</ulink> </listitem>
<listitem><ulink url="http://ods.openlinksw.com/wiki/ODS/VirtODSSecurityWebID">WebID Protocol Support in OpenLink Data Spaces</ulink>.
</listitem>
<listitem>Manage ODS Dataspace Object WebID Access Control Lists (ACLs): <itemizedlist mark="bullet" spacing="compact"><listitem><ulink url="http://ods.openlinksw.com/wiki/ODS/ODSBriefcaseWebID">ODS Briefcase WebID based ACL Guide</ulink> <itemizedlist mark="bullet" spacing="compact"><listitem><ulink url="http://ods.openlinksw.com/wiki/ODS/ODSBriefcaseWebIDPerson">Person Entity WebID based ACL Guide</ulink> </listitem>
<listitem><ulink url="http://ods.openlinksw.com/wiki/ODS/ODSBriefcaseWebIDGroup">Group Entity WebID based ACL Guide</ulink> </listitem>
<listitem><ulink url="http://ods.openlinksw.com/wiki/ODS/ODSBriefcaseWebIDPublic">Public WebID based ACL Guide</ulink> </listitem>
</itemizedlist></listitem>
<listitem><ulink url="http://ods.openlinksw.com/wiki/ODS/ODSFeedManagerWebIDACL">ODS Feed Manager WebID based ACL Guide</ulink> <itemizedlist mark="bullet" spacing="compact"><listitem><ulink url="http://ods.openlinksw.com/wiki/ODS/ODSFeedManagerWebIDACLPerson">Person Entity Specific ACL</ulink> </listitem>
<listitem><ulink url="http://ods.openlinksw.com/wiki/ODS/ODSFeedManagerWebIDACLGroup">Group Entity Specific ACL</ulink> </listitem>
<listitem><ulink url="http://ods.openlinksw.com/wiki/ODS/ODSFeedManagerWebIDACLPublic">Public Specific ACL for anyone with a WebID</ulink> </listitem>
</itemizedlist></listitem>
<listitem><ulink url="http://ods.openlinksw.com/wiki/ODS/ODSCalendarWebIDACL">ODS Calendar WebID based ACL Guide</ulink> <itemizedlist mark="bullet" spacing="compact"><listitem><ulink url="http://ods.openlinksw.com/wiki/ODS/ODSCalendarWebIDACLPerson">Person Entity Specific ACL</ulink> </listitem>
<listitem><ulink url="http://ods.openlinksw.com/wiki/ODS/ODSCalendarWebIDACLGroup">Group Entity Specific ACL</ulink> </listitem>
<listitem><ulink url="http://ods.openlinksw.com/wiki/ODS/ODSCalendarWebIDACLPublic">Public Specific ACL for anyone with a WebID</ulink> </listitem>
</itemizedlist></listitem>
<listitem><ulink url="http://ods.openlinksw.com/wiki/ODS/ODSBookmarksWebIDACL">ODS Bookmark Manager WebID based ACL Guide</ulink> <itemizedlist mark="bullet" spacing="compact"><listitem><ulink url="http://ods.openlinksw.com/wiki/ODS/ODSBookmarksWebIDACLPerson">Person Entity Specific ACL</ulink> </listitem>
<listitem><ulink url="http://ods.openlinksw.com/wiki/ODS/ODSBookmarksWebIDACLGroup">Group Entity Specific ACL</ulink> </listitem>
<listitem><ulink url="http://ods.openlinksw.com/wiki/ODS/ODSBookmarksWebIDACLPublic">Public Specific ACL for anyone with a WebID</ulink> </listitem>
</itemizedlist></listitem>
<listitem><ulink url="http://ods.openlinksw.com/wiki/ODS/ODSAddressBookWebIDACL">ODS Addressbook  WebID based ACL Guide</ulink> <itemizedlist mark="bullet" spacing="compact"><listitem><ulink url="http://ods.openlinksw.com/wiki/ODS/ODSAddressBookWebIDACLPerson">Person Entity Specific ACL</ulink> </listitem>
<listitem><ulink url="http://ods.openlinksw.com/wiki/ODS/ODSAddressBookWebIDACLGroup">Group Entity Specific ACL</ulink> </listitem>
<listitem><ulink url="http://ods.openlinksw.com/wiki/ODS/ODSAddressBookWebIDACLPublic">Public Specific ACL for anyone with a WebID</ulink> </listitem>
</itemizedlist></listitem>
</itemizedlist></listitem>
<listitem><ulink url="http://ods.openlinksw.com/wiki/ODS/ODSPkiSetup">Guide for Set up a X.509 certificate issuer and HTTPS listener and generate ODS user certificates.</ulink> </listitem>
<listitem><ulink url="http://ods.openlinksw.com/wiki/ODS/VirtODSPubSubHub">Setting up PubSubHub in ODS</ulink> </listitem>
<listitem><ulink url="http://ods.openlinksw.com/wiki/ODS/VirtPubSubHub">PubSubHubBub Demo Client Example</ulink> </listitem>
<listitem><ulink url="http://ods.openlinksw.com/wiki/ODS/VirtFeedPubSubHub">Feed subscription via PubSubHub protocol Example</ulink> </listitem>
<listitem><ulink url="http://ods.openlinksw.com/wiki/ODS/VirtPubSubHubACL">Setting Up PubSubHub to use WebID Protocol or IP based control lists</ulink> </listitem>
<listitem><ulink url="http://ods.openlinksw.com/wiki/ODS/OdsKeyImport">CA Keys Import using Conductor</ulink> </listitem>
<listitem><ulink url="http://ods.openlinksw.com/wiki/ODS/ODSGenerateX509Certificate">Generate an X.509 Certificate hosted WebID Guide</ulink> </listitem>
<listitem><ulink url="http://ods.openlinksw.com/wiki/ODS/ODSGenerateWebIDX509CertOSKeystore">Generate an X.509 Certificate (with a WebID watermark) to be managed by host operating system keystore</ulink> </listitem>
<listitem><ulink url="http://ods.openlinksw.com/wiki/ODS/ODSGenerateWebIDX509CertBrsKeystore">Generate an X.509 Certificate (with a WebID watermark) to be managed by a browser-based keystore</ulink> </listitem>
<listitem><ulink url="http://ods.openlinksw.com/wiki/ODS/ODSWebIDIdP">Using Virtuoso&#39;s WebID Verification Proxy Service with a WebID-bearing X.509 certificate</ulink> </listitem>
<listitem><ulink url="http://ods.openlinksw.com/wiki/ODS/ODSWebIDIdpProxy">Using Virtuoso&#39;s WebID Identity Provider (IdP) Proxy Service with an X.509 certificate</ulink> </listitem>
<listitem><ulink url="http://ods.openlinksw.com/wiki/ODS/ODSBriefcaseWebIDShareFile">ODS Briefcase WebID Protocol Share File Guide</ulink> </listitem>
<listitem><ulink url="http://esw.w3.org/topic/foaf+ssl">WebID Protocol Specification</ulink> </listitem>
<listitem><ulink url="https://foaf.me/simpleLogin.php">Test WebID Protocol Certificate page</ulink> </listitem>
<listitem><ulink url="http://test.foafssl.org/cert/">WebID Protocol Certificate Generation page</ulink> </listitem>
<listitem><ulink url="http://oauth.net/core/1.0/">OAuth API</ulink></listitem>
</itemizedlist><para> <ulink url="CategoryVirtuoso">CategoryVirtuoso</ulink> <ulink url="CategoryHowTo">CategoryHowTo</ulink> <ulink url="CategorySPARQL">CategorySPARQL</ulink> <ulink url="CategoryOAuth">CategoryOAuth</ulink> <ulink url="CategoryFOAFSSL">CategoryFOAFSSL</ulink> <ulink url="CategoryDocumentation">CategoryDocumentation</ulink> <ulink url="CategoryTutorial">CategoryTutorial</ulink> </para>
</section></docbook>