version 1.1, 2008/07/29 17:35:12
|
version 1.2, 2016/08/20 17:48:12
|
Line 35 A common use of localauth.pm is to conne
|
Line 35 A common use of localauth.pm is to conne
|
\begin{quotation} |
\begin{quotation} |
\texttt{my (\$username,\$password) = @\_;} |
\texttt{my (\$username,\$password) = @\_;} |
|
|
\texttt{my \$ldap\_host\_name = ''; \# insert the host name of your |
\texttt{my \$ldap\_host\_name = `'; \# insert the host name of your |
ldap server, e.g., ldap.msu.edu} |
ldap server, e.g., ldap.msu.edu} |
|
|
\texttt{my \$ldap\_ca\_file\_name = ''; \# insert the ldap certificate |
\texttt{my \$ldap\_ca\_file\_name = `'; \# insert the ldap certificate |
filename - include absolute path} |
filename - include absolute path} |
|
|
\texttt{\# certificate is required if you wish to encrypt the password.} |
\texttt{\# certificate is required if you wish to encrypt the password.} |
|
|
\texttt{\# e.g., /home/http/perl/lib/local/ldap.certificate} |
\texttt{\# e.g., /home/http/perl/lib/local/ldap.certificate} |
|
|
\texttt{my \$ldap\_search\_base = ''; \# ldap search base, this might |
\texttt{my \$ldap\_search\_base = `'; \# ldap search base, this might |
be set to 'o=msu.edu'.} |
be set to `o=msu.edu'.} |
|
|
\texttt{my \$ldap = Net::LDAPS->new(} |
\texttt{my \$ldap = Net::LDAPS->new(} |
\begin{quotation} |
\begin{quotation} |
\texttt{\$ldap\_host\_name, } |
\texttt{\$ldap\_host\_name, } |
|
|
\texttt{verify => 'require', \# 'require' -> a certificate is needed, |
\texttt{verify => `require', \# `require' -> a certificate is needed, |
-> 'none' if no certificate used} |
-> `none' if no certificate used} |
|
|
\texttt{cafile => \$ldap\_ca\_file\_name,} |
\texttt{cafile => \$ldap\_ca\_file\_name,} |
\end{quotation} |
\end{quotation} |
Line 67 be set to 'o=msu.edu'.}
|
Line 67 be set to 'o=msu.edu'.}
|
|
|
\texttt{\$ldap->bind;} |
\texttt{\$ldap->bind;} |
|
|
\texttt{my \$search\_string = '(uid='.\$username.')';} |
\texttt{my \$search\_string = `(uid=``.\$username.'')';} |
|
|
\texttt{my \$mesg = \$ldap->search (} |
\texttt{my \$mesg = \$ldap->search (} |
\begin{quotation} |
\begin{quotation} |
Line 75 be set to 'o=msu.edu'.}
|
Line 75 be set to 'o=msu.edu'.}
|
|
|
\texttt{filter => \$search\_string,} |
\texttt{filter => \$search\_string,} |
|
|
\texttt{attrs => {[}'dn'] ,} |
\texttt{attrs => {[}`dn'] ,} |
\end{quotation} |
\end{quotation} |
\texttt{);} |
\texttt{);} |
|
|