lemonldap-ng/doc/pages/documentation/current/applications/nextcloud.html
2019-09-23 22:41:16 +02:00

226 lines
9.2 KiB
HTML

<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8" />
<title>documentation:2.0:applications:nextcloud</title>
<meta name="generator" content="DokuWiki"/>
<meta name="robots" content="index,follow"/>
<meta name="keywords" content="documentation,2.0,applications,nextcloud"/>
<link rel="search" type="application/opensearchdescription+xml" href="../lib/exe/opensearch.html" title="LemonLDAP::NG"/>
<link rel="start" href="nextcloud.html"/>
<link rel="contents" href="nextcloud.html" title="Sitemap"/>
<link rel="stylesheet" type="text/css" href="../lib/exe/css.php.t.bootstrap3.css"/>
<!-- //if:usedebianlibs
<link rel="stylesheet" type="text/css" href="/javascript/bootstrap/css/bootstrap.min.css" />
//elsif:useexternallibs
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css"></script>
//elsif:cssminified
<link rel="stylesheet" type="text/css" href="/static/bwr/bootstrap/dist/css/bootstrap.min.css" />
//else -->
<link rel="stylesheet" type="text/css" href="/static/bwr/bootstrap/dist/css/bootstrap.css" />
<!-- //endif -->
<script type="text/javascript">/*<![CDATA[*/var NS='documentation:2.0:applications';var JSINFO = {"id":"documentation:2.0:applications:nextcloud","namespace":"documentation:2.0:applications"};
/*!]]>*/</script>
<script type="text/javascript" charset="utf-8" src="../lib/exe/js.php.t.bootstrap3.js"></script>
<!-- //if:usedebianlibs
<script type="text/javascript" src="/javascript/jquery/jquery.min.js"></script>
//elsif:useexternallibs
<script type="text/javascript" src="http://code.jquery.com/jquery-2.2.0.min.js"></script>
//elsif:jsminified
<script type="text/javascript" src="/static/bwr/jquery/dist/jquery.min.js"></script>
//else -->
<script type="text/javascript" src="/static/bwr/jquery/dist/jquery.js"></script>
<!-- //endif -->
<!-- //if:usedebianlibs
<script type="text/javascript" src="/javascript/jquery-ui/jquery-ui.min.js"></script>
//elsif:useexternallibs
<script type="text/javascript" src="http://code.jquery.com/ui/1.10.4/jquery-ui.min.js"></script>
//elsif:jsminified
<script type="text/javascript" src="/static/bwr/jquery-ui/jquery-ui.min.js"></script>
//else -->
<script type="text/javascript" src="/static/bwr/jquery-ui/jquery-ui.js"></script>
<!-- //endif -->
</head>
<body>
<div class="dokuwiki export container">
<!-- TOC START -->
<div id="dw__toc">
<h3 class="toggle">Table of Contents</h3>
<div>
<ul class="toc">
<li class="level1"><div class="li"><a href="#presentation">Presentation</a></div></li>
<li class="level1"><div class="li"><a href="#pre-requisites">Pre-requisites</a></div>
<ul class="toc">
<li class="level2"><div class="li"><a href="#nextcloud1">NextCloud</a></div></li>
<li class="level2"><div class="li"><a href="#llng">LL:NG</a></div></li>
</ul>
</li>
<li class="level1"><div class="li"><a href="#nextcloud_saml_20_configuration">NextCloud, SAML 2.0 configuration</a></div></li>
<li class="level1"><div class="li"><a href="#llng_saml_20_service_provider_configuration">LL:NG, SAML 2.0 Service Provider configuration</a></div></li>
</ul>
</div>
</div>
<!-- TOC END -->
<h1 class="sectionedit1" id="nextcloud">NextCloud</h1>
<div class="level1">
<p>
<img src="nextcloud-logo.png" class="mediacenter" alt="" />
</p>
</div>
<!-- EDIT1 SECTION "NextCloud" [1-73] -->
<h2 class="sectionedit2" id="presentation">Presentation</h2>
<div class="level2">
<p>
<a href="https://nextcloud.com/" class="urlextern" title="https://nextcloud.com/" rel="nofollow">NextCloud</a> is a fork of Owncloud, suite of client-server software for creating file hosting services and using them.
</p>
<p>
This documentation explains how to interconnect LemonLDAP::NG and NextCloud using <abbr title="Security Assertion Markup Language">SAML</abbr> 2.0 protocol.
</p>
</div>
<!-- EDIT2 SECTION "Presentation" [74-345] -->
<h2 class="sectionedit3" id="pre-requisites">Pre-requisites</h2>
<div class="level2">
</div>
<!-- EDIT3 SECTION "Pre-requisites" [346-373] -->
<h3 class="sectionedit4" id="nextcloud1">NextCloud</h3>
<div class="level3">
<p>
You need to <a href="https://docs.nextcloud.com/server/10/admin_manual/installation/index.html" class="urlextern" title="https://docs.nextcloud.com/server/10/admin_manual/installation/index.html" rel="nofollow">install the software</a>.
</p>
<div class="notetip">If your NextCloud is behind a proxy (thus having a private <abbr title="Internet Protocol">IP</abbr>), metadata generated by NextCloud won&#039;t work.
<p>
Consider changing the configuration of NextCloud to force the domain, in <strong>$nextcloudrootwww/config/config.php</strong>, add the following:
</p>
<pre class="code php"><span class="st_h">'overwritehost'</span> <span class="sy0">=&gt;</span> <span class="st_h">'nextcloud.example.com'</span><span class="sy0">,</span></pre>
</div>
<p>
You also need to enable the &quot;<abbr title="Security Assertion Markup Language">SAML</abbr> authentication&quot; plugin in your NextCloud.
</p>
<pre class="code"> + Apps -&gt; Not enabled -&gt; SAML authentication</pre>
</div>
<!-- EDIT4 SECTION "NextCloud" [374-966] -->
<h3 class="sectionedit5" id="llng">LL:NG</h3>
<div class="level3">
<p>
You need to enable <abbr title="Security Assertion Markup Language">SAML</abbr> 2.0 issuer module in LL:NG:
</p>
<pre class="code">&quot;General Parameters -&gt; Issuer modules -&gt; SAML -&gt; Activation&quot;</pre>
<p>
<img src="nextcloud_saml_activation.png" class="mediacenter" alt="" />
</p>
</div>
<!-- EDIT5 SECTION "LL:NG" [967-1168] -->
<h2 class="sectionedit6" id="nextcloud_saml_20_configuration">NextCloud, SAML 2.0 configuration</h2>
<div class="level2">
<p>
Configuration of <abbr title="Security Assertion Markup Language">SAML</abbr> 2.0 in NextCloud is pretty straightforward.
</p>
<pre class="code">Administration -&gt; SAML authentication</pre>
<p>
You will find the following fields:
</p>
<ul>
<li class="level1"><div class="li"> <strong>Attribute to map the UID to</strong>: Identity attribute provided by your LL:NG that will be used as UID in NextCloud.</div>
</li>
<li class="level1"><div class="li"> <strong>Identity Provider Data</strong>:</div>
<ul>
<li class="level2"><div class="li"> <strong>Identifier of the IdP entity</strong>: <abbr title="Security Assertion Markup Language">SAML</abbr> Metadata <abbr title="Uniform Resource Locator">URL</abbr> of your LL:NG</div>
</li>
<li class="level2"><div class="li"> <strong><abbr title="Uniform Resource Locator">URL</abbr> Target of the IdP where the SP will send the Authentication Request Message</strong>: SingleSignOn <abbr title="Uniform Resource Locator">URL</abbr> of your LL:NG</div>
</li>
<li class="level2"><div class="li"> <strong><abbr title="Uniform Resource Locator">URL</abbr> Location of the IdP where the SP will send the SLO Request</strong>: SingleLogOut <abbr title="Uniform Resource Locator">URL</abbr> of your LL:NG</div>
</li>
<li class="level2"><div class="li"> <strong>Public X.509 certificate of the IdP</strong>: Certificate of your LL:NG (see below for instructions)</div>
</li>
</ul>
</li>
</ul>
<p>
We need a few steps to generate our LL:NG certificate (unless you already have one).
You first need to create a pair of SSH Keys in LL:NG:
</p>
<pre class="code">SAML 2 Service -&gt; Security Parameters -&gt; Signature</pre>
<p>
and click &quot;New keys&quot;
<img src="nextcloud_certificate_keys.png" class="mediacenter" alt="" />
</p>
<p>
Take the private key in a private.key file, and run the following:
</p>
<pre class="code">openssl req -new -key private.key -out cert.csr
openssl x509 -req -days 3650 -in cert.csr -signkey private.key -out cert.pem</pre>
<p>
Copy/Paste the content of your new cert.pem in the &quot;Public X.509 certificate of the IdP&quot; field of your NextCloud.
</p>
<p>
Your fields should look like this:
<img src="nextcloud_saml_configuration.png" class="mediacenter" alt="" />
</p>
<p>
You can now download your metadata xml file.
</p>
</div>
<!-- EDIT6 SECTION "NextCloud, SAML 2.0 configuration" [1169-2671] -->
<h2 class="sectionedit7" id="llng_saml_20_service_provider_configuration">LL:NG, SAML 2.0 Service Provider configuration</h2>
<div class="level2">
<p>
We now have to define a service provider (e.g our nextcloud) in LL:NG.
</p>
<p>
Go to &quot;<abbr title="Security Assertion Markup Language">SAML</abbr> service providers&quot;, click on &quot;Add <abbr title="Security Assertion Markup Language">SAML</abbr> SP&quot; and name it as you want (example : &#039;NextCloud&#039;)
</p>
<p>
In the new subtree &#039;NextCloud&#039;, open &#039;Metadata&#039; and paste the content of your previously downloaded file (or upload the file)
</p>
<p>
<img src="nextcloud_service_metadata.png" class="mediacenter" alt="" />
</p>
<p>
Now go in &quot;Exported attributes&quot; and add, at least, the &#039;uid&#039;
</p>
<p>
<img src="nextcloud_service_exportedattributes.png" class="mediacenter" alt="" />
</p>
<p>
Don&#039;t forget to save your configuration.
</p>
<p>
You are now good to go, and you can add the application in <a href="../portalmenu.html" class="wikilink1" title="documentation:2.0:portalmenu">your menu</a> and <a href="../configvhost.html#lemonldapng_configuration" class="wikilink1" title="documentation:2.0:configvhost">your virtual hosts</a>.
</p>
</div>
<!-- EDIT7 SECTION "LL:NG, SAML 2.0 Service Provider configuration" [2672-] --></div>
</body>
</html>