1: <HTML>
2: <HEAD>
3: <TITLE>LON-CAPA Password authentication</TITLE>
4: </HEAD>
5: <BODY>
6: <H1>LON-CAPA Password authentication</H1>
7: <P>
8: Scott Harrison
9: </P>
10: <P>
11: Last updated: 02/15/2001
12: </P>
13: <P>
14: This file describes issues associated with authenticating
15: passwords on a LON-CAPA system.
16: </P>
17: <H3>Latest HOWTO</H3>
18: <P>
19: The following section of perl code illustrates the
20: different ways passwords can be evaluated.
21: </P>
22: <P>
23: <PRE>
24: my ($howpwd,$contentpwd)=split(/:/,$realpasswd);
25: my $pwdcorrect=0;
26: if ($howpwd eq 'internal') {
27: $pwdcorrect=
28: (crypt($upass,$contentpwd) eq $contentpwd);
29: } elsif ($howpwd eq 'unix') {
30: $contentpwd=(getpwnam($uname))[1];
31: $pwdcorrect=
32: (crypt($upass,$contentpwd) eq $contentpwd);
33: } elsif ($howpwd eq 'krb4') {
34: $pwdcorrect=(
35: Authen::Krb4::get_pw_in_tkt($uname,"",
36: $contentpwd,'krbtgt',$contentpwd,1,
37: $upass) == 0);
38: }
39: if ($pwdcorrect) {
40: print $client "authorized\n";
41: } else {
42: print $client "non_authorized\n";
43: }
44: </PRE>
45: </P>
46: </BODY>
47: </HTML>
48:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>