<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Sso on slash-root.fr</title><link>https://beta.slash-root.fr/tags/sso/</link><description>Recent content in Sso on slash-root.fr</description><generator>Hugo -- gohugo.io</generator><language>fr-fr</language><lastBuildDate>Fri, 01 Jul 2022 12:08:48 +0200</lastBuildDate><atom:link href="https://beta.slash-root.fr/tags/sso/index.xml" rel="self" type="application/rss+xml"/><item><title>Nextcloud : Intégration d’une authentification SSO avec AD FS</title><link>https://beta.slash-root.fr/nextcloud-integration-dune-authentification-sso-avec-ad-fs/</link><pubDate>Fri, 08 Jul 2022 12:00:33 +0200</pubDate><guid>https://beta.slash-root.fr/nextcloud-integration-dune-authentification-sso-avec-ad-fs/</guid><description>&lt;img src="https://beta.slash-root.fr/nextcloud-integration-dune-authentification-sso-avec-ad-fs/cover.png" alt="Featured image of post Nextcloud : Intégration d’une authentification SSO avec AD FS" /&gt;&lt;p&gt;Cet article fait office de PoC (Proof of Concept) sur la mise en place d'une authentification SSO (Single-Sign-On) à travers le service ADFS (Active Directory Federation Services) de Microsoft et l'application Open Source Nextcloud.&lt;/p&gt;
&lt;p&gt;Cela va permettre aux utilisateurs de la plateforme Nextcloud de s'authentifier avec leur compte Active Directory en utilisant le protocole SAML dans des contextes réseaux totalement différents.&lt;/p&gt;
&lt;h2 id="environnement"&gt;&lt;a href="#environnement" class="header-anchor"&gt;&lt;/a&gt;Environnement
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;Environnements déjà déployés :
&lt;ul&gt;
&lt;li&gt;Nextcloud v24.0.2&lt;/li&gt;
&lt;li&gt;Contrôleur de domaine Windows Serveur 2019&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Informations :
&lt;ul&gt;
&lt;li&gt;Domaine AD : aukfood.lan&lt;/li&gt;
&lt;li&gt;Nom serveur AD : adfs-dev&lt;/li&gt;
&lt;li&gt;Domaine publique utilisé : example.com (remplace les parties floutées dans les captures d'écrans)&lt;/li&gt;
&lt;li&gt;URL Nextcloud : &lt;a href="https://nc-dev.example.com"&gt;https://nc-dev.example.com&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Enregistrement DNS pour l'ADFS : adfs2-dev.example.com&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="génération-du-certificat-lets-encrypt"&gt;&lt;a href="#g%c3%a9n%c3%a9ration-du-certificat-lets-encrypt" class="header-anchor"&gt;&lt;/a&gt;Génération du certificat Let&amp;rsquo;s Encrypt
&lt;/h2&gt;&lt;p&gt;A effectuer sur le serveur Windows (Tous les services seront déployés sur le contrôleur de domaine) :&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Installation de IIS en Powershell :&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-powershell" data-lang="powershell"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Install-WindowsFeature -name Web-Server -IncludeManagementTools
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Faire un enregistrement de type A dans une zone DNS publique pour le serveur IIS :&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-ini" data-lang="ini"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#a6e22e"&gt;adfs2-dev IN A xxx.xxx.xxx.xxx&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;blockquote&gt;
&lt;p&gt;Dans ce PoC, le domaine publique utilisé sera &lt;em&gt;example.com&lt;/em&gt;.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Créer la racine du site web pour résoudre le challenge :&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;mkdir c:&lt;span style="color:#ae81ff"&gt;\i&lt;/span&gt;netpub&lt;span style="color:#ae81ff"&gt;\a&lt;/span&gt;dfs2-dev.example.com
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Créer un fichier &lt;code&gt;index.html&lt;/code&gt; dans la racine du site web :&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;notepad c:&lt;span style="color:#ae81ff"&gt;\i&lt;/span&gt;netpub&lt;span style="color:#ae81ff"&gt;\a&lt;/span&gt;dfs2-dev.example.com&lt;span style="color:#ae81ff"&gt;\i&lt;/span&gt;ndex.html
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Insérer le contenu suivant puis enregistrer :&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-html" data-lang="html"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Hello world
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Ouvrir la console de &lt;code&gt;Gestionnaire des services Internet (IIS)&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Supprimer le site web par défaut.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Ajouter un nouveau site web :&lt;/p&gt;
&lt;p&gt;&lt;img data-recalc-dims="1" decoding="async" src="website_iis.png" alt="image-20220629173936647" /&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Télécharger le client ACME pour Let's Encrypt ici : &lt;a href="https://www.win-acme.com/"&gt;https://www.win-acme.com/&lt;/a&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;A l'heure actuelle, la dernière version : &lt;a href="https://github.com/win-acme/win-acme/releases/download/v2.1.22.1267/win-acme.v2.1.22.1267.x64.pluggable.zip"&gt;https://github.com/win-acme/win-acme/releases/download/v2.1.22.1267/win-acme.v2.1.22.1267.x64.pluggable.zip&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Décompresser l'archive et déplacer le fichier &lt;code&gt;Web_Config.xml&lt;/code&gt; à la racine du site web.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Redémarrer le site web.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Lancer une ligne de commandes et se positionner dans le répertoire préalablement extrait.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Exécuter &lt;code&gt;wacs.exe&lt;/code&gt; :&lt;/p&gt;
&lt;p&gt;&lt;img data-recalc-dims="1" decoding="async" src="wacs.png" alt="image-20220629172217587" /&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Créer un nouveau certificat (Choix &lt;strong&gt;N&lt;/strong&gt;).&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Sélectionner le site ajouté au préalable dans IIS :&lt;/p&gt;
&lt;p&gt;&lt;img data-recalc-dims="1" decoding="async" src="wacs-N.png" alt="image-20220629174215379" /&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Peu importe si le certificat est de type wildcard ou non.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Le certificat est généré avec une tâche planifiée qui va renouveller le certificat automatiquement :&lt;/p&gt;
&lt;p&gt;&lt;img data-recalc-dims="1" decoding="async" src="wacs-C.png" alt="image-20220629174528336" /&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Une liaison &lt;strong&gt;https&lt;/strong&gt; (vhost) a été automatiquement générée pour le site web :&lt;/p&gt;
&lt;p&gt;&lt;img data-recalc-dims="1" decoding="async" src="wacs-vhost.png" alt="image-20220629175250793" /&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Ce certificat est celui qui sera exploité par le service &lt;code&gt;AD FS&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="exportation-du-certificat-au-format-pfx"&gt;&lt;a href="#exportation-du-certificat-au-format-pfx" class="header-anchor"&gt;&lt;/a&gt;Exportation du certificat au format pfx
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Re-lancer l'outil &lt;code&gt;wacs.exe&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Faire le choix &lt;strong&gt;A&lt;/strong&gt; (Manage renewals) :&lt;/p&gt;
&lt;p&gt;&lt;img data-recalc-dims="1" decoding="async" src="wacs-A.png" alt="image-20220629182842875" /&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Afficher les détails avec &lt;strong&gt;D&lt;/strong&gt;, puis noter le &lt;code&gt;.pfx password&lt;/code&gt; :&lt;/p&gt;
&lt;p&gt;&lt;img data-recalc-dims="1" decoding="async" src="wacs-D.png" alt="image-20220629183139844" /&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Ouvrir le dossier des certificats Let's Encrypt :&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-powershell" data-lang="powershell"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;explorer C:\ProgramData\win-acme\acme-v02.api.letsencrypt.org\Certificates\
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Sélectionner le certificat &lt;code&gt;.pfx&lt;/code&gt; correspondant puis démarrer l'assistant d'importation du certificat au niveau de l'ordinateur local (Pour rappel : c'est le DC) :&lt;/p&gt;
&lt;p&gt;&lt;img data-recalc-dims="1" decoding="async" src="pfx-export.png" alt="image-20220629184339453" /&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Saisir le mot de passe de la clé privée (&lt;code&gt;.pfx password&lt;/code&gt; noté au préalable) et cocher &lt;code&gt;Marquer cette clé comme exportable&lt;/code&gt; :&lt;/p&gt;
&lt;p&gt;&lt;img data-recalc-dims="1" decoding="async" src="pfx-password.png" alt="image-20220630082547704" /&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Sélectionner automatiquement le magasin de certificats.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Terminer l'assistant d'importation du certificat.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Ouvrir la gestion des certificats de l'ordinateur local :&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-powershell" data-lang="powershell"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;certlm.msc
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Dans &amp;quot;Personnel\Certificats&amp;quot; (1), sélectionner le certificat préalablement importé (2). Dans &amp;quot;Toutes les tâches&amp;quot; (3), sélectionner &amp;quot;Exporter&amp;quot; (4) :&lt;/p&gt;
&lt;p&gt;&lt;img data-recalc-dims="1" decoding="async" src="cert-export.png" alt="image-20220630083328159" /&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Il est maintenant possible d'exporter la clé privée du certificat :&lt;/p&gt;
&lt;p&gt;&lt;img data-recalc-dims="1" decoding="async" src="privkey-export.png" alt="image-20220630083457141" /&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Exporter toutes les propriétés étendues :&lt;/p&gt;
&lt;p&gt;&lt;img data-recalc-dims="1" decoding="async" src="export-all.png" alt="image-20220630083627092" /&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Saisir un mot de passe pour protéger la clé privée :&lt;/p&gt;
&lt;p&gt;&lt;img data-recalc-dims="1" decoding="async" src="protect-privkey.png" alt="image-20220630083813883" /&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Spécifier le nom du fichier à exporter au format &lt;code&gt;pfx&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Terminer l'assistant d'exportation du certificat.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="installation-ad-fs"&gt;&lt;a href="#installation-ad-fs" class="header-anchor"&gt;&lt;/a&gt;Installation AD FS
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Installer le service &lt;code&gt;ADFS-Federation&lt;/code&gt; en Powershell :&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-powershell" data-lang="powershell"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Install-WindowsFeature -name ADFS-Federation -IncludeManagementTools
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Créer la clé racine du service de distribution de clés en Powershell :&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-powershell" data-lang="powershell"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Add-KdsRootKey -EffectiveTime (Get-Date).AddHours(&lt;span style="color:#ae81ff"&gt;-10&lt;/span&gt;)
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;La configuration du service se fera en mode graphique à travers le gestionnaire de serveur &lt;code&gt;servermanager.exe&lt;/code&gt; :&lt;/p&gt;
&lt;p&gt;&lt;img data-recalc-dims="1" decoding="async" src="adfs-config.png" alt="image-20220630114920640" /&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Créer le premier serveur de fédération dans une batterie de serveurs de fédération.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Importer le certificat préalablement exporté au format &lt;code&gt;.pfx&lt;/code&gt; (1). Puis, entrer un nom pour le service FS (2) :&lt;/p&gt;
&lt;p&gt;&lt;img data-recalc-dims="1" decoding="async" src="cert-adfs.png" alt="image-20220630133612131" /&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Spécifier un compte de service :&lt;/p&gt;
&lt;p&gt;&lt;img data-recalc-dims="1" decoding="async" src="adfs-service.png" alt="image-20220630134121333" /&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Une base de données SQL Server peut être exploitée. Dans ce PoC, une base de données interne Windows est utilisée.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Après examen des options, la configuration peut être lancée :&lt;/p&gt;
&lt;p&gt;&lt;img data-recalc-dims="1" decoding="async" src="adfs-install.png" alt="image-20220630134402869" /&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Redémarrer le serveur Windows.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Activer la page de login de l'ADFS en Powershell :&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-powershell" data-lang="powershell"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Set-AdfsProperties -EnableIdpInitiatedSignonPage $true
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Tester la connexion : &lt;a href="https://adfs2-dev.example.com/adfs/ls/IdpInitiatedSignon.aspx"&gt;https://adfs2-dev.example.com/adfs/ls/IdpInitiatedSignon.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;img data-recalc-dims="1" decoding="async" src="test-adfs.png" alt="image-20220630141116182" /&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="paramétrage-nextcloud"&gt;&lt;a href="#param%c3%a9trage-nextcloud" class="header-anchor"&gt;&lt;/a&gt;Paramétrage Nextcloud
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Se connecter en SSH sur le serveur Nextcloud et se positionner à la racine du projet web :&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;cd /var/www/nc-dev.example.com/www/
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Installer l'application &lt;code&gt;user_saml&lt;/code&gt; avec &lt;code&gt;occ&lt;/code&gt; (A adapter selon le propriétaire du projet web) :&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;sudo -u nextcloud php8.0 occ app:install user_saml
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;# user_saml 5.0.2 installed&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;# user_saml enabled&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Se connecter à l'interface web du Nextcloud en &lt;code&gt;admin&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Se rendre dans &amp;quot;Paramètres&amp;quot; (1) / &amp;quot;Authentification SSO &amp;amp; SAML&amp;quot; (2). Puis &amp;quot;Utiliser l'authentification SAML intégrée&amp;quot; (3) :&lt;/p&gt;
&lt;p&gt;&lt;img data-recalc-dims="1" decoding="async" src="next-samlon.png" alt="image-20220630140157898" /&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Dans la partie &amp;quot;Général&amp;quot;, entrer l'&lt;strong&gt;Attribut pour relier l'UID&lt;/strong&gt; :&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;http://schemas.xmlsoap.org/ws/2005/05/identity/claims/upn
&lt;/code&gt;&lt;/pre&gt;&lt;blockquote&gt;
&lt;p&gt;C'est l'UPN du compte de l'utilisateur dans l'AD qui fera office de nom d'utilisateur au sein de l'instance Nextcloud.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;img data-recalc-dims="1" decoding="async" src="next-upn.png" alt="image-20220630140651305" /&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Configurer les options IdP :&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Identifiant de l'entité IdP&lt;/strong&gt; : &lt;a href="http://adfs2-dev.example.com/adfs/services/trust"&gt;http://adfs2-dev.example.com/adfs/services/trust&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;URL cible du fournisseur d'identités à qui le fournisseur de service enverra la requête d'authentification&lt;/strong&gt; : &lt;a href="https://adfs2-dev.example.com/adfs/ls"&gt;https://adfs2-dev.example.com/adfs/ls&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img data-recalc-dims="1" decoding="async" src="next-optionsidp.png" alt="image-20220630141706164" /&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Cliquer sur &amp;quot;Hide optional Identity Provider settings&amp;quot; pour accéder au champ &lt;strong&gt;Certificat public X.509 de l'IdP&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Sur le serveur Windows, ouvrir la console de gestion de l'ADFS :&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-powershell" data-lang="powershell"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#66d9ef"&gt;%&lt;/span&gt;windir%\ADFS\Microsoft.IdentityServer.msc
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Dans &amp;quot;Service&amp;quot; / &amp;quot;Certificats&amp;quot; (1), Afficher le certificat (2) utilisé pour la signature de jetons :&lt;/p&gt;
&lt;p&gt;&lt;img data-recalc-dims="1" decoding="async" src="adfs-certpub.png" alt="image-20220630142847703" /&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Dans l'onglet &amp;quot;Détails&amp;quot;, copier dans un fichier :&lt;/p&gt;
&lt;p&gt;&lt;img data-recalc-dims="1" decoding="async" src="cert-copier.png" alt="image-20220630143034704" /&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Exporter au format : *&lt;em&gt;X.509 encodé en base 64 (&lt;/em&gt;.cer)**&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Spécifier un nom de fichier pour l'export.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Copier le contenu de ce fichier exporté au format &lt;code&gt;.cer&lt;/code&gt; et le coller dans le champ &lt;strong&gt;Certificat public X.509 de l'IdP&lt;/strong&gt; dans Nextcloud :&lt;/p&gt;
&lt;p&gt;&lt;img data-recalc-dims="1" decoding="async" src="next-certpub.png" alt="image-20220630143523748" /&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Mapper les attributs suivants au minimum :&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Attribut pour relier le nom d'utilisateur&lt;/strong&gt; : &lt;a href="http://schemas.microsoft.com/identity/claims/displayname"&gt;http://schemas.microsoft.com/identity/claims/displayname&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Attribut pour relier l'adresse mail&lt;/strong&gt; : &lt;a href="http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress"&gt;http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img data-recalc-dims="1" decoding="async" src="next-map.png" alt="image-20220630143833948" /&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Télécharger le fichier &lt;code&gt;metadata.xml&lt;/code&gt; :&lt;/p&gt;
&lt;p&gt;&lt;img data-recalc-dims="1" decoding="async" src="next-metadata.png" alt="image-20220630144006856" /&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Pour avoir la possibilité de garder l'authentification avec la base utilisateur interne de Nextcloud, cocher &lt;strong&gt;Autoriser l'utilisation de plusieurs systèmes d'authentification&lt;/strong&gt; :&lt;/p&gt;
&lt;p&gt;&lt;img data-recalc-dims="1" decoding="async" src="next-manyauth.png" alt="image-20220630144234576" /&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Bien vérifier l'enregistrement du paramétrage en quittant le menu &amp;quot;Authentification SSO &amp;amp; SAML&amp;quot; et en y revenant (Surtout sur le paramétrage du point précédent).&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="paramétrage-ad-fs"&gt;&lt;a href="#param%c3%a9trage-ad-fs" class="header-anchor"&gt;&lt;/a&gt;Paramétrage AD FS
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Sur le serveur Windows, ouvrir la console de gestion de l'AD FS :&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-powershell" data-lang="powershell"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#66d9ef"&gt;%&lt;/span&gt;windir%\ADFS\Microsoft.IdentityServer.msc
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Ajouter une approbation de partie de confiance :&lt;/p&gt;
&lt;p&gt;&lt;img data-recalc-dims="1" decoding="async" src="adfs-trusted.png" alt="image-20220630151040792" /&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Prendre en charge les revendications.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Importer les données concernant la partie de confiance à partir du fichier &lt;code&gt;metadata.xml&lt;/code&gt; téléchargé préalablement :&lt;/p&gt;
&lt;p&gt;&lt;img data-recalc-dims="1" decoding="async" src="adfs-metadata.png" alt="image-20220630151343201" /&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Saisir un nom pour cette approbation et éventuellement des notes.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Sélectionner une stratégie de contrôle d'accès. Dans ce PoC, tout le monde sera autorisé :&lt;/p&gt;
&lt;p&gt;&lt;img data-recalc-dims="1" decoding="async" src="adfs-policy.png" alt="image-20220630151559318" /&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;La partie de confiance a été configurée à l'aide du fichier &lt;code&gt;metadata.xml&lt;/code&gt; fourni.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Editer la stratégie d'émission de revendication :&lt;/p&gt;
&lt;p&gt;&lt;img data-recalc-dims="1" decoding="async" src="adfs-revendication.png" alt="image-20220630151802258" /&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;2 règles de revendication de transformations sont à ajouter au minimum :&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;userPrincipalName&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Email&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Le modèle de régle de revendication à suivre est : &lt;strong&gt;Envoyer les attributs LDAP en tant que revendications&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Règle &lt;strong&gt;userPrincipalName&lt;/strong&gt; :&lt;/p&gt;
&lt;p&gt;&lt;img data-recalc-dims="1" decoding="async" src="adfs-upn.png" alt="image-20220630152456345" /&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Règle &lt;strong&gt;Email&lt;/strong&gt; :&lt;/p&gt;
&lt;p&gt;&lt;img data-recalc-dims="1" decoding="async" src="adfs-email.png" alt="image-20220630152543102" /&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Appliquer les 2 règles ajoutées.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="vérification-de-lauthentification"&gt;&lt;a href="#v%c3%a9rification-de-lauthentification" class="header-anchor"&gt;&lt;/a&gt;Vérification de l&amp;rsquo;authentification
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Se connecter à Nextcloud, et choisir de s'authentifier au travers une &lt;strong&gt;Connection SSO &amp;amp; SAML&lt;/strong&gt; :&lt;/p&gt;
&lt;p&gt;&lt;img data-recalc-dims="1" decoding="async" src="next-adfs.png" alt="image-20220630152933665" /&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Utiliser un compte de l'Active Directory autoriser à se connecter à travers l'AD FS :&lt;/p&gt;
&lt;p&gt;&lt;img data-recalc-dims="1" decoding="async" src="adfs-test.png" alt="image-20220630153048587" /&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Congratulations !&lt;/p&gt;
&lt;p&gt;&lt;img data-recalc-dims="1" decoding="async" src="adfs-next.png" alt="image-20220630153150780" /&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="ressources-en-vrac"&gt;&lt;a href="#ressources-en-vrac" class="header-anchor"&gt;&lt;/a&gt;Ressources en vrac
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://blog.kveer.fr/login-nextcloud-saml-adfs/"&gt;https://blog.kveer.fr/login-nextcloud-saml-adfs/&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://www.virtualease.fr/nextcloud-authentication-active-directory-sso-via-adfs-saml/"&gt;https://www.virtualease.fr/nextcloud-authentication-active-directory-sso-via-adfs-saml/&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="http://os-zenia.blogspot.com/2021/01/nextcloud-sso-adfs.html"&gt;http://os-zenia.blogspot.com/2021/01/nextcloud-sso-adfs.html&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://rephlex.de/blog/2018/04/05/how-to-connect-nextcloud-to-active-directory-using-ad-fs-without-losing-your-mind/"&gt;https://rephlex.de/blog/2018/04/05/how-to-connect-nextcloud-to-active-directory-using-ad-fs-without-losing-your-mind/&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://www.myworkdrive.com/fr/support/adfs-single-sign-sso-integration-guide/"&gt;https://www.myworkdrive.com/fr/support/adfs-single-sign-sso-integration-guide/&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://www.infotechram.com/wp-content/uploads/2020/07/Installing-Active-Directory-Federation-Services.pdf"&gt;https://www.infotechram.com/wp-content/uploads/2020/07/Installing-Active-Directory-Federation-Services.pdf&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://www.alitajran.com/export-lets-encrypt-certificate-in-windows-server/"&gt;https://www.alitajran.com/export-lets-encrypt-certificate-in-windows-server/&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://www.rcfed.com/SAMLWSFed/CommonClaimtypelist"&gt;https://www.rcfed.com/SAMLWSFed/CommonClaimtypelist&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://docs.microsoft.com/fr-fr/dotnet/api/system.security.claims.claimtypes?view=net-6.0"&gt;https://docs.microsoft.com/fr-fr/dotnet/api/system.security.claims.claimtypes?view=net-6.0&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://docs.microsoft.com/fr-fr/windows-server/identity/ad-fs/troubleshooting/ad-fs-tshoot-initiatedsignon"&gt;https://docs.microsoft.com/fr-fr/windows-server/identity/ad-fs/troubleshooting/ad-fs-tshoot-initiatedsignon&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://help.mulesoft.com/s/article/Configuring-ADFS-SLO-endpoint"&gt;https://help.mulesoft.com/s/article/Configuring-ADFS-SLO-endpoint&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://pitstop.manageengine.com/portal/en/kb/articles/saml-auto-login-with-adfs"&gt;https://pitstop.manageengine.com/portal/en/kb/articles/saml-auto-login-with-adfs&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;</description></item><item><title>LemonLDAP : Installation avec un LDAP et FusionDirectory</title><link>https://beta.slash-root.fr/lemonldap-installation-avec-un-ldap-et-fusiondirectory/</link><pubDate>Tue, 16 Nov 2021 14:48:52 +0100</pubDate><guid>https://beta.slash-root.fr/lemonldap-installation-avec-un-ldap-et-fusiondirectory/</guid><description>&lt;img src="https://beta.slash-root.fr/lemonldap-installation-avec-un-ldap-et-fusiondirectory/cover.png" alt="Featured image of post LemonLDAP : Installation avec un LDAP et FusionDirectory" /&gt;&lt;h2 id="introduction"&gt;&lt;a href="#introduction" class="header-anchor"&gt;&lt;/a&gt;Introduction
&lt;/h2&gt;&lt;p&gt;LemonLDAP::NG est un logiciel open source, créé en 2004 par la Gendarmerie nationale française. Il fournit une solution d' authentification unique distribuée avec gestion centralisée des droits sous licence GPL.&lt;/p&gt;
&lt;p&gt;Le logiciel LemonLDAP::NG est issu d'un logiciel créé par Eric German suivant le protocole de gestion d'annuaire LDAP sous TCP/IP pour le Ministère des finances français. La Gendarmerie nationale reprend ce logiciel pour l'élargir et le conformer à ses besoins.&lt;/p&gt;
&lt;p&gt;Le logiciel fonctionne avec les serveurs web Apache ou Nginx mais un mode reverse proxy permet de l'utiliser avec des applications exécutées sur un autre serveur (IIS, Tomcat, etc.)3,4.&lt;/p&gt;
&lt;p&gt;Il peut gérer plus de 200000 utilisateurs de différentes organisations, il implémente à la fois5 :&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;les services de fournisseur d'identité et de service SAML, OpenID, CAS et OpenID Connect6 ;&lt;/li&gt;
&lt;li&gt;peut-être utilisé comme Proxy protocolaire en fédération des identités ;&lt;/li&gt;
&lt;li&gt;l'authentification basée sur LDAP, Kerberos, SQL, Twitter et d'autres protocoles ;&lt;/li&gt;
&lt;li&gt;l'authentification à double facteur (U2F, TOTP, Yubikey, REST ou externe tels SMS ou mails)7&lt;/li&gt;
&lt;li&gt;un système d'authentification unique basé sur des cookies sécurisés ;&lt;/li&gt;
&lt;li&gt;un menu dynamique des applications ;&lt;/li&gt;
&lt;li&gt;un module de réinitialisation de mots de passe ;&lt;/li&gt;
&lt;li&gt;un module d'auto-création de compte ;&lt;/li&gt;
&lt;li&gt;un dispositif de notification ;&lt;/li&gt;
&lt;li&gt;un explorateur de sessions.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Depuis la version 1.9, il propose un connecteur FranceConnect, lui permettant d'être simplement soit fournisseur d'identités, soit fournisseur de services8.&lt;/p&gt;
&lt;p&gt;La version 2.0.6 apporte, entre autres évolutions, les nouvelles fonctionnalités suivantes :&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;la sur-charge des seconds facteurs et la prise en charge du protocole RADIUS ;&lt;/li&gt;
&lt;li&gt;la possibilité de définir une politique locale des mots de passe ;&lt;/li&gt;
&lt;li&gt;un module de simulation d'identités pour des environnements de formation ;&lt;/li&gt;
&lt;li&gt;un module d'endossement d'identité pouvant être activé à des fins de diagnostic ;&lt;/li&gt;
&lt;li&gt;un module permettant de consulter le profil SSO d'un utilisateur et de vérifier ses droits d'accès ainsi que les en-têtes transmis ;&lt;/li&gt;
&lt;li&gt;un module pour éditer la configuration en lecture seule.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;La version 2.0.7 permet un meilleur support du protocole OpenId Connect et apporte de nombreuses améliorations ou correctifs.&lt;/p&gt;
&lt;p&gt;La version 2.0.8 offre de nombreuses API et améliorations.&lt;/p&gt;
&lt;p&gt;La version 2.0.9 apporte un outil de gestion des sessions, ameliore la gestion des mots de passe, une documentation intégrée au code source et des correctifs.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Source : &lt;a href="https://fr.wikipedia.org/wiki/LemonLDAP::NG"&gt;LemonLDAP::NG — Wikipédia (wikipedia.org)&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2 id="pré-requis"&gt;&lt;a href="#pr%c3%a9-requis" class="header-anchor"&gt;&lt;/a&gt;Pré-requis
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;Un serveur OpenLDAP installé et fonctionnel&lt;/li&gt;
&lt;li&gt;FusionDirectory déployé sur le serveur LDAP&lt;/li&gt;
&lt;li&gt;Un nom de domaine avec la gestion de sa zone DNS&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote&gt;
&lt;ul&gt;
&lt;li&gt;Suite directe de : &lt;a href="https://beta.slash-root.fr/2021/11/04/openldap-installation-avec-fusiondirectory/"&gt;OpenLDAP : Installation avec FusionDirectory - slash-root.fr&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Le nom de domaine utilisé dans cet article sera : &lt;em&gt;example.com&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;LemonLDAP sera déployé sur le même serveur qu'OpenLDAP / FusionDirectory&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;
&lt;h2 id="installation-lemonldap"&gt;&lt;a href="#installation-lemonldap" class="header-anchor"&gt;&lt;/a&gt;Installation LemonLDAP
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Utiliser le dépôt officiel :&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;sudo cat &amp;gt; /etc/apt/sources.list.d/lemonldap-ng.list &lt;span style="color:#e6db74"&gt;&amp;lt;&amp;lt; &amp;#39;EOL&amp;#39;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#e6db74"&gt;# LemonLDAP::NG repository
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#e6db74"&gt;deb https://lemonldap-ng.org/deb 2.0 main
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#e6db74"&gt;deb-src https://lemonldap-ng.org/deb 2.0 main
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#e6db74"&gt;EOL&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Récupérer la clef GPG :&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;wget -O - https://lemonldap-ng.org/_media/rpm-gpg-key-ow2 | sudo apt-key add -
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Mise à jour du cache apt :&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;sudo apt update
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Installer le package principal et le module Perl pour Apache2 :&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;sudo apt install libapache2-mod-perl2 lemonldap-ng
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;blockquote&gt;
&lt;p&gt;LemonLDAP est également compatible avec Nginx mais cela ne sera pas abordé dans cet article.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Installer le module FCGID pour Apache :&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;sudo apt install libapache2-mod-fcgid
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Activer les modules et les configurations :&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;sudo a2ensite manager-apache2.conf
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;sudo a2ensite portal-apache2.conf
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;sudo a2ensite handler-apache2.conf
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;sudo a2enmod fcgid perl alias rewrite headers
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Tester la configuration d'Apache2 :&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;sudo apachectl configtest
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Redémarrer Apache2 :&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;sudo systemctl restart apache2
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote&gt;
&lt;p&gt;Par défaut, le domaine est &lt;code&gt;example.com&lt;/code&gt;. Celui-ci peut être changé.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Pour changer le nom de domaine par défaut :&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;sed -i &lt;span style="color:#e6db74"&gt;&amp;#39;s/example\.com/mondomaine.local/g&amp;#39;&lt;/span&gt; /etc/lemonldap-ng/* /var/lib/lemonldap-ng/conf/lmConf-1.json
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;blockquote&gt;
&lt;p&gt;Adapter la suite des instructions avec le domaine utilisé en lieu et place d'&lt;code&gt;example.com&lt;/code&gt;.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="accès-web-ui"&gt;&lt;a href="#acc%c3%a8s-web-ui" class="header-anchor"&gt;&lt;/a&gt;Accès Web UI
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Pour accéder à la Web UI et effectuer les tests nécessaires, il y a 4 enregistrements A à réaliser dans la zone DNS du domaine :&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;auth.example.com&lt;/li&gt;
&lt;li&gt;manager.example.com&lt;/li&gt;
&lt;li&gt;test1.example.com&lt;/li&gt;
&lt;li&gt;test2.example.com&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote&gt;
&lt;p&gt;C'est 4 URLs sont à rediriger vers le même serveur. test1 et test2 sont là pour simuler 2 applications différentes.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Avec un navigateur web, accéder à &lt;a href="http://auth.example.com"&gt;http://auth.example.com&lt;/a&gt; :&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img data-recalc-dims="1" decoding="async" src="1stacces.png" alt="" /&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Dans un 1er temps, utiliser le login &lt;code&gt;dwho&lt;/code&gt; avec le mot de passe &lt;code&gt;dwho&lt;/code&gt;. Ce compte est local à LemonLDAP et à des droits administrateur sur la plateforme.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;ul&gt;
&lt;li&gt;Se rendre sur &lt;code&gt;WebSSO Manager&lt;/code&gt; ou directement via l'URL : &lt;a href="http://manager.example.com"&gt;http://manager.example.com&lt;/a&gt; :&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img data-recalc-dims="1" decoding="async" src="websso_manager.png" alt="" /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;La configuration qui va être appliqué peut se faire intégralement par cette Web UI :&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img data-recalc-dims="1" decoding="async" src="configuration_sso.png" alt="" /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Afin de pouvoir automatiser tout ce processus plus tard, la configuration sera réalisée en ligne de commande à l'aide de l'outil :&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;/usr/share/lemonldap-ng/bin/lemonldap-ng-cli help
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="activer-les-applications-de-démonstration"&gt;&lt;a href="#activer-les-applications-de-d%c3%a9monstration" class="header-anchor"&gt;&lt;/a&gt;Activer les applications de démonstration
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;LemonLDAP est fournit avec 2 applications de démonstration qui permettent de lire les en-têtes HTTP. Pour les activer :&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;sudo a2ensite test-apache2.conf
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;sudo systemctl reload apache2
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;C'est un vhost standard d'Apache2 :&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;sudo cat /etc/apache2/sites-enabled/test-apache2.conf
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Remarquer la ligne qui à été ajoutée concernant le SSO :&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#75715e"&gt;# SSO protection&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; PerlHeaderParserHandler Lemonldap::NG::Handler::ApacheMP2
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Vérifier l'accès aux applications de démonstration en se rendant sur :&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://test1.example.com"&gt;http://test1.example.com&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://test2.example.com"&gt;http://test2.example.com&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Pas besoin de s'authentifier car cela a été fait l'autre de l'accès à la plateforme LemonLDAP :&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img data-recalc-dims="1" decoding="async" src="test1.png" alt="" /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Il est possible de se déconnecter de cette application test1, en bas de la page :&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img data-recalc-dims="1" decoding="async" src="test1_logout.png" alt="" /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Lors de la prochaine tentative d'accès, une demande d'authentification de LemonLDAP sera demandée.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="configuration-avec-openldap--fusiondirectory"&gt;&lt;a href="#configuration-avec-openldap--fusiondirectory" class="header-anchor"&gt;&lt;/a&gt;Configuration avec OpenLDAP / FusionDirectory
&lt;/h2&gt;&lt;p&gt;Pour le moment LemonLDAP est en mode démo et utilise une base de compte interne. La configuration de LemonLDAP va consister à utiliser l'annuaire OpenLDAP préalablement déployé avec FusionDirectory. Une chose à savoir est que l'accès au manager est réservé exclusivement à l'utilisateur &lt;code&gt;dwho&lt;/code&gt; de la base de compte interne à LemonLDAP. Lors de la jonction de l'annuaire LDAP à LemonLDAP, la base de compte interne ne sera plus exploitable. Par conséquence, l'accès au WebSSO Manager ne se fera plus. Il y a plusieurs méthodes possibles pour retrouver cet accès. En voici une qui consiste à n'autoriser que l'utilisateur &lt;code&gt;fd-admin&lt;/code&gt; de l'annuaire LDAP :&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Avec l'utilisateur &lt;code&gt;dwho&lt;/code&gt; se rendre dans le Manager. Puis &lt;code&gt;Hôtes virtuels&lt;/code&gt;, &lt;code&gt;manager.example.com&lt;/code&gt;, &lt;code&gt;Règles d&amp;#039;accès&lt;/code&gt; :&lt;/p&gt;
&lt;p&gt;&lt;img data-recalc-dims="1" decoding="async" src="vhost_manager.png" alt="" /&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Modifier la partie &lt;code&gt;Règles&lt;/code&gt; à droite comme ci-dessus. Puis &lt;code&gt;Sauver&lt;/code&gt; la configuration.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Paramétrer la liaison à l'annuaire LDAP :&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;sudo /usr/share/lemonldap-ng/bin/lemonldap-ng-cli -yes &lt;span style="color:#ae81ff"&gt;1&lt;/span&gt; &lt;span style="color:#ae81ff"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; set &lt;span style="color:#ae81ff"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; authentication LDAP &lt;span style="color:#ae81ff"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; userDB LDAP &lt;span style="color:#ae81ff"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; passwordDB LDAP &lt;span style="color:#ae81ff"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; registerDB LDAP &lt;span style="color:#ae81ff"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; ldapServer &lt;span style="color:#e6db74"&gt;&amp;#39;ldap://localhost&amp;#39;&lt;/span&gt; &lt;span style="color:#ae81ff"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; managerDn &lt;span style="color:#e6db74"&gt;&amp;#39;cn=admin,dc=example,dc=com&amp;#39;&lt;/span&gt; &lt;span style="color:#ae81ff"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; managerPassword &lt;span style="color:#e6db74"&gt;&amp;#39;MonSuperPassword&amp;#39;&lt;/span&gt; &lt;span style="color:#ae81ff"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; ldapBase &lt;span style="color:#e6db74"&gt;&amp;#39;ou=people,dc=example,dc=com&amp;#39;&lt;/span&gt; &lt;span style="color:#ae81ff"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;blockquote&gt;
&lt;ul&gt;
&lt;li&gt;Pour des raisons de praticité, le &lt;code&gt;managerDn&lt;/code&gt; utilisé est le compte admin de l'annuaire. Dans un contexte de production un autre compte sera utilisé.&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Afin d'avoir une vue synthétique de l'annuaire et obtenir les chemins complets pour la précédente commande, utiliser :&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;sudo slapcat | grep &lt;span style="color:#e6db74"&gt;&amp;#34;dn:&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Exporter les attributs souhaités :&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;sudo /usr/share/lemonldap-ng/bin/lemonldap-ng-cli -force &lt;span style="color:#ae81ff"&gt;1&lt;/span&gt; -yes &lt;span style="color:#ae81ff"&gt;1&lt;/span&gt; &lt;span style="color:#ae81ff"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; addKey &lt;span style="color:#ae81ff"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; ldapExportedVars uid uid &lt;span style="color:#ae81ff"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; ldapExportedVars cn cn &lt;span style="color:#ae81ff"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; ldapExportedVars sn sn &lt;span style="color:#ae81ff"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; ldapExportedVars mail mail &lt;span style="color:#ae81ff"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; ldapExportedVars givenName givenName
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Voici le retour attendu :&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Status : &lt;span style="color:#f92672"&gt;[&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#e6db74"&gt;&amp;#39;localhost&amp;#39;&lt;/span&gt; &lt;span style="color:#f92672"&gt;=&lt;/span&gt;&amp;gt; &lt;span style="color:#e6db74"&gt;&amp;#39;OK&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;]&lt;/span&gt;;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Redémarrer Apache2 :&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;sudo systemctl restart apache2
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;L'utilisateur &lt;code&gt;fd-admin&lt;/code&gt; peut maintenant s'authentifier, avec accès au manager, sur la plateforme : &lt;a href="http://auth.example.com"&gt;http://auth.example.com&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img data-recalc-dims="1" decoding="async" src="auth_fdadmin.png" alt="" /&gt;&lt;/p&gt;</description></item><item><title>Keycloak : Integration LDAP externe</title><link>https://beta.slash-root.fr/keycloak-integration-ldap-externe/</link><pubDate>Thu, 04 Nov 2021 17:33:31 +0100</pubDate><guid>https://beta.slash-root.fr/keycloak-integration-ldap-externe/</guid><description>&lt;img src="https://beta.slash-root.fr/keycloak-integration-ldap-externe/cover.png" alt="Featured image of post Keycloak : Integration LDAP externe" /&gt;&lt;h2 id="introduction"&gt;&lt;a href="#introduction" class="header-anchor"&gt;&lt;/a&gt;Introduction
&lt;/h2&gt;&lt;p&gt;La solution Keycloak est embarqué avec la possibilité de joindre un annuaire LDAP/AD. Il est possible de fédérer plusieurs serveurs d'annuaires au sein d'un même royaume keycloak. Les attributs utilisateurs de l'annuaire LDAP peuvent être mappé dans un model d'utilisateur keycloak. Par défaut, les attributs &lt;code&gt;username&lt;/code&gt;, &lt;code&gt;email&lt;/code&gt;, &lt;code&gt;first name&lt;/code&gt;, &lt;code&gt;last name&lt;/code&gt; sont mappés mais d'autres attributs peuvent l'être également.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Cet article fait suite à :&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://beta.slash-root.fr/2021/10/25/keycloak-installation-avec-docker-et-reverse-proxy-ssl-nginx/"&gt;Keycloak : Installation avec Docker et reverse-proxy SSL Nginx&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://beta.slash-root.fr/2021/11/04/openldap-installation-avec-fusiondirectory/"&gt;OpenLDAP : Installation avec FusionDirectory&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;
&lt;h2 id="prérequis"&gt;&lt;a href="#pr%c3%a9requis" class="header-anchor"&gt;&lt;/a&gt;Prérequis
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;Un serveur Keycloak fonctionnel&lt;/li&gt;
&lt;li&gt;Un serveur OpenLDAP/FusionDirectory fonctionnel&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote&gt;
&lt;p&gt;Toute la procédure fera référence aux configuration déployées dans les articles cités en introduction.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2 id="configuration"&gt;&lt;a href="#configuration" class="header-anchor"&gt;&lt;/a&gt;Configuration
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Se rendre sur la WebUI du serveur Keycloak : &lt;a href="https://keycloak.example.com"&gt;https://keycloak.example.com&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Se rendre dans la partie &lt;code&gt;User Federation&lt;/code&gt; et ajouter &lt;code&gt;ldap&lt;/code&gt; en provider :&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img data-recalc-dims="1" decoding="async" src="user_fede.png" alt="" /&gt;&lt;/p&gt;
&lt;h3 id="paramétrage---1ère-partie"&gt;&lt;a href="#param%c3%a9trage---1%c3%a8re-partie" class="header-anchor"&gt;&lt;/a&gt;Paramétrage - 1ère partie
&lt;/h3&gt;&lt;p&gt;&lt;img data-recalc-dims="1" decoding="async" src="fed1.png" alt="" /&gt;&lt;/p&gt;
&lt;h4 id="stockage"&gt;&lt;a href="#stockage" class="header-anchor"&gt;&lt;/a&gt;Stockage
&lt;/h4&gt;&lt;p&gt;Par défaut, Keycloak importe les utilisateurs de l'annuaire LDAP dans sa base locale d'utilisateurs. Cette copie des utilisateurs peut être synchronisée soit manuellement soit automatiquement toutes les x minutes par exemple. Seul les mots de passes ne sont pas synchronisés. Dans le processus d'identification de l'utilisateur, la validation du mot de passe est délégué au serveur LDAP. L'avantage de cette approche est que toutes les fonctionnalités de Keycloak fonctionneront avec des attributs utilisateurs supplémentaires qui sont stockés localement sur Keycloak. Cela permet également de réduire la charge sur le serveur LDAP.&lt;/p&gt;
&lt;p&gt;Il est possible de ne pas importer les utilisateurs de l'annuaire LDAP dans Keycloak en décochant &lt;code&gt;Import Users&lt;/code&gt;. Cela aura pour effet d'augmenter les requêtes vers le serveur LDAP car aucune information utilisateur ne sera stockée localement sur Keycloak. L'autre conséquence de ce choix est que si une fonctionnalité de Keycloak repose sur une partie non supporté par l'annuaire LDAP, celle-ci ne fonctionnera pas. En revanche, l'avantage est de ne pas avoir à gérer la synchronisation des comptes.&lt;/p&gt;
&lt;h4 id="edition"&gt;&lt;a href="#edition" class="header-anchor"&gt;&lt;/a&gt;Edition
&lt;/h4&gt;&lt;p&gt;L'&lt;code&gt;Edit Mode&lt;/code&gt; permet aux utilisateurs et aux administrateurs, à travers leurs consoles respectives sur Keycloak, de modifier les metadas utilisateur.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;READONLY&lt;/code&gt; : Les attributs utilisateurs resteront inchangés. Une erreur apparaitra si une modification d'attribut est faites. Cela est également valable pour la modification d'un mot de passe utilisateur.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;WRITABLE&lt;/code&gt; : Tous les attributs utilisateurs modifiés seront synchronisés automatiquement avec l'annuaire LDAP.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;UNSYNCED&lt;/code&gt; : Tous les changements d'attributs seront stockés localement dans la base de Keycloak. La synchronisation des modifications au sein de Keycloak vers l'annuaire LDAP devra être faites manuellement.&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id="vendor"&gt;&lt;a href="#vendor" class="header-anchor"&gt;&lt;/a&gt;Vendor
&lt;/h4&gt;&lt;p&gt;Plusieurs choix sont possibles suivant le type d'annuaire LDAP en face :&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Active Directory&lt;/li&gt;
&lt;li&gt;Red Hat Directory Server&lt;/li&gt;
&lt;li&gt;Tivoli&lt;/li&gt;
&lt;li&gt;Novell eDirectory&lt;/li&gt;
&lt;li&gt;Other&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;L'annuaire installé étant OpenLDAP, &lt;code&gt;other&lt;/code&gt; est le choix à faire.&lt;/p&gt;
&lt;h3 id="paramétrage---2nd-partie"&gt;&lt;a href="#param%c3%a9trage---2nd-partie" class="header-anchor"&gt;&lt;/a&gt;Paramétrage - 2nd partie
&lt;/h3&gt;&lt;p&gt;&lt;img data-recalc-dims="1" decoding="async" src="fed2.png" alt="" /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;Connection URL&lt;/code&gt; : Indiquer le chemin d'accès au serveur LDAP&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Users DN&lt;/code&gt; : Indiquer le chemin d'accès aux utilisateurs dans l'annuaire.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Bind DN&lt;/code&gt; : Indiquer un compte dans l'annuaire ayant des droits d'écriture.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Bind Credential&lt;/code&gt; : Le mot de passe du compte spécifié dans &amp;quot;Bind DN&amp;quot;.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="synchronisation"&gt;&lt;a href="#synchronisation" class="header-anchor"&gt;&lt;/a&gt;Synchronisation
&lt;/h3&gt;&lt;p&gt;Un peu plus bas de la page de configuration de la connexion au serveur LDAP, un menu &lt;code&gt;Sync Settings&lt;/code&gt; est disponible :&lt;/p&gt;
&lt;p&gt;&lt;img data-recalc-dims="1" decoding="async" src="sync_set.png" alt="" /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;Batch Size&lt;/code&gt; : Le nombre de compte utilisateurs qui seront traités en une synchronisation.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Periodic Full Sync&lt;/code&gt; : La planification en secondes de la synchronisation totale / complète.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Periodic Changed Users Sync&lt;/code&gt; : La planification en secondes de la synchronisation des changements apportés aux attributs utilisateurs.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Après avoir sauvegarder tous les paramètres, il est possible de déclencher manuellement une première synchronisation des utilisateurs de l'annuaire LDAP dans Keycloak :&lt;/p&gt;
&lt;p&gt;&lt;img data-recalc-dims="1" decoding="async" src="sync_manuel.png" alt="" /&gt;&lt;/p&gt;
&lt;h3 id="mappers"&gt;&lt;a href="#mappers" class="header-anchor"&gt;&lt;/a&gt;Mappers
&lt;/h3&gt;&lt;p&gt;Par défaut, des &lt;code&gt;Mappers&lt;/code&gt; sont mis en place. Un mapper va permettre de mapper un attribut utilisateur de l'annuaire LDAP à un attribut utilisateur de Keycloak :&lt;/p&gt;
&lt;p&gt;&lt;img data-recalc-dims="1" decoding="async" src="mappers.png" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;Dans mes différents essais, en déployant cette solution de SSO avec un OpenLDAP, il est apparu que l'attribut &lt;code&gt;firstName&lt;/code&gt; de Keycloak est mappé avec l'attribut &lt;code&gt;cn&lt;/code&gt; de l'annuaire LDAP. L'attribut &lt;code&gt;cn&lt;/code&gt; dans l'annuaire (avec la couche FusionDirectory) est une concaténation du prénom et du nom de l'utilisateur :&lt;/p&gt;
&lt;p&gt;&lt;img data-recalc-dims="1" decoding="async" src="cn_ldap.png" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;Au lieu de modifier la configuration de l'annuaire LDAP, modifier le mapper &lt;code&gt;first name&lt;/code&gt; dans Keycloak :&lt;/p&gt;
&lt;p&gt;&lt;img data-recalc-dims="1" decoding="async" src="first_name.png" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;Modifier &lt;code&gt;LDAP Attribute&lt;/code&gt; pour indiquer &lt;code&gt;givenName&lt;/code&gt;.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;givenName&lt;/code&gt; est le nom de l'attribut prénom au sein de l'annuaire LDAP dans notre configuration.&lt;/p&gt;
&lt;/blockquote&gt;</description></item><item><title>OpenProject : Mise en place du SSO avec Keycloak</title><link>https://beta.slash-root.fr/openproject-mise-en-place-du-sso-avec-keycloak/</link><pubDate>Thu, 28 Oct 2021 14:40:22 +0200</pubDate><guid>https://beta.slash-root.fr/openproject-mise-en-place-du-sso-avec-keycloak/</guid><description>&lt;img src="https://beta.slash-root.fr/openproject-mise-en-place-du-sso-avec-keycloak/cover.jpg" alt="Featured image of post OpenProject : Mise en place du SSO avec Keycloak" /&gt;&lt;h2 id="introduction"&gt;&lt;a href="#introduction" class="header-anchor"&gt;&lt;/a&gt;Introduction
&lt;/h2&gt;&lt;p&gt;Par défaut, OpenProject utilise une base locale d'utilisateurs pour gérer l'authentification. Afin de centraliser l'authentification sur un serveur dédié (avec OpenID-Connect) Keycloak, une configuration SSO est nécessaire sur OpenProject.&lt;/p&gt;
&lt;p&gt;OpenProject va utiliser OpenID-Connect pour faire du SSO. Ca tombe bien Keycloak aussi ! Un paramétrage concernant cela est disponible via la web UI d'administration d'OpenProject mais celle-ci ne concerne que Google et Azure. Fort heureusement, c'est tout de même possible en éditant un fichier.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Référence :&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://beta.slash-root.fr/2021/10/20/installation-openproject/"&gt;OpenProject : Installation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://beta.slash-root.fr/2021/10/25/keycloak-installation-avec-docker-et-reverse-proxy-ssl-nginx/"&gt;Keycloak : Installation avec Docker et reverse-proxy SSL Nginx&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;
&lt;h2 id="pré-requis"&gt;&lt;a href="#pr%c3%a9-requis" class="header-anchor"&gt;&lt;/a&gt;Pré-requis
&lt;/h2&gt;&lt;p&gt;Pour mener à bien cette procédure, il faut :&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Un serveur OpenProject installé avec une licence &lt;strong&gt;Entreprise&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Un serveur Keycloak installé&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote&gt;
&lt;p&gt;Pour la licence OpenProject Entreprise, il est possible de faire un essai de 14 jours gratuitement. Sans licence Entreprise, le SSO n'est pas pris en charge par OpenProject. Lorsque l'essai de la version Entreprise arrive à son terme et que celle-ci n'est pas prolongé, alors la licence repasse automatique en Community Edition (Free).&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2 id="configuration-partie-keycloak"&gt;&lt;a href="#configuration-partie-keycloak" class="header-anchor"&gt;&lt;/a&gt;Configuration partie Keycloak
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;Création d'un royaume :&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img data-recalc-dims="1" decoding="async" src="add_realm.png" alt="" /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Création d'un client :&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img data-recalc-dims="1" decoding="async" src="add_client.png" alt="" /&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;Root URL&lt;/code&gt; : L'URL d'accès au serveur OpenProject.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;ul&gt;
&lt;li&gt;Dans les propriétés du client nouvellement créer, définir l' &lt;code&gt;Access Type&lt;/code&gt; sur &lt;code&gt;confidential&lt;/code&gt; afin de générer un secret :&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img data-recalc-dims="1" decoding="async" src="confidential.png" alt="" /&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Bien penser à sauvegarder la modification en bas de la page.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;ul&gt;
&lt;li&gt;Un nouvel onglet &lt;code&gt;Credentials&lt;/code&gt; est apparu dans les propriétés du client. Un secret a été généré :&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img data-recalc-dims="1" decoding="async" src="secret.png" alt="" /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Créer un compte utilisateur si le serveur Keycloak est fraichement installé :&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img data-recalc-dims="1" decoding="async" src="add_user.png" alt="" /&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Attention : Sur l'illustration, seul le champ &lt;code&gt;Username&lt;/code&gt; est indiqué comme obligatoire. Lorsque qu'un utilisateur s'authentifiera avec son compte Keycloak sur OpenProject, les champs &lt;code&gt;Email&lt;/code&gt; , &lt;code&gt;First Name&lt;/code&gt; , &lt;code&gt;Last Name&lt;/code&gt; seront obligatoires. Ces propriétés ne peuvent en cas cas être communes à un autre compte.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;ul&gt;
&lt;li&gt;Une fois l'utilisateur créé, dans l'onglet &lt;code&gt;Credentials&lt;/code&gt; , définir son mot de passe :&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img data-recalc-dims="1" decoding="async" src="password-1.png" alt="" /&gt;&lt;/p&gt;
&lt;h2 id="configuration-partie-openproject"&gt;&lt;a href="#configuration-partie-openproject" class="header-anchor"&gt;&lt;/a&gt;Configuration partie OpenProject
&lt;/h2&gt;&lt;p&gt;Pour qu'un utilisateur puisse utiliser son compte Keycloak pour s'authentifier sur OpenProject, celui-ci doit être activé dans OpenProject. Par défaut l'activation se fait manuellement. Pour automatiser ce processus, une option d' &lt;code&gt;activation automatique du compte&lt;/code&gt; existe dans OpenProject.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Se connecter en admin sur OpenProject puis &amp;quot;Administration -&amp;gt; Authentification&amp;quot;, modifier l'option &lt;code&gt;Auto-enregistrement&lt;/code&gt; comme suit :&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img data-recalc-dims="1" decoding="async" src="activation_auto.png" alt="" /&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Pour la suite des opérations, se connecter en SSH sur le serveur OpenProject.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;ul&gt;
&lt;li&gt;Modifier le fichier &lt;code&gt;/opt/openproject/config/configuration.yml&lt;/code&gt; afin d'ajouter la possibilité de s'authentifier sur OpenProject au travers du serveur SSO Keycloak. Ajouter les lignes suivantes dans la section &lt;code&gt;default&lt;/code&gt; :&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-php" data-lang="php"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#66d9ef"&gt;default&lt;/span&gt;&lt;span style="color:#f92672"&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;# omniauth_direct_login_provider: openid
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#a6e22e"&gt;openid_connect&lt;/span&gt;&lt;span style="color:#f92672"&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#a6e22e"&gt;openid&lt;/span&gt;&lt;span style="color:#f92672"&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#a6e22e"&gt;host&lt;/span&gt;&lt;span style="color:#f92672"&gt;:&lt;/span&gt; &lt;span style="color:#e6db74"&gt;&amp;#34;keycloak.example.fr&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#a6e22e"&gt;identifier&lt;/span&gt;&lt;span style="color:#f92672"&gt;:&lt;/span&gt; &lt;span style="color:#e6db74"&gt;&amp;#34;MonOpenProject&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#a6e22e"&gt;secret&lt;/span&gt;&lt;span style="color:#f92672"&gt;:&lt;/span&gt; &lt;span style="color:#e6db74"&gt;&amp;#34;af90aced-0000-0000-0000-0959e6fd5226&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#a6e22e"&gt;icon&lt;/span&gt;&lt;span style="color:#f92672"&gt;:&lt;/span&gt; &lt;span style="color:#e6db74"&gt;&amp;#34;openid_connect/auth_provider-google.png&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#a6e22e"&gt;display_name&lt;/span&gt;&lt;span style="color:#f92672"&gt;:&lt;/span&gt; &lt;span style="color:#e6db74"&gt;&amp;#34;SSO&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#a6e22e"&gt;authorization_endpoint&lt;/span&gt;&lt;span style="color:#f92672"&gt;:&lt;/span&gt; &lt;span style="color:#e6db74"&gt;&amp;#34;https://keycloak.example.fr/auth/realms/MonRoyaume/protocol/openid-connect/auth&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#a6e22e"&gt;token_endpoint&lt;/span&gt;&lt;span style="color:#f92672"&gt;:&lt;/span&gt; &lt;span style="color:#e6db74"&gt;&amp;#39;https://keycloak.example.fr/auth/realms/MonRoyaume/protocol/openid-connect/token&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#a6e22e"&gt;userinfo_endpoint&lt;/span&gt;&lt;span style="color:#f92672"&gt;:&lt;/span&gt; &lt;span style="color:#e6db74"&gt;&amp;#39;https://keycloak.example.fr/auth/realms/MonRoyaume/protocol/openid-connect/userinfo&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#a6e22e"&gt;end_session_endpoint&lt;/span&gt;&lt;span style="color:#f92672"&gt;:&lt;/span&gt; &lt;span style="color:#e6db74"&gt;&amp;#39;https://keycloak.example.fr/auth/realms/MonRoyaume/protocol/openid-connect/logout&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#a6e22e"&gt;check_session_iframe&lt;/span&gt;&lt;span style="color:#f92672"&gt;:&lt;/span&gt; &lt;span style="color:#e6db74"&gt;&amp;#39;https://keycloak.example.fr/auth/realms/MonRoyaume/protocol/openid-connect/login-status-iframe.html&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#a6e22e"&gt;sso&lt;/span&gt;&lt;span style="color:#f92672"&gt;:&lt;/span&gt; &lt;span style="color:#66d9ef"&gt;true&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#a6e22e"&gt;issuer&lt;/span&gt;&lt;span style="color:#f92672"&gt;:&lt;/span&gt; &lt;span style="color:#e6db74"&gt;&amp;#39;https://keycloak.example.fr/auth/realms/MonRoyaume&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#a6e22e"&gt;discovery&lt;/span&gt;&lt;span style="color:#f92672"&gt;:&lt;/span&gt; &lt;span style="color:#66d9ef"&gt;false&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Adapter les valeurs suivantes :&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-php" data-lang="php"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#a6e22e"&gt;host&lt;/span&gt; &lt;span style="color:#f92672"&gt;:&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;Le&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;FQDN&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;du&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;serveur&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;Keycloak&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#a6e22e"&gt;identifier&lt;/span&gt; &lt;span style="color:#f92672"&gt;:&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;Le&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;nom&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;du&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;client&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;créé&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;dans&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;Keycloak&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#a6e22e"&gt;secret&lt;/span&gt; &lt;span style="color:#f92672"&gt;:&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;Le&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;secret&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;du&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;client&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;généré&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;dans&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;Keycloak&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;# Les URLS suivantes peuvent facilement être obtenues dans Keycloak
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;# Realm Settings -&amp;gt; Endpoints : OpenIP Endpoint Configuration
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#a6e22e"&gt;authorization_endpoint&lt;/span&gt;&lt;span style="color:#f92672"&gt;:&lt;/span&gt; &lt;span style="color:#e6db74"&gt;&amp;#34;https://keycloak.example.fr/auth/realms/MonRoyaume/protocol/openid-connect/auth&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#a6e22e"&gt;token_endpoint&lt;/span&gt;&lt;span style="color:#f92672"&gt;:&lt;/span&gt; &lt;span style="color:#e6db74"&gt;&amp;#39;https://keycloak.example.fr/auth/realms/MonRoyaume/protocol/openid-connect/token&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#a6e22e"&gt;userinfo_endpoint&lt;/span&gt;&lt;span style="color:#f92672"&gt;:&lt;/span&gt; &lt;span style="color:#e6db74"&gt;&amp;#39;https://keycloak.example.fr/auth/realms/MonRoyaume/protocol/openid-connect/userinfo&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#a6e22e"&gt;end_session_endpoint&lt;/span&gt;&lt;span style="color:#f92672"&gt;:&lt;/span&gt; &lt;span style="color:#e6db74"&gt;&amp;#39;https://keycloak.example.fr/auth/realms/MonRoyaume/protocol/openid-connect/logout&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#a6e22e"&gt;check_session_iframe&lt;/span&gt;&lt;span style="color:#f92672"&gt;:&lt;/span&gt; &lt;span style="color:#e6db74"&gt;&amp;#39;https://keycloak.example.fr/auth/realms/MonRoyaume/protocol/openid-connect/login-status-iframe.html&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#a6e22e"&gt;issuer&lt;/span&gt;&lt;span style="color:#f92672"&gt;:&lt;/span&gt; &lt;span style="color:#e6db74"&gt;&amp;#39;https://keycloak.example.fr/auth/realms/MonRoyaume&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;blockquote&gt;
&lt;p&gt;La directive &lt;code&gt;omniauth_direct_login_provider&lt;/code&gt; indique que seul l'authentification passera par keycloak. Commenter cette directive pour avoir le choix d'authentification entre keycloak (SSO) ou la base locale d'OpenProject.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;ul&gt;
&lt;li&gt;OpenProject : Redémarrer le service openproject&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;sudo systemctl restart openproject
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="vérification-du-fonctionnement"&gt;&lt;a href="#v%c3%a9rification-du-fonctionnement" class="header-anchor"&gt;&lt;/a&gt;Vérification du fonctionnement
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;Dorénavant lors de la connexion sur OpenProject, une option de connexion SSO est disponible :&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img data-recalc-dims="1" decoding="async" src="sso.png" alt="" /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Le serveur Keycloak prends le relais pour demander les credentials :&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img data-recalc-dims="1" decoding="async" src="sso_keycloak.png" alt="" /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Après la 1ère connexion d'un utilisateur au travers du SSO, celui-ci est présent dans OpenProject avec un fournisseur d'authentification &lt;code&gt;OpenID&lt;/code&gt; :&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img data-recalc-dims="1" decoding="async" src="openid.png" alt="" /&gt;&lt;/p&gt;</description></item><item><title>Keycloak : Installation avec Docker et reverse-proxy SSL Nginx</title><link>https://beta.slash-root.fr/keycloak-installation-avec-docker-et-reverse-proxy-ssl-nginx/</link><pubDate>Mon, 25 Oct 2021 17:37:16 +0200</pubDate><guid>https://beta.slash-root.fr/keycloak-installation-avec-docker-et-reverse-proxy-ssl-nginx/</guid><description>&lt;img src="https://beta.slash-root.fr/keycloak-installation-avec-docker-et-reverse-proxy-ssl-nginx/cover.png" alt="Featured image of post Keycloak : Installation avec Docker et reverse-proxy SSL Nginx" /&gt;&lt;h2 id="introduction"&gt;&lt;a href="#introduction" class="header-anchor"&gt;&lt;/a&gt;Introduction
&lt;/h2&gt;&lt;p&gt;Keycloak est une solution opensource permettant d'implémenter du SSO (Single-Sign-On) au sein d'une infrastructure. Il est compatible avec les principaux protocoles d'authentification (OAuth2.0, OpenID-Connect). Il peut être couplé à un annuaire LDAP.&lt;/p&gt;
&lt;p&gt;Dans cet article, Keycloak, va être déployé sur une Debian 10 conteneurisé dans 2 images dockers. Docker-Compose va orchestrer le tout. Un serveur nginx sera en frontal en tant que reverse-proxy.&lt;/p&gt;
&lt;h2 id="prérequis"&gt;&lt;a href="#pr%c3%a9requis" class="header-anchor"&gt;&lt;/a&gt;Prérequis
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;1 serveur Debian 10 à jour qui sera dédié à hébergé le serveur Keycloack&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;1 serveur web Nginx opérationnel&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Certificats SSL générés pour votre nom de domaine&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Voir article : &lt;a href="https://beta.slash-root.fr/2021/10/15/nginx-ajouter-un-certificat-ssl-lets-encrypt-pour-passer-en-https/"&gt;Nginx : Ajouter un certificat SSL Let’s Encrypt pour passer en HTTPS&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="installation"&gt;&lt;a href="#installation" class="header-anchor"&gt;&lt;/a&gt;Installation
&lt;/h2&gt;&lt;h3 id="installation-des-paquets"&gt;&lt;a href="#installation-des-paquets" class="header-anchor"&gt;&lt;/a&gt;Installation des paquets
&lt;/h3&gt;&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Installer docker :&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;sudo apt install docker
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Installer docker-compose :&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;sudo apt install docker-compose
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Vérifier l'installation de docker-compose :&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;docker-compose --version
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="création-du-docker-compose"&gt;&lt;a href="#cr%c3%a9ation-du-docker-compose" class="header-anchor"&gt;&lt;/a&gt;Création du docker-compose
&lt;/h3&gt;&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Créer un répertoire afin d'y stocker le fichier docker-compose :&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;sudo mkdir keycloak
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Se positionner dans le répertoire nouvellement créé :&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;cd keycloak
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Créer un fichier &lt;code&gt;docker-compose.yml&lt;/code&gt; :&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;sudo vi docker-compose.yml
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote&gt;
&lt;p&gt;Attention, le fichier doit être au format &lt;code&gt;YAML&lt;/code&gt; ce qui signifie que la tabulation est interdite (il faut mettre des espaces pour l'indentation).&lt;/p&gt;
&lt;/blockquote&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Copier / Coller le fichier suivant :&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-yaml" data-lang="yaml"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;version&lt;/span&gt;: &lt;span style="color:#e6db74"&gt;&amp;#39;3.3&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;volumes&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;postgres_data&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;driver&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;local&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;services&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;postgres&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;image&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;postgres&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;volumes&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; - &lt;span style="color:#ae81ff"&gt;postgres_data:/var/lib/postgresql/data&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;environment&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;POSTGRES_DB&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;keycloak&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;POSTGRES_USER&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;keycloak&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;POSTGRES_PASSWORD&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;password&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;keycloak&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;image&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;jboss/keycloak:latest&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;environment&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;PROXY_ADDRESS_FORWARDING&lt;/span&gt;: &lt;span style="color:#e6db74"&gt;&amp;#39;true&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;DB_VENDOR&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;POSTGRES&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;DB_ADDR&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;postgres&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;DB_DATABASE&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;keycloak&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;DB_USER&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;keycloak&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;DB_PASSWORD&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;password&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;KEYCLOAK_USER&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;admin&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;KEYCLOAK_PASSWORD&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;Mon_mot_de_passe&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;ports&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; - &lt;span style="color:#ae81ff"&gt;9090&lt;/span&gt;:&lt;span style="color:#ae81ff"&gt;8080&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;depends_on&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; - &lt;span style="color:#ae81ff"&gt;postgres&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;blockquote&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Le numéro de version indiqué en 1ère ligne peut varier suivant votre version de docker-compose. Dans mon cas, j'ai une version de docker-compose en 1.21.0.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Le port de keycloak dans le conteneur est le 8080, il sera bind sur le 9090 du serveur.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;La directive &lt;code&gt;PROXY_ADDRESS_FORWARDING&lt;/code&gt; est très importante dans le cas d'une utilisation de reverse proxy.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="lancement-du-docker-compose"&gt;&lt;a href="#lancement-du-docker-compose" class="header-anchor"&gt;&lt;/a&gt;Lancement du docker-compose
&lt;/h3&gt;&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Exécuter le docker-compose :&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;sudo docker-compose -f ~/keycloak/docker-compose.yml up
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Pour lancer le docker-compose en arrière-plan :&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;sudo docker-compose -f ~/keycloak/docker-compose.yml up -d
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Vérifier que les conteneurs docker soient bien démarrés :&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;sudo docker ps
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Le résultat soit être similaire à :&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;643f26101b75 jboss/keycloak:latest &lt;span style="color:#e6db74"&gt;&amp;#34;/opt/jboss/tools/do…&amp;#34;&lt;/span&gt; About a minute ago Up &lt;span style="color:#ae81ff"&gt;52&lt;/span&gt; seconds 8443/tcp, 0.0.0.0:9090-&amp;gt;8080/tcp keycloak_keycloak_1
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;6789a8285283 postgres &lt;span style="color:#e6db74"&gt;&amp;#34;docker-entrypoint.s…&amp;#34;&lt;/span&gt; About a minute ago Up &lt;span style="color:#ae81ff"&gt;52&lt;/span&gt; seconds 5432/tcp keycloak_postgres_1
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="configuration-reverse-proxy-ssl-avec-nginx"&gt;&lt;a href="#configuration-reverse-proxy-ssl-avec-nginx" class="header-anchor"&gt;&lt;/a&gt;Configuration reverse-proxy SSL avec Nginx
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Un serveur Nginx doit être opérationnel.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;S'appuyer sur cet article : &lt;a href="https://beta.slash-root.fr/2021/10/15/nginx-installation-dun-reverse-proxy/"&gt;Nginx : Installation d’un Reverse Proxy&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Les certificats SSl doivent être générés.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;S'appuyer sur cet article : &lt;a href="https://beta.slash-root.fr/2021/10/15/nginx-ajouter-un-certificat-ssl-lets-encrypt-pour-passer-en-https/"&gt;Nginx : Ajouter un certificat SSL Let’s Encrypt pour passer en HTTPS&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Créer le fichier de configuration du virtual host :&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;sudo vi /etc/nginx/sites-available/keycloak.conf
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Copier / Coller le fichier suivant :&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-nginx" data-lang="nginx"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#66d9ef"&gt;server&lt;/span&gt; {
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;listen&lt;/span&gt; &lt;span style="color:#ae81ff"&gt;80&lt;/span&gt;;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;server_name&lt;/span&gt; &lt;span style="color:#e6db74"&gt;keycloak.example.com&lt;/span&gt;;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;rewrite&lt;/span&gt; &lt;span style="color:#e6db74"&gt;^&lt;/span&gt; &lt;span style="color:#e6db74"&gt;https://keycloak.example.com&lt;/span&gt; &lt;span style="color:#e6db74"&gt;permanent&lt;/span&gt;;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;}
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#66d9ef"&gt;server&lt;/span&gt; {
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;listen&lt;/span&gt; &lt;span style="color:#ae81ff"&gt;443&lt;/span&gt; &lt;span style="color:#e6db74"&gt;ssl&lt;/span&gt;;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;server_name&lt;/span&gt; &lt;span style="color:#e6db74"&gt;keycloak.example.com&lt;/span&gt;;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;ssl_certificate&lt;/span&gt; &lt;span style="color:#e6db74"&gt;/etc/letsencrypt/live/keycloak.example.com/fullchain.pem&lt;/span&gt;;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;ssl_certificate_key&lt;/span&gt; &lt;span style="color:#e6db74"&gt;/etc/letsencrypt/live/keycloak.example.com/privkey.pem&lt;/span&gt;;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;ssl_session_cache&lt;/span&gt; builtin:&lt;span style="color:#ae81ff"&gt;1000&lt;/span&gt; &lt;span style="color:#e6db74"&gt;shared:SSL:10m&lt;/span&gt;;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;ssl_protocols&lt;/span&gt; &lt;span style="color:#e6db74"&gt;TLSv1&lt;/span&gt; &lt;span style="color:#e6db74"&gt;TLSv1.1&lt;/span&gt; &lt;span style="color:#e6db74"&gt;TLSv1.2&lt;/span&gt; &lt;span style="color:#e6db74"&gt;TLSv1.3&lt;/span&gt;;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;ssl_ciphers&lt;/span&gt; &lt;span style="color:#e6db74"&gt;HIGH:!aNULL:!eNULL:!EXPORT:!CAMELLIA:!DES:!MD5:!PSK:!RC4&lt;/span&gt;;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;ssl_prefer_server_ciphers&lt;/span&gt; &lt;span style="color:#66d9ef"&gt;on&lt;/span&gt;;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;location&lt;/span&gt; &lt;span style="color:#e6db74"&gt;/&lt;/span&gt; {
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;proxy_set_header&lt;/span&gt; &lt;span style="color:#e6db74"&gt;Host&lt;/span&gt; $host;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;proxy_set_header&lt;/span&gt; &lt;span style="color:#e6db74"&gt;X-Real-IP&lt;/span&gt; $remote_addr;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;proxy_set_header&lt;/span&gt; &lt;span style="color:#e6db74"&gt;X-Forwarded-For&lt;/span&gt; $proxy_add_x_forwarded_for;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;proxy_set_header&lt;/span&gt; &lt;span style="color:#e6db74"&gt;X-Forwarded-Proto&lt;/span&gt; $scheme;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;proxy_pass&lt;/span&gt; &lt;span style="color:#e6db74"&gt;http://IP_MON_SERVEUR_KEYCLOACK:9090&lt;/span&gt;;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; }
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;}
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;blockquote&gt;
&lt;ul&gt;
&lt;li&gt;Remplacer &lt;code&gt;keycloak.example.com&lt;/code&gt; par le nom de domaine pour le serveur keycloak. Le nécessaire doit être fait au sein de la zone DNS.&lt;/li&gt;
&lt;li&gt;Vérifier les chemins d'accès aux certificats SSL.&lt;/li&gt;
&lt;li&gt;Modifier la directive &lt;code&gt;proxy_pass&lt;/code&gt; pour correspondre avec le serveur keycloak.&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Créer un lien symbolique pour activer le virtual host :&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;sudo ln -s /etc/nginx/sites-available/keycloak.conf /etc/nginx/sites-enabled/keycloak.conf
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Vérifier la configuration de Nginx avec :&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;sudo nginx -t
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Redémarrer le service nginx :&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;sudo systemctl restart nginx
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="accès-administrateur-à-keycloak"&gt;&lt;a href="#acc%c3%a8s-administrateur-%c3%a0-keycloak" class="header-anchor"&gt;&lt;/a&gt;Accès administrateur à Keycloak
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Se rendre à l'adresse : &lt;a href="https://keycloak.example.com"&gt;https://keycloak.example.com&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;img data-recalc-dims="1" decoding="async" src="keycloak_homepage.png" alt="keycloak_homepage" /&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Accéder à &lt;code&gt;Administration Console&lt;/code&gt; :&lt;/p&gt;
&lt;p&gt;&lt;img data-recalc-dims="1" decoding="async" src="keycloak_admin.png" alt="keycloak_admin" /&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote&gt;
&lt;p&gt;Les credentials à entrer sont ceux définit dans le fichier &lt;code&gt;docker-compose.yml&lt;/code&gt; aux lignes suivantes :&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-yaml" data-lang="yaml"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;KEYCLOAK_USER&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;admin&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;KEYCLOAK_PASSWORD&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;Mon_mot_de_passe&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/blockquote&gt;
&lt;h2 id="démarrage-automatique-avec-le-système"&gt;&lt;a href="#d%c3%a9marrage-automatique-avec-le-syst%c3%a8me" class="header-anchor"&gt;&lt;/a&gt;Démarrage automatique avec le système
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Avec la configuration actuelle au redémarrage du serveur keycloak, le docker-compose ne sera pas lancé.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Pour activer le démarrage automatique des conteneurs Postegresql et Keycloak au boot du serveur, modifier le &lt;code&gt;docker-compose.yml&lt;/code&gt; et ajouter cette ligne dans chaque &lt;code&gt;services&lt;/code&gt; qui doit démarrer avec le service docker :&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-yaml" data-lang="yaml"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;restart&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;always&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;blockquote&gt;
&lt;p&gt;Si les conteneurs sont arrêtés à la main, ils ne démarreront pas automatiquement. Docker comprend que c'est une action manuelle et que c'est l'état désiré.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Pour que cela soit fonctionnel, le service &lt;code&gt;docker.service&lt;/code&gt; doit être en status &lt;code&gt;enable&lt;/code&gt; :&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;sudo systemctl status docker.service
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Le résultat doit être le suivant :&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Loaded: loaded &lt;span style="color:#f92672"&gt;(&lt;/span&gt;/lib/systemd/system/docker.service; enabled; vendor preset: enabled&lt;span style="color:#f92672"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Si cela n'est pas le cas :&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;sudo systemctl enable docker.service
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;</description></item></channel></rss>