summaryrefslogtreecommitdiffstats
path: root/base/common/src/com/netscape/cmscore/realm/PKIPrincipal.java
diff options
context:
space:
mode:
authorEndi Sukma Dewata <edewata@redhat.com>2012-10-09 05:04:52 -0500
committerEndi Sukma Dewata <edewata@redhat.com>2012-10-18 16:46:22 -0500
commit98ad9c109ec41d0977d4249ac5e41dcf4c484a22 (patch)
treef7176772ea56313065e06a734b9cf26e993fcf31 /base/common/src/com/netscape/cmscore/realm/PKIPrincipal.java
parent4300459bff057ba50093f735ee9289868e258215 (diff)
downloadpki-98ad9c109ec41d0977d4249ac5e41dcf4c484a22.tar.gz
pki-98ad9c109ec41d0977d4249ac5e41dcf4c484a22.tar.xz
pki-98ad9c109ec41d0977d4249ac5e41dcf4c484a22.zip
Added PKIPrincipal.
Previously in PKIRealm the authentication token was stored in a thread local variable. This does not work for multiple operations executed using the same session because each operation may be handled by different threads. A new PKIPrincipal has been added to store the authentication token so that the threads can get the correct token for the session. Ticket #357
Diffstat (limited to 'base/common/src/com/netscape/cmscore/realm/PKIPrincipal.java')
-rw-r--r--base/common/src/com/netscape/cmscore/realm/PKIPrincipal.java29
1 files changed, 29 insertions, 0 deletions
diff --git a/base/common/src/com/netscape/cmscore/realm/PKIPrincipal.java b/base/common/src/com/netscape/cmscore/realm/PKIPrincipal.java
new file mode 100644
index 000000000..6f806e3e9
--- /dev/null
+++ b/base/common/src/com/netscape/cmscore/realm/PKIPrincipal.java
@@ -0,0 +1,29 @@
+package com.netscape.cmscore.realm;
+
+import java.util.List;
+
+import org.apache.catalina.realm.GenericPrincipal;
+
+import com.netscape.certsrv.authentication.IAuthToken;
+
+/**
+ * @author Endi S. Dewata
+ */
+
+public class PKIPrincipal extends GenericPrincipal {
+
+ IAuthToken authToken;
+
+ public PKIPrincipal(String name, String password, List<String> roles, IAuthToken authToken) {
+ super(name, password, roles);
+ this.authToken = authToken;
+ }
+
+ public PKIPrincipal(String name, String password, List<String> roles) {
+ this(name, password, roles, null);
+ }
+
+ public IAuthToken getAuthToken() {
+ return authToken;
+ }
+}