You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by as...@apache.org on 2014/11/27 13:54:00 UTC

svn commit: r1642133 - /sling/trunk/bundles/auth/core/src/main/java/org/apache/sling/auth/core/impl/SlingAuthenticator.java

Author: asanso
Date: Thu Nov 27 12:53:59 2014
New Revision: 1642133

URL: http://svn.apache.org/r1642133
Log:
SLING-4203 - Remove the configurable option for auth.newpassword.parameter

Modified:
    sling/trunk/bundles/auth/core/src/main/java/org/apache/sling/auth/core/impl/SlingAuthenticator.java

Modified: sling/trunk/bundles/auth/core/src/main/java/org/apache/sling/auth/core/impl/SlingAuthenticator.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/auth/core/src/main/java/org/apache/sling/auth/core/impl/SlingAuthenticator.java?rev=1642133&r1=1642132&r2=1642133&view=diff
==============================================================================
--- sling/trunk/bundles/auth/core/src/main/java/org/apache/sling/auth/core/impl/SlingAuthenticator.java (original)
+++ sling/trunk/bundles/auth/core/src/main/java/org/apache/sling/auth/core/impl/SlingAuthenticator.java Thu Nov 27 12:53:59 2014
@@ -113,12 +113,6 @@ public class SlingAuthenticator implemen
     @Property(value = DEFAULT_IMPERSONATION_PARAMETER)
     public static final String PAR_IMPERSONATION_PAR_NAME = "auth.sudo.parameter";
 
-    /** The default new password parameter name */
-    private static final String DEFAULT_NEWPASSWORD_PARAMETER = "newpassword";
-
-    @Property(value = DEFAULT_NEWPASSWORD_PARAMETER)
-    public static final String PAR_NEWPASSWORD_PAR_NAME = "auth.newpassword.parameter";
-
     /** The default value for allowing anonymous access */
     private static final boolean DEFAULT_ANONYMOUS_ALLOWED = true;
 
@@ -180,6 +174,12 @@ public class SlingAuthenticator implemen
      * return <code>true</code>.
      */
     private static final String DEFAULT_AUTH_URI_SUFFIX = "/j_security_check";
+    
+    /**
+     * The name of the form submission parameter providing the new password of
+     * the user (value is "j_newpassword").
+     */
+    private static final String PAR_NEW_PASSWORD = "j_newpassword";
 
     /**
      * The name of the configuration property used to set a (potentially
@@ -239,9 +239,6 @@ public class SlingAuthenticator implemen
      */
     private char[] anonPassword;
 
-    /** name of the new password parameter */
-    private String newPasswordParameterName;
-
     /** HTTP Basic authentication handler */
     private HttpBasicAuthenticationHandler httpBasicHandler;
 
@@ -359,8 +356,6 @@ public class SlingAuthenticator implemen
             this.anonPassword = null;
         }
 
-        this.newPasswordParameterName = OsgiUtil.toString(properties.get(PAR_NEWPASSWORD_PAR_NAME), "");
-
         authUriSuffices = OsgiUtil.toStringArray(properties.get(PAR_AUTH_URI_SUFFIX),
             new String[] { DEFAULT_AUTH_URI_SUFFIX });
 
@@ -1266,7 +1261,7 @@ public class SlingAuthenticator implemen
      *            <code>newPassword</code> property is set.
      */
     private void handlePasswordChange(HttpServletRequest req, AuthenticationInfo authInfo) {
-        String newPassword = req.getParameter(this.newPasswordParameterName);
+        String newPassword = req.getParameter(PAR_NEW_PASSWORD );
         if (newPassword != null && newPassword.length() > 0) {
             authInfo.put("user.newpassword", newPassword);
         }