2 * Copyright 2000, International Business Machines Corporation and others.
5 * This software has been released under the terms of the IBM Public
6 * License. For details, see the LICENSE file in the top-level source
7 * directory or online at http://www.openafs.org/dl/license10.html
10 #include <afsconfig.h>
11 #include <afs/param.h>
14 #if defined(AFS_SGI_ENV)
19 #include <sys/types.h>
20 #include <sys/param.h>
21 #include <afs/kauth.h>
22 #include <afs/kautils.h>
24 extern char *ktc_tkt_string();
27 * authenticate with AFS
29 * 1 if read password but couldn't authenticate correctly via AFS
30 * 0 if authenticated via AFS correctly
33 afs_verify(char *uname, /* user name trying to log in */
34 char *pword, /* password */
35 afs_int32 * exp, /* expiration time */
42 * The basic model for logging in now, is that *if* there
43 * is a kerberos record for this individual user we will
44 * trust kerberos (provided the user really has an account
45 * locally.) If there is no kerberos record (or the password
46 * were typed incorrectly.) we would attempt to authenticate
47 * against the local password file entry. Naturally, if
48 * both fail we use existing failure code.
50 if (ka_UserAuthenticateGeneral(KA_USERAUTH_VERSION + KA_USERAUTH_DOSETPAG, uname, /* kerberos name */
54 0, /* default lifetime */
55 exp, /* spare 1/expiration */
57 &reason /* error string */
60 printf("Unable to authenticate to AFS because %s\n", reason);
61 printf("proceeding with local authentication...\n");
65 /* authenticated successfully */
70 afs_gettktstring(void)
72 return ktc_tkt_string();