amyroh      2002/11/11 17:13:37

  Modified:    catalina/src/share/org/apache/catalina/realm JNDIRealm.java
  Log:
  Add the possibility to use SSL with the JNDIRealm.
  
  This patch allows two more parameters to be set for the JNDIRealm.
  If they are not explicitly set the JNDIRealm will behave in the same way as before.
  
  Submitted by Fredrik Westermarck & Jonathan Eric Miller.
  
  Revision  Changes    Path
  1.9       +58 -6     
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/realm/JNDIRealm.java
  
  Index: JNDIRealm.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/realm/JNDIRealm.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- JNDIRealm.java    11 Jun 2002 15:32:28 -0000      1.8
  +++ JNDIRealm.java    12 Nov 2002 01:13:37 -0000      1.9
  @@ -188,6 +188,10 @@
   
       // ----------------------------------------------------- Instance Variables
   
  +    /**
  +     *  The type of authentication to use
  +     */
  +    protected String authentication = null;
   
       /**
        * The connection username for the server we will contact.
  @@ -233,6 +237,10 @@
        */
       protected static final String name = "JNDIRealm";
   
  +    /**
  +     * The protocol that will be used in the communication with the directory 
server.
  +     */
  +    protected String protocol = null;
   
       /**
        * The base element for user searches.
  @@ -320,10 +328,28 @@
       protected boolean roleSubtree = false;
   
   
  -
       // ------------------------------------------------------------- Properties
   
  +    /**
  +     * Return the type of authentication to use.
  +     */  
  +    public String getAuthentication() {
   
  +        return authentication;
  +    
  +    }
  + 
  +    /**
  +     * Set the type of authentication to use.
  +     *
  +     * @param authentication The authentication
  +     */
  +    public void setAuthentication(String authentication) {
  +    
  +        this.authentication = authentication;
  +        
  +    }
  +      
       /**
        * Return the connection username for this Realm.
        */
  @@ -411,6 +437,28 @@
   
       }
   
  +
  +    /**
  +     * Return the protocol to be used.
  +     */
  +    public String getProtocol() {
  + 
  +        return protocol;
  + 
  +    }
  +    
  +    /**
  +     * Set the protocol for this Realm.
  +     *
  +     * @param protocol The new protocol.
  +     */
  +    public void setProtocol(String protocol) {
  + 
  +        this.protocol = protocol;
  +        
  +    }
  +
  +
       /**
        * Return the base element for user searches.
        */
  @@ -1294,6 +1342,11 @@
               env.put(Context.SECURITY_CREDENTIALS, connectionPassword);
           if (connectionURL != null)
               env.put(Context.PROVIDER_URL, connectionURL);
  +        if (authentication != null)
  +            env.put(Context.SECURITY_AUTHENTICATION, authentication);
  +        if (protocol != null)
  +            env.put(Context.SECURITY_PROTOCOL, protocol);
  +    
           context = new InitialDirContext(env);
           return (context);
   
  @@ -1378,4 +1431,3 @@
       }
   
   }
  -
  
  
  

--
To unsubscribe, e-mail:   <mailto:tomcat-dev-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-dev-help@;jakarta.apache.org>

Reply via email to