mirror of
https://github.com/spring-projects/spring-security.git
synced 2025-02-28 18:39:06 +00:00
Removed old LDAP code from sandbox and adjusted dependencies accordingly.
This commit is contained in:
parent
5474b3a78c
commit
cbc74de7c6
@ -39,11 +39,6 @@
|
||||
<artifactId>ldapsdk</artifactId>
|
||||
<version>4.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.sf.ldaptemplate</groupId>
|
||||
<artifactId>ldaptemplate</artifactId>
|
||||
<version>1.0.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.samba.jcifs</groupId>
|
||||
<artifactId>jcifs</artifactId>
|
||||
|
@ -1,30 +0,0 @@
|
||||
package org.acegisecurity.ldap;
|
||||
|
||||
import net.sf.ldaptemplate.ContextSource;
|
||||
|
||||
import javax.naming.directory.DirContext;
|
||||
|
||||
import org.springframework.dao.DataAccessException;
|
||||
|
||||
/**
|
||||
* A version of InitialDirContextFactory that implements the ldaptemplate ContextSource interface.
|
||||
*
|
||||
* DefaultInitialDirContextFactory should be modified to implement this when it is possible to
|
||||
* introduce a dependency on ldaptemplate in the main code.
|
||||
*
|
||||
* @author Luke
|
||||
* @version $Id$
|
||||
*/
|
||||
public class ContextSourceInitialDirContextFactory extends DefaultInitialDirContextFactory implements ContextSource {
|
||||
public ContextSourceInitialDirContextFactory(String providerUrl) {
|
||||
super(providerUrl);
|
||||
}
|
||||
|
||||
public DirContext getReadOnlyContext() throws DataAccessException {
|
||||
return newInitialDirContext();
|
||||
}
|
||||
|
||||
public DirContext getReadWriteContext() throws DataAccessException {
|
||||
return newInitialDirContext();
|
||||
}
|
||||
}
|
@ -77,6 +77,18 @@ public class PasswordPolicyResponseControl extends PasswordPolicyControl {
|
||||
|
||||
//~ Constructors ===================================================================================================
|
||||
|
||||
/**
|
||||
* Decodes the Ber encoded control data. The ASN.1 value of the control data is:<pre>
|
||||
* PasswordPolicyResponseValue ::= SEQUENCE { warning [0] CHOICE {
|
||||
* timeBeforeExpiration [0] INTEGER (0 .. maxInt),
|
||||
* graceAuthNsRemaining [1] INTEGER (0 .. maxInt) } OPTIONAL, error [1] ENUMERATED {
|
||||
* passwordExpired (0), accountLocked (1),
|
||||
* changeAfterReset (2), passwordModNotAllowed (3),
|
||||
* mustSupplyOldPassword (4), insufficientPasswordQuality (5),
|
||||
* passwordTooShort (6), passwordTooYoung (7),
|
||||
* passwordInHistory (8) } OPTIONAL }</pre>
|
||||
*
|
||||
*/
|
||||
public PasswordPolicyResponseControl(byte[] encodedValue) {
|
||||
this.encodedValue = encodedValue;
|
||||
|
||||
@ -111,19 +123,6 @@ public class PasswordPolicyResponseControl extends PasswordPolicyControl {
|
||||
return errorCode;
|
||||
}
|
||||
|
||||
/**
|
||||
* Decodes the Ber encoded control data. The ASN.1 value of the control data is:<pre>
|
||||
* PasswordPolicyResponseValue ::= SEQUENCE { warning [0] CHOICE {
|
||||
* timeBeforeExpiration [0] INTEGER (0 .. maxInt),
|
||||
* graceAuthNsRemaining [1] INTEGER (0 .. maxInt) } OPTIONAL, error [1] ENUMERATED {
|
||||
* passwordExpired (0), accountLocked (1),
|
||||
* changeAfterReset (2), passwordModNotAllowed (3),
|
||||
* mustSupplyOldPassword (4), insufficientPasswordQuality (5),
|
||||
* passwordTooShort (6), passwordTooYoung (7),
|
||||
* passwordInHistory (8) } OPTIONAL }</pre>
|
||||
*
|
||||
* @return DOCUMENT ME!
|
||||
*/
|
||||
/**
|
||||
* Returns the graceLoginsRemaining.
|
||||
*
|
||||
@ -207,7 +206,7 @@ public class PasswordPolicyResponseControl extends PasswordPolicyControl {
|
||||
}
|
||||
|
||||
//~ Inner Classes ==================================================================================================
|
||||
|
||||
|
||||
/**
|
||||
* Decoder based on Netscape ldapsdk library
|
||||
*/
|
||||
|
@ -1,25 +0,0 @@
|
||||
package org.acegisecurity.userdetails;
|
||||
|
||||
/**
|
||||
* An extension of the {@link UserDetailsService} which provides the ability
|
||||
* to create new users and update existing ones.
|
||||
*
|
||||
* @author Luke
|
||||
* @version $Id$
|
||||
*/
|
||||
public interface UserDetailsManager extends UserDetailsService {
|
||||
|
||||
/**
|
||||
* Save details for the supplied user, or update
|
||||
*
|
||||
* @param user
|
||||
*/
|
||||
void createUser(UserDetails user);
|
||||
|
||||
void updateUser(UserDetails user);
|
||||
|
||||
void deleteUser(String username);
|
||||
|
||||
boolean userExists(String username);
|
||||
|
||||
}
|
@ -1,50 +0,0 @@
|
||||
package org.acegisecurity.userdetails.ldap;
|
||||
|
||||
/**
|
||||
* @author Luke
|
||||
* @version $Id$
|
||||
*/
|
||||
public class InetOrgPerson extends LdapUserDetailsImpl {
|
||||
String sn;
|
||||
String cn;
|
||||
|
||||
public String getSn() {
|
||||
return sn;
|
||||
}
|
||||
|
||||
public String getCn() {
|
||||
return cn;
|
||||
}
|
||||
|
||||
public static class Essence extends LdapUserDetailsImpl.Essence {
|
||||
|
||||
public Essence() {
|
||||
}
|
||||
|
||||
public Essence(InetOrgPerson copyMe) {
|
||||
super(copyMe);
|
||||
}
|
||||
|
||||
LdapUserDetailsImpl createTarget() {
|
||||
return new InetOrgPerson();
|
||||
}
|
||||
|
||||
public void setSn(String sn) {
|
||||
((InetOrgPerson)instance).sn = sn;
|
||||
}
|
||||
|
||||
public void setCn(String cn) {
|
||||
((InetOrgPerson)instance).cn = cn;
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
InetOrgPerson.Essence p = new InetOrgPerson.Essence();
|
||||
|
||||
p.setSn("Scobbie");
|
||||
|
||||
InetOrgPerson immutablePerson = (InetOrgPerson)p.createUserDetails();
|
||||
System.out.println(immutablePerson.getSn());
|
||||
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user