summaryrefslogtreecommitdiffstats
path: root/base/common/src/com/netscape/cms/tomcat
diff options
context:
space:
mode:
authorEndi Sukma Dewata <edewata@redhat.com>2013-01-30 13:26:55 -0500
committerEndi Sukma Dewata <edewata@redhat.com>2013-01-30 13:26:55 -0500
commit9fd77f53bd6238ee94b1ed5fe55dcfbfb475a93d (patch)
treeaf23ae814a421ed6361ce627ceacc4e6b77c0a09 /base/common/src/com/netscape/cms/tomcat
parent95e41dc9043a3fbbeea2abd58cca84d1442c0102 (diff)
downloadpki-9fd77f53bd6238ee94b1ed5fe55dcfbfb475a93d.tar.gz
pki-9fd77f53bd6238ee94b1ed5fe55dcfbfb475a93d.tar.xz
pki-9fd77f53bd6238ee94b1ed5fe55dcfbfb475a93d.zip
Session support on CLI.
The CLI has been modified to support executing multiple commands through the same session. A new 'connect' command has been added to establish the session. A new 'disconnect' command has been added to destroy the session. This way it's no longer necessary to specify the authentication info in each commands: pki <auth info> connect pki user-find pki user-show caadmin pki disconnect The old way of specifying the authentication info in each command will continue to work, but the commands will be executed in separate sessions: pki <auth info> user-find pki <auth info> user-show caadmin Ticket #474
Diffstat (limited to 'base/common/src/com/netscape/cms/tomcat')
-rw-r--r--base/common/src/com/netscape/cms/tomcat/SSLAuthenticatorWithFallback.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/base/common/src/com/netscape/cms/tomcat/SSLAuthenticatorWithFallback.java b/base/common/src/com/netscape/cms/tomcat/SSLAuthenticatorWithFallback.java
index d1b3dc3f2..2e4d2002a 100644
--- a/base/common/src/com/netscape/cms/tomcat/SSLAuthenticatorWithFallback.java
+++ b/base/common/src/com/netscape/cms/tomcat/SSLAuthenticatorWithFallback.java
@@ -19,6 +19,7 @@
package com.netscape.cms.tomcat;
import java.io.IOException;
+import java.security.Principal;
import java.security.cert.X509Certificate;
import javax.servlet.http.HttpServletRequest;
@@ -77,6 +78,13 @@ public class SSLAuthenticatorWithFallback extends AuthenticatorBase {
@Override
public boolean authenticate(Request request, HttpServletResponse response, LoginConfig config) throws IOException {
+ log("Session: "+request.getSession().getId());
+ Principal principal = request.getPrincipal();
+ if (principal != null) {
+ log("Already authenticated as "+principal.getName());
+ return true;
+ }
+
X509Certificate certs[] = (X509Certificate[]) request.getAttribute(Globals.CERTIFICATES_ATTR);
boolean result;