You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by dj...@apache.org on 2009/07/25 10:14:00 UTC

svn commit: r797720 - in /geronimo/server/trunk/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat: BaseGeronimoContextConfig.java security/authentication/jaspic/JaspicMessageInfo.java

Author: djencks
Date: Sat Jul 25 08:14:00 2009
New Revision: 797720

URL: http://svn.apache.org/viewvc?rev=797720&view=rev
Log:
GERONIMO-4752 fix tck problems in jaspic integration

Modified:
    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/security/authentication/jaspic/JaspicMessageInfo.java

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=797720&r1=797719&r2=797720&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 Sat Jul 25 08:14:00 2009
@@ -59,6 +59,7 @@
  */
 public class BaseGeronimoContextConfig extends ContextConfig {
     private static final String MESSAGE_LAYER = "HttpServlet";
+    private static final String POLICY_CONTEXT_ID_KEY = "javax.security.jacc.PolicyContext";
 
 
     protected void configureSecurity(StandardContext geronimoContext, String policyContextId, ConfigurationFactory configurationFactory, Subject defaultSubject, String authMethod, String realmName, String loginPage, String errorPage) {
@@ -68,7 +69,7 @@
         IdentityService identityService = new GeronimoIdentityService(defaultSubject);
         UserIdentity unauthenticatedIdentity = identityService.newUserIdentity(defaultSubject, null, null);
         LoginService loginService = new GeronimoLoginService(configurationFactory, identityService);
-        Authenticator authenticator = null;
+        Authenticator authenticator;
         AuthConfigFactory authConfigFactory = AuthConfigFactory.getFactory();
         RegistrationListener listener = new RegistrationListener() {
 
@@ -90,6 +91,7 @@
         }
         if (serverAuthConfig != null) {
             Map authProperties = new HashMap();
+            authProperties.put(POLICY_CONTEXT_ID_KEY, policyContextId);
             Subject serviceSubject = new Subject();
             authenticator = new JaspicAuthenticator(serverAuthConfig, authProperties, serviceSubject, callbackHandler, identityService);
         } else if ("BASIC".equalsIgnoreCase(authMethod)) {

Modified: geronimo/server/trunk/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/security/authentication/jaspic/JaspicMessageInfo.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/security/authentication/jaspic/JaspicMessageInfo.java?rev=797720&r1=797719&r2=797720&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/security/authentication/jaspic/JaspicMessageInfo.java (original)
+++ geronimo/server/trunk/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/security/authentication/jaspic/JaspicMessageInfo.java Sat Jul 25 08:14:00 2009
@@ -36,7 +36,7 @@
 public class JaspicMessageInfo implements MessageInfo {
     private static final String MANDATORY_KEY = "javax.security.auth.message.MessagePolicy.isMandatory";
 
-    private final Map map = new HashMap();
+    private final Map<String, Object> map = new HashMap<String, Object>();
     private HttpServletRequest request;
     private HttpServletResponse response;
 
@@ -46,7 +46,9 @@
     public JaspicMessageInfo(Request request, Response response, boolean authMandatory) {
         this.request = request;
         this.response = response;
-        map.put(MANDATORY_KEY, authMandatory);
+        if (authMandatory) {
+            map.put(MANDATORY_KEY, Boolean.toString(authMandatory));
+        }
     }
 
     public Map getMap() {