sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From romb...@apache.org
Subject [sling-org-apache-sling-auth-form] 06/32: 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)
Date Tue, 07 Nov 2017 09:17:50 GMT
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.auth.form-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-auth-form.git

commit 0a41f41e4aeab80e25d4a91c6b4f1510f36ed360
Author: Felix Meschberger <fmeschbe@apache.org>
AuthorDate: Tue Feb 16 12:22:01 2010 +0000

    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)
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/formauth@910496
13f79535-47bb-0310-9956-ffa450edef68
---
 .../org/apache/sling/formauth/FormLoginModulePlugin.java   | 14 ++------------
 1 file changed, 2 insertions(+), 12 deletions(-)

diff --git a/src/main/java/org/apache/sling/formauth/FormLoginModulePlugin.java b/src/main/java/org/apache/sling/formauth/FormLoginModulePlugin.java
index 31ee174..b2776bf 100644
--- a/src/main/java/org/apache/sling/formauth/FormLoginModulePlugin.java
+++ b/src/main/java/org/apache/sling/formauth/FormLoginModulePlugin.java
@@ -25,7 +25,6 @@ import java.util.Set;
 
 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 @@ final class FormLoginModulePlugin implements LoginModulePlugin {
     }
 
     /**
-     * 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;
     }
 

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <commits@sling.apache.org>.

Mime
View raw message