sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fmesc...@apache.org
Subject svn commit: r910496 - /sling/trunk/bundles/extensions/formauth/src/main/java/org/apache/sling/formauth/FormLoginModulePlugin.java
Date Tue, 16 Feb 2010 12:22:01 GMT
Author: fmeschbe
Date: Tue Feb 16 12:22:01 2010
New Revision: 910496

URL: http://svn.apache.org/viewvc?rev=910496&view=rev
Log:
SLING-1380 Do not return anything from getPrincipal to allow DefaultLoginModule.getPrincipal
to kick in and validate the user name against the existing users (and also to provide the
correct principal for the user)

Modified:
    sling/trunk/bundles/extensions/formauth/src/main/java/org/apache/sling/formauth/FormLoginModulePlugin.java

Modified: sling/trunk/bundles/extensions/formauth/src/main/java/org/apache/sling/formauth/FormLoginModulePlugin.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/formauth/src/main/java/org/apache/sling/formauth/FormLoginModulePlugin.java?rev=910496&r1=910495&r2=910496&view=diff
==============================================================================
--- sling/trunk/bundles/extensions/formauth/src/main/java/org/apache/sling/formauth/FormLoginModulePlugin.java
(original)
+++ sling/trunk/bundles/extensions/formauth/src/main/java/org/apache/sling/formauth/FormLoginModulePlugin.java
Tue Feb 16 12:22:01 2010
@@ -25,7 +25,6 @@
 
 import javax.jcr.Credentials;
 import javax.jcr.Session;
-import javax.jcr.SimpleCredentials;
 import javax.security.auth.callback.CallbackHandler;
 import org.apache.sling.jcr.jackrabbit.server.security.AuthenticationPlugin;
 import org.apache.sling.jcr.jackrabbit.server.security.LoginModulePlugin;
@@ -114,19 +113,10 @@
     }
 
     /**
-     * Returns a simple <code>Principal</code> just providing the user id
-     * contained in the <code>SimpleCredentials</code> object. If the
-     * credentials is not a <code>SimpleCredentials</code> instance,
-     * <code>null</code> is returned.
+     * Returns <code>null</code> to have the <code>DefaultLoginModule</code>
+     * provide a principal based on an existing user defined in the repository.
      */
     public Principal getPrincipal(final Credentials credentials) {
-        if (credentials instanceof SimpleCredentials) {
-            return new Principal() {
-                public String getName() {
-                    return ((SimpleCredentials) credentials).getUserID();
-                }
-            };
-        }
         return null;
     }
 



Mime
View raw message