using KClientPasswordLogin
Hua Ying Ling
hyling at eos.ncsu.edu
Fri Apr 12 19:28:00 EDT 2002
I'm trying to login with KClientPasswordLogin to avoid showing the
Kerberos login dialog. When using KClientPasswordLogin to login before
calling KClientGetTicketForService or KClientGetAuthenticatorForService
I'll get a -50 error for KClientGetTicketForService and
KClientGetTicketForService. Everything works fine if I don't call
KClientPasswordLogin and login with the Kerberos dialog instead by
calling KClientGetTicketForService. Is there something I'm doing
wrong?(code below)
Thanks
~Hua Ying
// =============================================
char* kAFPServiceVersion = "V1.0";
char authent[MAX_KTXT_LEN];
unsigned long authlen;
KClientSessionInfo gKClientSession;
KClientPrincipal currentPrincipal;
char * user = "hyling";
char * service2 = "afpserver";
KClientNewClientSession(&gKClientSession);
KClientV4StringToPrincipal(user, ¤tPrincipal);
KClientSetClientPrincipal(gKClientSession, currentPrincipal);
error = KClientV4StringToPrincipal(service2, ¤tPrincipal);
error = KClientSetServerPrincipal(gKClientSession, currentPrincipal);
int authlen = MAX_KTXT_LEN;
// error = KClientPasswordLogin(gKClientSession, "mypasswd");
error = KClientGetTicketForService(gKClientSession, 0, (void
*)authent, (UInt32 *)&authlen);
error = KClientGetAuthenticatorForService( gKClientSession, 0,
kAFPServiceVersion, &authent, (UInt32 *)&authlen );
More information about the krbdev
mailing list