geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r795168 - in /geronimo/server/trunk/plugins: j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/ tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/
Date Fri, 17 Jul 2009 17:52:48 GMT
Author: djencks
Date: Fri Jul 17 17:52:48 2009
New Revision: 795168

URL: http://svn.apache.org/viewvc?rev=795168&view=rev
Log:
GERONIMO-4748 Make sure default subject is set on the thread if there is any security configuration
at all

Modified:
    geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/AbstractWebModuleBuilder.java
    geronimo/server/trunk/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/BaseGeronimoContextConfig.java
    geronimo/server/trunk/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/WebContextConfig.java

Modified: geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/AbstractWebModuleBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/AbstractWebModuleBuilder.java?rev=795168&r1=795167&r2=795168&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/AbstractWebModuleBuilder.java
(original)
+++ geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/AbstractWebModuleBuilder.java
Fri Jul 17 17:52:48 2009
@@ -333,6 +333,8 @@
             if (!hasSecurityRealmName) {
                 throw new DeploymentException("web.xml for web app " + module.getName() +
" includes security elements but Geronimo deployment plan is not provided or does not contain
<security-realm-name> element necessary to configure security accordingly.");
             }
+        }
+        if (hasSecurityRealmName) {
             earContext.setHasSecurity(true);
         }
         //TODO think about how to provide a default security realm name

Modified: geronimo/server/trunk/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/BaseGeronimoContextConfig.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/BaseGeronimoContextConfig.java?rev=795168&r1=795167&r2=795168&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/BaseGeronimoContextConfig.java
(original)
+++ geronimo/server/trunk/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/BaseGeronimoContextConfig.java
Fri Jul 17 17:52:48 2009
@@ -100,12 +100,9 @@
             authenticator = new DigestAuthenticator(loginService, realmName, unauthenticatedIdentity);
         } else if ("FORM".equalsIgnoreCase(authMethod)) {
             authenticator = new FormAuthenticator(loginService, unauthenticatedIdentity,
loginPage, errorPage);
-        } else  if ("NONE".equalsIgnoreCase(authMethod)) {
+        } else {
             authenticator = new NoneAuthenticator(unauthenticatedIdentity);
         }
-        if (authenticator == null) {
-            throw new IllegalStateException("No authenticator configured");
-        }
 
         AccessControlContext defaultAcc = ContextManager.registerSubjectShort(defaultSubject,
 null, null);
         Authorizer authorizer = new JACCAuthorizer(defaultAcc);

Modified: geronimo/server/trunk/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/WebContextConfig.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/WebContextConfig.java?rev=795168&r1=795167&r2=795168&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/WebContextConfig.java
(original)
+++ geronimo/server/trunk/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/WebContextConfig.java
Fri Jul 17 17:52:48 2009
@@ -36,11 +36,13 @@
         if (geronimoContext.isAuthenticatorInstalled()) {
             return;
         }
-        SecurityConstraint constraints[] = context.findConstraints();
-        if ((constraints == null) || (constraints.length == 0)) {
+        if (geronimoContext.getDefaultSubject() == null) {
             return;
         }
         LoginConfig loginConfig = context.getLoginConfig();
+        if (loginConfig == null) {
+            loginConfig = new LoginConfig();
+        }
         String authMethod = loginConfig.getAuthMethod();
         String realmName = loginConfig.getRealmName();
         String loginPage = loginConfig.getLoginPage();



Mime
View raw message