<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
    <title>Colas.Nahaboo.net - ldap</title>
    <subtitle>Colas Nahaboo personal site, with discussions about programming code, web and computing topics, surfing and SUPing, and various musings.</subtitle>
    <link rel="self" type="application/atom+xml" href="https://colas.nahaboo.net/tags/ldap/atom.xml"/>
    <link rel="alternate" type="text/html" href="https://colas.nahaboo.net"/>
    <generator uri="https://www.getzola.org/">Zola</generator>
    <updated>2007-05-24T00:00:00+00:00</updated>
    <id>https://colas.nahaboo.net/tags/ldap/atom.xml</id>
    <entry xml:lang="en">
        <title>LDAP TWiki authentication</title>
        <published>2007-05-24T00:00:00+00:00</published>
        <updated>2007-05-24T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://colas.nahaboo.net/code/ldap-twiki-authentication/"/>
        <id>https://colas.nahaboo.net/code/ldap-twiki-authentication/</id>
        
        <content type="html" xml:base="https://colas.nahaboo.net/code/ldap-twiki-authentication/">&lt;h2 id=&quot;principles&quot;&gt;Principles&lt;a class=&quot;zola-anchor&quot; href=&quot;#principles&quot; aria-label=&quot;Anchor link for: principles&quot;&gt;🔗&lt;&#x2F;a&gt;&lt;&#x2F;h2&gt;
&lt;p&gt;This is how we use LDAP auth with TWiki (Cairo) with Microsoft Active
Directory&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;We make TWiki use standard apache basic authentication (The
non-cookie, standard method). In this mode TWiki expects Apache to do
all the auth work, and then execute TWiki perl scripts with the user
login set into the environment variable &lt;code&gt;REMOTE_USER&lt;&#x2F;code&gt; by apache. Our
trick is to use a modified mod_ladp apache module that wil get the AD
login of the user, auth with AD&#x2F;LDAP with it, and then &lt;strong&gt;change&lt;&#x2F;strong&gt; the
&lt;code&gt;REMOTE_USER&lt;&#x2F;code&gt; variable from windows login to the wiki name that is
dynamically computed by fetching First Name and Last Name in LDAP, and
concatenating them after some cleaning (capitalization, removing on
non-letter chars)&lt;&#x2F;li&gt;
&lt;li&gt;every N hours (for us, 4) a shell script dumps all
the LDAP accounts, checks the one not yet declared as TWiki accounts,
and for them create them via a modified (to be used non-interactively,
and without declaring a password) version of the &lt;code&gt;register&lt;&#x2F;code&gt; TWiki perl
CGI script&lt;&#x2F;li&gt;
&lt;li&gt;This shell script keeps the list of all LDAP accounts as a
wiki page for reference, and mails the changes to an admin mailing list&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;implementation&quot;&gt;Implementation&lt;a class=&quot;zola-anchor&quot; href=&quot;#implementation&quot; aria-label=&quot;Anchor link for: implementation&quot;&gt;🔗&lt;&#x2F;a&gt;&lt;&#x2F;h2&gt;
&lt;h3 id=&quot;apache-module&quot;&gt;Apache module&lt;a class=&quot;zola-anchor&quot; href=&quot;#apache-module&quot; aria-label=&quot;Anchor link for: apache-module&quot;&gt;🔗&lt;&#x2F;a&gt;&lt;&#x2F;h3&gt;
&lt;p&gt;We are based on the v2.4.2 of
&lt;a rel=&quot;noopener external&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.muquit.com&#x2F;muquit&#x2F;software&#x2F;mod_auth_ldap&#x2F;mod_auth_ldap.html&quot;&gt;https:&#x2F;&#x2F;www.muquit.com&#x2F;muquit&#x2F;software&#x2F;mod_auth_ldap&#x2F;mod_auth_ldap.html&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;


&lt;a href=&quot;&#x2F;code&#x2F;ldap-twiki-authentication&#x2F;mod_auth_ldap.colas.tgz&quot;&gt;mod_auth_ldap.colas.tgz&lt;&#x2F;a&gt;

: The
whole module, modified&lt;&#x2F;li&gt;
&lt;li&gt;


&lt;a href=&quot;&#x2F;code&#x2F;ldap-twiki-authentication&#x2F;README.colas&quot;&gt;README.colas&lt;&#x2F;a&gt;

: The readme&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;the-modified-register-twiki-file&quot;&gt;The modified register TWiki file&lt;a class=&quot;zola-anchor&quot; href=&quot;#the-modified-register-twiki-file&quot; aria-label=&quot;Anchor link for: the-modified-register-twiki-file&quot;&gt;🔗&lt;&#x2F;a&gt;&lt;&#x2F;h3&gt;
&lt;p&gt;to be placed in the TWiki &lt;code&gt;bin&#x2F;&lt;&#x2F;code&gt; dir *



&lt;a href=&quot;&#x2F;code&#x2F;ldap-twiki-authentication&#x2F;register-ldap&quot;&gt;register-ldap&lt;&#x2F;a&gt;

: modified version of the
Cairo TWiki bin&#x2F;register script&lt;&#x2F;p&gt;
&lt;h3 id=&quot;the-offline-account-generation-scripts&quot;&gt;The offline account-generation scripts&lt;a class=&quot;zola-anchor&quot; href=&quot;#the-offline-account-generation-scripts&quot; aria-label=&quot;Anchor link for: the-offline-account-generation-scripts&quot;&gt;🔗&lt;&#x2F;a&gt;&lt;&#x2F;h3&gt;
&lt;ul&gt;
&lt;li&gt;


&lt;a href=&quot;&#x2F;code&#x2F;ldap-twiki-authentication&#x2F;README_scripts.txt&quot;&gt;README_scripts.txt&lt;&#x2F;a&gt;

: The README of scripts&lt;&#x2F;li&gt;
&lt;li&gt;


&lt;a href=&quot;&#x2F;code&#x2F;ldap-twiki-authentication&#x2F;ldap-ilog-update-wikinames&quot;&gt;ldap-ilog-update-wikinames&lt;&#x2F;a&gt;

: main script&lt;&#x2F;li&gt;
&lt;li&gt;


&lt;a href=&quot;&#x2F;code&#x2F;ldap-twiki-authentication&#x2F;ldap-ilog-dump-wikiname&quot;&gt;ldap-ilog-dump-wikiname&lt;&#x2F;a&gt;

: dump info for one account&lt;&#x2F;li&gt;
&lt;li&gt;


&lt;a href=&quot;&#x2F;code&#x2F;ldap-twiki-authentication&#x2F;wiki-register&quot;&gt;wiki-register&lt;&#x2F;a&gt;

: shell script calling the CGI register-ldap via wget&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;debug &#x2F; dev ones:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;


&lt;a href=&quot;&#x2F;code&#x2F;ldap-twiki-authentication&#x2F;wiki-register-all&quot;&gt;wiki-register-all&lt;&#x2F;a&gt;

: batch account creation&lt;&#x2F;li&gt;
&lt;li&gt;


&lt;a href=&quot;&#x2F;code&#x2F;ldap-twiki-authentication&#x2F;wiki-ldap-check-accounts&quot;&gt;wiki-ldap-check-accounts&lt;&#x2F;a&gt;

: one shot: clean all wiki pages accounts&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
</content>
        
    </entry>
</feed>
