File:  [LON-CAPA] / doc / build / Attic / loncapapasswordauthentication.html
Revision 1.3: download - view: text, annotated - select for diffs
Thu Feb 15 15:58:38 2001 UTC (23 years, 3 months ago) by harris41
Branches: MAIN
CVS tags: HEAD
fixing the date of being last updated.. -Scott

<HTML>
<HEAD>
<TITLE>LON-CAPA Password authentication</TITLE>
</HEAD>
<BODY>
<H1>LON-CAPA Password authentication</H1>
<P>
Scott Harrison
</P>
<P>
Last updated: 02/15/2001
</P>
<P>
This file describes issues associated with authenticating
passwords on a LON-CAPA system.
</P>
<H3>Latest HOWTO</H3>
<P>
The following section of perl code illustrates the
different ways passwords can be evaluated.
</P>
<P>
<PRE>
                          my ($howpwd,$contentpwd)=split(/:/,$realpasswd);
                          my $pwdcorrect=0;
                          if ($howpwd eq 'internal') {
			      $pwdcorrect=
				  (crypt($upass,$contentpwd) eq $contentpwd);
                          } elsif ($howpwd eq 'unix') {
                              $contentpwd=(getpwnam($uname))[1];
                              $pwdcorrect=
                                  (crypt($upass,$contentpwd) eq $contentpwd);
                          } elsif ($howpwd eq 'krb4') {
                              $pwdcorrect=(
                                 Authen::Krb4::get_pw_in_tkt($uname,"",
                                        $contentpwd,'krbtgt',$contentpwd,1,
							     $upass) == 0);
                          }
                          if ($pwdcorrect) {
                             print $client "authorized\n";
                          } else {
                             print $client "non_authorized\n";
                          }  
</PRE>
</P>
</BODY>
</HTML>


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>