You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by co...@apache.org on 2016/07/18 11:42:13 UTC

directory-kerby git commit: Add the principal name in the login module

Repository: directory-kerby
Updated Branches:
  refs/heads/trunk aa29b0a8b -> cdd88c5ea


Add the principal name in the login module


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

Branch: refs/heads/trunk
Commit: cdd88c5ea46d9c7423d8d35a52ef9f16ce74f030
Parents: aa29b0a
Author: Colm O hEigeartaigh <co...@apache.org>
Authored: Mon Jul 18 12:41:58 2016 +0100
Committer: Colm O hEigeartaigh <co...@apache.org>
Committed: Mon Jul 18 12:41:58 2016 +0100

----------------------------------------------------------------------
 .../kerb/integration/test/jaas/TokenAuthLoginModule.java        | 3 +++
 .../kerberos/kerb/integration/test/jaas/TokenJaasKrbUtil.java   | 5 +----
 2 files changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/cdd88c5e/kerby-kerb/integration-test/src/main/java/org/apache/kerby/kerberos/kerb/integration/test/jaas/TokenAuthLoginModule.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/integration-test/src/main/java/org/apache/kerby/kerberos/kerb/integration/test/jaas/TokenAuthLoginModule.java b/kerby-kerb/integration-test/src/main/java/org/apache/kerby/kerberos/kerb/integration/test/jaas/TokenAuthLoginModule.java
index 441fd71..3732402 100644
--- a/kerby-kerb/integration-test/src/main/java/org/apache/kerby/kerberos/kerb/integration/test/jaas/TokenAuthLoginModule.java
+++ b/kerby-kerb/integration-test/src/main/java/org/apache/kerby/kerberos/kerb/integration/test/jaas/TokenAuthLoginModule.java
@@ -167,6 +167,9 @@ public class TokenAuthLoginModule implements LoginModule {
                 e.printStackTrace();
             }
             subject.getPrivateCredentials().add(ticket);
+            if (princName != null) {
+                subject.getPrincipals().add(new KerberosPrincipal(princName));
+            }
         }
         commitSucceeded = true;
         LOG.info("Commit Succeeded \n");

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/cdd88c5e/kerby-kerb/integration-test/src/main/java/org/apache/kerby/kerberos/kerb/integration/test/jaas/TokenJaasKrbUtil.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/integration-test/src/main/java/org/apache/kerby/kerberos/kerb/integration/test/jaas/TokenJaasKrbUtil.java b/kerby-kerb/integration-test/src/main/java/org/apache/kerby/kerberos/kerb/integration/test/jaas/TokenJaasKrbUtil.java
index 88e47b0..208158d 100644
--- a/kerby-kerb/integration-test/src/main/java/org/apache/kerby/kerberos/kerb/integration/test/jaas/TokenJaasKrbUtil.java
+++ b/kerby-kerb/integration-test/src/main/java/org/apache/kerby/kerberos/kerb/integration/test/jaas/TokenJaasKrbUtil.java
@@ -50,10 +50,7 @@ public class TokenJaasKrbUtil {
     public static Subject loginUsingToken(
             String principal, File tokenCache, File armorCache, File ccache, File signKeyFile)
             throws LoginException {
-        Set<Principal> principals = new HashSet<Principal>();
-        principals.add(new KerberosPrincipal(principal));
-
-        Subject subject = new Subject(false, principals,
+        Subject subject = new Subject(false, new HashSet<Principal>(),
                 new HashSet<Object>(), new HashSet<Object>());
         Configuration conf = useTokenCache(principal, tokenCache, armorCache, ccache, signKeyFile);
         String confName = "TokenCacheConf";