Example usage for org.apache.shiro.realm.ldap DefaultLdapContextFactory DefaultLdapContextFactory

List of usage examples for org.apache.shiro.realm.ldap DefaultLdapContextFactory DefaultLdapContextFactory

Introduction

In this page you can find the example usage for org.apache.shiro.realm.ldap DefaultLdapContextFactory DefaultLdapContextFactory.

Prototype

DefaultLdapContextFactory

Source Link

Usage

From source file:org.apache.zeppelin.realm.ActiveDirectoryGroupRealm.java

License:Apache License

public LdapContextFactory getLdapContextFactory() {
    if (this.ldapContextFactory == null) {
        if (log.isDebugEnabled()) {
            log.debug("No LdapContextFactory specified - creating a default instance.");
        }//www.ja  v a  2 s. c om

        DefaultLdapContextFactory defaultFactory = new DefaultLdapContextFactory();
        defaultFactory.setPrincipalSuffix(this.principalSuffix);
        defaultFactory.setSearchBase(this.searchBase);
        defaultFactory.setUrl(this.url);
        defaultFactory.setSystemUsername(this.systemUsername);
        defaultFactory.setSystemPassword(getSystemPassword());
        this.ldapContextFactory = defaultFactory;
    }

    return this.ldapContextFactory;
}