directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject directory-kerby git commit: Make the credential cache optional for the TokenAuthLoginModule
Date Fri, 30 Jun 2017 09:08:39 GMT
Repository: directory-kerby
Updated Branches:
  refs/heads/trunk d1f1bcdd4 -> 6d0369932


Make the credential cache optional for the TokenAuthLoginModule


Project: http://git-wip-us.apache.org/repos/asf/directory-kerby/repo
Commit: http://git-wip-us.apache.org/repos/asf/directory-kerby/commit/6d036993
Tree: http://git-wip-us.apache.org/repos/asf/directory-kerby/tree/6d036993
Diff: http://git-wip-us.apache.org/repos/asf/directory-kerby/diff/6d036993

Branch: refs/heads/trunk
Commit: 6d03699326d30ba2bdcd708684537821cc979b4d
Parents: d1f1bcd
Author: Colm O hEigeartaigh <coheigea@apache.org>
Authored: Fri Jun 30 10:08:14 2017 +0100
Committer: Colm O hEigeartaigh <coheigea@apache.org>
Committed: Fri Jun 30 10:08:14 2017 +0100

----------------------------------------------------------------------
 .../kerb/client/jaas/TokenAuthLoginModule.java  | 27 +++++++++++---------
 1 file changed, 15 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/6d036993/kerby-kerb/kerb-client/src/main/java/org/apache/kerby/kerberos/kerb/client/jaas/TokenAuthLoginModule.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-client/src/main/java/org/apache/kerby/kerberos/kerb/client/jaas/TokenAuthLoginModule.java
b/kerby-kerb/kerb-client/src/main/java/org/apache/kerby/kerberos/kerb/client/jaas/TokenAuthLoginModule.java
index 4d81e3d..fef1ee5 100644
--- a/kerby-kerb/kerb-client/src/main/java/org/apache/kerby/kerberos/kerb/client/jaas/TokenAuthLoginModule.java
+++ b/kerby-kerb/kerb-client/src/main/java/org/apache/kerby/kerberos/kerb/client/jaas/TokenAuthLoginModule.java
@@ -234,8 +234,8 @@ public class TokenAuthLoginModule implements LoginModule {
         }
 
         if (cCache == null) {
-            throw new LoginException("A credential cache must be specified via the credentialCache"
-            + " configuration option");
+            LOG.info("No credential cache was specified via 'credentialCache'. "
+                     + "The TGT will be stored internally instead");
         }
 
         String error = "";
@@ -328,17 +328,20 @@ public class TokenAuthLoginModule implements LoginModule {
             return false;
         }
 
-        try {
-            cCache = makeTgtCache();
-        } catch (IOException e) {
-            LOG.error("Failed to make tgtCache. " + e.toString());
-        }
-        try {
-            if (krbClient != null) {
-                krbClient.storeTicket(tgtTicket, cCache);
+        // Write the TGT out to the credential cache if it is specified in the configuration
+        if (cCache != null) {
+            try {
+                cCache = makeTgtCache();
+            } catch (IOException e) {
+                LOG.error("Failed to make tgtCache. " + e.toString());
+            }
+            try {
+                if (krbClient != null) {
+                    krbClient.storeTicket(tgtTicket, cCache);
+                }
+            } catch (KrbException e) {
+                LOG.error("Failed to store tgtTicket to " + cCache.getName());
             }
-        } catch (KrbException e) {
-            LOG.error("Failed to store tgtTicket to " + cCache.getName());
         }
         return true;
     }


Mime
View raw message