geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject svn commit: r785374 - /geronimo/server/trunk/framework/modules/geronimo-security/src/main/java/org/apache/geronimo/security/realm/providers/LDAPLoginModule.java
Date Tue, 16 Jun 2009 20:25:25 GMT
Author: gawor
Date: Tue Jun 16 20:25:25 2009
New Revision: 785374

URL: http://svn.apache.org/viewvc?rev=785374&view=rev
Log:
follow referrals in ldap login module (GERONIMO-4643)

Modified:
    geronimo/server/trunk/framework/modules/geronimo-security/src/main/java/org/apache/geronimo/security/realm/providers/LDAPLoginModule.java

Modified: geronimo/server/trunk/framework/modules/geronimo-security/src/main/java/org/apache/geronimo/security/realm/providers/LDAPLoginModule.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-security/src/main/java/org/apache/geronimo/security/realm/providers/LDAPLoginModule.java?rev=785374&r1=785373&r2=785374&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-security/src/main/java/org/apache/geronimo/security/realm/providers/LDAPLoginModule.java
(original)
+++ geronimo/server/trunk/framework/modules/geronimo-security/src/main/java/org/apache/geronimo/security/realm/providers/LDAPLoginModule.java
Tue Jun 16 20:25:25 2009
@@ -87,10 +87,12 @@
     private static final String ROLE_SEARCH_MATCHING = "roleSearchMatching";
     private static final String ROLE_SEARCH_SUBTREE = "roleSearchSubtree";
     private static final String USER_ROLE_NAME = "userRoleName";
+    private static final String FOLLOW_REFERRALS = "followReferrals";
+    
     public final static List<String> supportedOptions = Collections.unmodifiableList(Arrays.asList(INITIAL_CONTEXT_FACTORY,
CONNECTION_URL,
             CONNECTION_USERNAME, CONNECTION_PASSWORD, CONNECTION_PROTOCOL, AUTHENTICATION,
USER_BASE,
             USER_SEARCH_MATCHING, USER_SEARCH_SUBTREE, ROLE_BASE, ROLE_NAME, ROLE_SEARCH_MATCHING,
ROLE_SEARCH_SUBTREE,
-            USER_ROLE_NAME));
+            USER_ROLE_NAME, FOLLOW_REFERRALS));
 
     private String initialContextFactory;
     private String connectionURL;
@@ -102,6 +104,7 @@
     private String roleBase;
     private String roleName;
     private String userRoleName;
+    private boolean followReferrals = true;
 
     private String cbUsername;
     private String cbPassword;
@@ -145,6 +148,8 @@
         roleSearchMatchingFormat = new MessageFormat(roleSearchMatching);
         userSearchSubtreeBool = Boolean.valueOf(userSearchSubtree);
         roleSearchSubtreeBool = Boolean.valueOf(roleSearchSubtree);
+        String followReferralsStr = (String) options.get(FOLLOW_REFERRALS);
+        followReferrals = (followReferralsStr == null) ? true : Boolean.valueOf(followReferralsStr);
     }
 
     /**
@@ -451,6 +456,7 @@
             env.put(Context.SECURITY_PROTOCOL, connectionProtocol == null ? "" : connectionProtocol);
             env.put(Context.PROVIDER_URL, connectionURL == null ? "" : connectionURL);
             env.put(Context.SECURITY_AUTHENTICATION, authentication == null ? "" : authentication);
+            env.put(Context.REFERRAL, (followReferrals) ? "follow" : "ignore");
             context = new InitialDirContext(env);
         } catch (NamingException e) {
             log.error("Failed to open context", e);



Mime
View raw message