|
|
|
|
@ -21,6 +21,7 @@ import java.util.Map;
@@ -21,6 +21,7 @@ import java.util.Map;
|
|
|
|
|
|
|
|
|
|
import org.springframework.boot.context.properties.ConfigurationProperties; |
|
|
|
|
import org.springframework.core.env.Environment; |
|
|
|
|
import org.springframework.ldap.ReferralException; |
|
|
|
|
import org.springframework.ldap.core.LdapTemplate; |
|
|
|
|
import org.springframework.util.Assert; |
|
|
|
|
import org.springframework.util.ObjectUtils; |
|
|
|
|
@ -62,6 +63,11 @@ public class LdapProperties {
@@ -62,6 +63,11 @@ public class LdapProperties {
|
|
|
|
|
*/ |
|
|
|
|
private Boolean anonymousReadOnly; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Set the method to handle referrals. |
|
|
|
|
*/ |
|
|
|
|
private Referral referral; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* LDAP specification settings. |
|
|
|
|
*/ |
|
|
|
|
@ -109,6 +115,14 @@ public class LdapProperties {
@@ -109,6 +115,14 @@ public class LdapProperties {
|
|
|
|
|
this.anonymousReadOnly = anonymousReadOnly; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public Referral getReferral() { |
|
|
|
|
return this.referral; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public void setReferral(Referral referral) { |
|
|
|
|
this.referral = referral; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public Map<String, String> getBaseEnvironment() { |
|
|
|
|
return this.baseEnvironment; |
|
|
|
|
} |
|
|
|
|
@ -182,4 +196,36 @@ public class LdapProperties {
@@ -182,4 +196,36 @@ public class LdapProperties {
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Enum to define how referrals encountered by the service provider are to be processed. |
|
|
|
|
*/ |
|
|
|
|
public enum Referral { |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* follow referrals automatically |
|
|
|
|
*/ |
|
|
|
|
FOLLOW("follow"), |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* ignore referrals |
|
|
|
|
*/ |
|
|
|
|
IGNORE("ignore"), |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* throw a {@link ReferralException} for each referral |
|
|
|
|
*/ |
|
|
|
|
THROW("throw"); |
|
|
|
|
|
|
|
|
|
private final String mode; |
|
|
|
|
|
|
|
|
|
Referral(String mode) { |
|
|
|
|
this.mode = mode; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public String getMode() { |
|
|
|
|
return this.mode; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|