Sfoglia il codice sorgente

LdapUserDetailsMapper now throws UnsupportedOperationException for mapUserToContext method as only subclasses of this which implement actual LDAP object classes should be used for writing to a directory.

Luke Taylor 18 anni fa
parent
commit
3ddcc203bf

+ 3 - 2
core/src/main/java/org/springframework/security/userdetails/ldap/LdapUserDetailsMapper.java

@@ -28,7 +28,7 @@ import org.springframework.ldap.core.DirContextOperations;
 
 
 /**
- * The context mapper used by the authenticators to create an ldap user object.
+ * The context mapper used by the LDAP authentication provider to create an LDAP user object.
  *
  * @author Luke Taylor
  * @version $Id$
@@ -89,7 +89,8 @@ public class LdapUserDetailsMapper implements UserDetailsContextMapper {
     }
 
     public void mapUserToContext(UserDetails user, DirContextAdapter ctx) {
-
+        throw new UnsupportedOperationException("LdapUserDetailsMapper only supports reading from a context. Please" +
+                "use a subclass if mapUserToContext() is required.");
     }
 
     /**