diff --git a/core/src/main/java/org/springframework/security/userdetails/ldap/LdapUserDetails.java b/core/src/main/java/org/springframework/security/userdetails/ldap/LdapUserDetails.java index 87684ababe..d9e0250853 100644 --- a/core/src/main/java/org/springframework/security/userdetails/ldap/LdapUserDetails.java +++ b/core/src/main/java/org/springframework/security/userdetails/ldap/LdapUserDetails.java @@ -17,9 +17,6 @@ package org.springframework.security.userdetails.ldap; import org.springframework.security.userdetails.UserDetails; -import javax.naming.directory.Attributes; - - /** * Captures the information for a user's LDAP entry. * @@ -29,15 +26,6 @@ import javax.naming.directory.Attributes; public interface LdapUserDetails extends UserDetails { //~ Methods ======================================================================================================== - /** - * The attributes for the user's entry in the directory (or a subset of them, depending on what was - * retrieved from the directory). - * - * @deprecated Map additional attributes to user properties in a custom object rather than accessing them here. - * @return the user's attributes, or an empty array if none were obtained, never null. - */ - Attributes getAttributes(); - /** * The DN of the entry for this user's account. * diff --git a/core/src/main/java/org/springframework/security/userdetails/ldap/LdapUserDetailsImpl.java b/core/src/main/java/org/springframework/security/userdetails/ldap/LdapUserDetailsImpl.java index 3b301bb87e..79d12f8ed6 100644 --- a/core/src/main/java/org/springframework/security/userdetails/ldap/LdapUserDetailsImpl.java +++ b/core/src/main/java/org/springframework/security/userdetails/ldap/LdapUserDetailsImpl.java @@ -47,7 +47,6 @@ public class LdapUserDetailsImpl implements LdapUserDetails { //~ Instance fields ================================================================================================ - private Attributes attributes = new BasicAttributes(); private String dn; private String password; private String username; @@ -63,10 +62,6 @@ public class LdapUserDetailsImpl implements LdapUserDetails { //~ Methods ======================================================================================================== - public Attributes getAttributes() { - return attributes; - } - public GrantedAuthority[] getAuthorities() { return authorities; } @@ -123,7 +118,7 @@ public class LdapUserDetailsImpl implements LdapUserDetails { sb.append("Not granted any authorities"); } - return sb.toString(); + return sb.toString(); } //~ Inner Classes ================================================================================================== @@ -143,7 +138,6 @@ public class LdapUserDetailsImpl implements LdapUserDetails { public Essence(LdapUserDetails copyMe) { setDn(copyMe.getDn()); - setAttributes(copyMe.getAttributes()); setUsername(copyMe.getUsername()); setPassword(copyMe.getPassword()); setEnabled(copyMe.isEnabled()); @@ -202,10 +196,6 @@ public class LdapUserDetailsImpl implements LdapUserDetails { instance.accountNonLocked = accountNonLocked; } - public void setAttributes(Attributes attributes) { - instance.attributes = attributes; - } - public void setAuthorities(GrantedAuthority[] authorities) { mutableAuthorities = new ArrayList(Arrays.asList(authorities)); }