directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yan...@apache.org
Subject [1/2] directory-kerby git commit: wip
Date Tue, 03 Nov 2015 12:36:47 GMT
Repository: directory-kerby
Updated Branches:
  refs/heads/master 6006704d8 -> ed6869936


wip


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

Branch: refs/heads/master
Commit: 812324651da8759b9d2959ce5679ff9b2dc887b3
Parents: 6006704
Author: yaningxu <yaning0123@gmail.com>
Authored: Tue Nov 3 16:50:42 2015 +0800
Committer: yaningxu <yaning0123@gmail.com>
Committed: Tue Nov 3 16:50:42 2015 +0800

----------------------------------------------------------------------
 .../org/apache/kerby/kerberos/tool/kinit/KinitTool.java   | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/81232465/kerby-tool/client-tool/src/main/java/org/apache/kerby/kerberos/tool/kinit/KinitTool.java
----------------------------------------------------------------------
diff --git a/kerby-tool/client-tool/src/main/java/org/apache/kerby/kerberos/tool/kinit/KinitTool.java
b/kerby-tool/client-tool/src/main/java/org/apache/kerby/kerberos/tool/kinit/KinitTool.java
index 0a4ed6d..7760f34 100644
--- a/kerby-tool/client-tool/src/main/java/org/apache/kerby/kerberos/tool/kinit/KinitTool.java
+++ b/kerby-tool/client-tool/src/main/java/org/apache/kerby/kerberos/tool/kinit/KinitTool.java
@@ -24,6 +24,7 @@ import org.apache.kerby.KOptions;
 import org.apache.kerby.kerberos.kerb.KrbException;
 import org.apache.kerby.kerberos.kerb.client.KrbClient;
 import org.apache.kerby.kerberos.kerb.client.KrbOption;
+import org.apache.kerby.kerberos.kerb.spec.ticket.ServiceTicket;
 import org.apache.kerby.kerberos.kerb.spec.ticket.TgtTicket;
 import org.apache.kerby.kerberos.tool.ToolUtil;
 import org.apache.kerby.util.OSUtil;
@@ -103,7 +104,7 @@ public class KinitTool {
     }
 
     private static void requestTicket(String principal,
-                                      KOptions ktOptions) {
+                                      KOptions ktOptions) throws KrbException {
         ktOptions.add(KinitOption.CLIENT_PRINCIPAL, principal);
 
         File confDir = null;
@@ -153,6 +154,13 @@ public class KinitTool {
             System.err.println("Store ticket failed: " + e.getMessage());
             System.exit(1);
         }
+
+        if (ktOptions.contains(KinitOption.SERVICE)) {
+            String servicePrincipal = ktOptions.getStringOption(KinitOption.SERVICE);
+            ServiceTicket serviceTicket =
+                    krbClient.requestServiceTicketWithTgt(tgt, servicePrincipal);
+            System.out.println(serviceTicket.toString());
+        }
         System.out.println("Successfully requested and stored ticket in "
                 + ccacheFile.getAbsolutePath());
     }


Mime
View raw message