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

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

Introduction

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

Prototype

public void setPrincipalSuffix(String principalSuffix) 

Source Link

Document

A suffix appended to the username.

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.");
        }/*from  w  w w.j  a  v  a  2s.  c o m*/

        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;
}