diff -r -u auks-0.4.5/src/api/auks/auks_api.c auks-0.4.5-new/src/api/auks/auks_api.c
--- auks-0.4.5/src/api/auks/auks_api.c	2018-10-26 17:06:52.000000000 +0300
+++ auks-0.4.5-new/src/api/auks/auks_api.c	2020-08-22 23:06:13.604310512 +0300
@@ -92,6 +92,8 @@
 
 #include "auks/auks_api.h"
 
+#define AFS 1
+
 char*
 auks_api_version()
 {
@@ -695,6 +697,9 @@
 	auks_cred_t cred;
 
 	int loop = 1;
+#ifdef AFS
+	int afstatus = AUKS_SUCCESS;
+#endif
 
 	while ( loop == 1 ) {
 
@@ -716,16 +721,19 @@
 		if ( fstatus != AUKS_SUCCESS && 
 		     fstatus != AUKS_ERROR_CRED_STILL_VALID ) {
 			
-			auks_log3("%s's cred renew time test failed : %s",
+			auks_log2("%s's cred renew time test failed : %s",
 				  cred.info.principal,
 				  auks_strerror(fstatus));
 			loop=0;
 			goto end_loop;
 		}
 		else if ( fstatus == AUKS_ERROR_CRED_STILL_VALID ) {
-			auks_log3("%s's cred renew time test : %s",
+			auks_log2("%s's cred renew time test : %s",
 				  cred.info.principal,
 				  auks_strerror(fstatus));
+#ifdef AFS
+			afstatus = get_token();
+#endif
 			goto sleep;
 		}
 
@@ -733,7 +741,7 @@
 		/* call add function for the auks cred */
 		fstatus = auks_api_renew_auks_cred(engine,&cred,mode);
 		if ( fstatus == AUKS_SUCCESS )
-			auks_log3("auks cred renewed using %s",
+			auks_log2("auks cred renewed using %s",
 				  (cred_cache==NULL)?"default file":cred_cache);
 		else {
 			loop=0;
@@ -750,9 +758,12 @@
 			goto end_loop;
 		}
 		else {
-			auks_log3("auks cred successfully stored in file '%s'",
+			auks_log2("auks cred successfully stored in file '%s'",
 				  cred_cache);
 			fstatus = AUKS_SUCCESS;
+#ifdef AFS
+			afstatus = get_token();
+#endif
 		}
 
 	sleep:
@@ -770,6 +781,27 @@
 	return fstatus;
 }
 
+#ifdef AFS
+int
+get_token()
+{
+	char cmd[1024];
+	int s;
+
+	snprintf(cmd, 1024, "/usr/bin/aklog");
+/*
+	s = system(cmd);
+*/
+	s = system("/usr/bin/aklog");
+	if ( s == 0 )
+		auks_log2("successfully got AFS token");
+	else
+		auks_log2("error in /usr/bin/aklog: %d", s);
+	return s;
+		
+}
+#endif
+
 int
 auks_api_renew_auks_cred(auks_engine_t * engine,auks_cred_t* cred2r,int mode)
 {
@@ -780,7 +812,7 @@
 	fstatus = auks_api_get_auks_cred(engine,cred2r->info.uid,&cred);
 	if ( fstatus == AUKS_SUCCESS ) {
 		
-		auks_log3("%s's cred renewed using auksd with uid=%u",
+		auks_log2("%s's cred renewed using auksd with uid=%u",
 			  cred2r->info.principal,cred2r->info.uid);
 		
 		/* copy gotten cred into in/out one */
@@ -791,15 +823,15 @@
 	}
 	else {
 		
-		auks_log3("unable to get %s's cred from auksd using "
+		auks_log2("unable to get %s's cred from auksd using "
 			  "uid=%u : %s",cred2r->info.principal,
 			  cred2r->info.uid,auks_strerror(fstatus));
-		auks_log3("trying to renew %s's cred using Kerberos"
+		auks_log2("trying to renew %s's cred using Kerberos"
 			  " KDC",cred2r->info.principal);
 		
 		fstatus = auks_cred_renew(cred2r,1);
 		if ( fstatus == AUKS_SUCCESS )
-			auks_log3("%s's cred renewed using KDC",
+			auks_log2("%s's cred renewed using KDC",
 				  cred2r->info.principal,
 				  cred2r->info.uid);
 		
diff -r -u auks-0.4.5/src/api/auks/auks_api.h auks-0.4.5-new/src/api/auks/auks_api.h
--- auks-0.4.5/src/api/auks/auks_api.h	2018-10-26 17:06:52.000000000 +0300
+++ auks-0.4.5-new/src/api/auks/auks_api.h	2020-08-21 17:49:02.305105323 +0300
@@ -79,6 +79,8 @@
 #include "auks/auks_cred.h"
 #include "auks/auks_message.h"
 
+#define AFS	1
+
 #define AUKS_API_RENEW_ONCE    0
 #define AUKS_API_RENEW_LOOP    1
 
