Configuring Pentaho With LDAP or Active Directory
Configuring Pentaho With LDAP or Active Directory
Configuring Pentaho With LDAP or Active Directory
Overview
Pentaho can be configured to use multiple mechanisms for authentication and authorization,
including Microsoft Active Directory (MSAD), OpenLDAP, or database-based authentication, also
known as Java Database Connectivity (JDBC) authentication.
This document works through the steps needed to set up Pentaho to authenticate using MSAD, and
explains the components used in the applicationContext-security-ldap.properties.
The intention of this document is to speak about topics generally; however, these are the specific
versions covered here:
Software Version(s)
Pentaho 7.x, 8.x, 9.0
The Components Reference in Pentaho Documentation has a complete list of supported software and
hardware.
Prerequisites
This document assumes that you have the following:
• Domain: PentahoCustomerCare.com
• Organizational Unit (OU): PentahoCustomerCareGroups
• Organizational Unit: PentahoCustomerCareUsers
Page 1
Consider our scenario to connect to LDAP/Active Directory with the following structure:
Authentication happens when the user logs in. The system checks to see:
• Whether the user is a valid user to log in
• Whether the user is active
Once the user is proven to be active, and can log in, authorization occurs where we check the roles
the user belongs to.
Roles:
• Represent what the user is authorized to do in the server
• Are assigned only once we know who the user is
• Give the user operational permissions on the server such as Manage Security, Schedule
Content, Manage Data Sources, and others.
Note that a user may be able to open a report, but still may not be allowed to see its contents;
this is not to be confused with authorization. Being able to see the contents of a report is
controlled through Mondrian roles in Analyzer reports. These are security-constrained accesses
and are beyond the scope of this document.
Page 2
You can use a Spring Expression Language (SpEL) query to access this service and use it to decode a
string from a properties file, then assign it to the Spring variable that holds this password.
Page 3
In this example, we will use Base64 encoding. To use a different encoding/decoding scheme you will
need to implement the IPasswordService with your desired method:
contextSource.password=UGFzc3dvcmQx
1. Server URL: Enter your server’s DNS name or IP address in this format:
ldap://server_name_or_ip_address:port_number. In our example, we will use this IP
address and port 389: ldap://10.100.7.17:389.
2. Username: This is the binding account. It does not have to be an LDAP/Active Directory
administrator, but only needs read access.
3. Password: Enter the correct password for the username.
Page 4
You can find more information in Microsoft Technet for Active Directory Domain Services port
requirements.
contextSource.providerUrl=ldap\://10.100.7.17\:389
contextSource.password=Password1
contextSource.userDn=CN\=Elena
Neill,OU\=OrlandoFL,OU\=NAMER,OU\=Support,OU\=PentahoCustomerCareUsers,DC\=
PentahoCustomerCare,DC\=com
Page 5
The user is admin with the role Administrator in Pentaho’s default security.
CN=Carlos
Lopez,OU=OrlandoFL,OU=NAMER,OU=Support,OU=PentahoCustomerCareUsers,DC=Penta
hoCustomerCare,DC=com
CN=ADPentAdmins,OU=PentahoCustomerCareGroups,DC=PentahoCustomerCare,DC=com
Page 6
• Be a member of the same group that will be considered the Administrator group in
Pentaho (any user in that group can be an administrator, not just one user). In our example,
this means we can use any member of the group ADPentahoAdmins.
• Always be active, as the user is used by Pentaho to do queries and tasks related to user
loading and role mapping between Pentaho and your LDAP/Active Directory server.
Consider using the full Distinguished Name (DN) for both user and role.
adminUser=CN\=Carlos
Lopez,OU\=OrlandoFL,OU\=NAMER,OU\=Support,OU\=PentahoCustomerCareUsers,DC\=
PentahoCustomerCare,DC\=com
adminRole=CN\=ADPentAdmins,OU\=PentahoCustomerCareGroups,DC\=PentahoCustome
rCare,DC\=com
Page 7
Configuration
The next step will be to set up the configuration of the following items:
• Choosing LDAP Provider
• User Search
• Roles
• Populator
• Wrapping Up Configuration
User Search
Configuring the User Search is an important piece of the process, because it is what controls which
users from your LDAP/Active Directory server will be able to log into Pentaho.
1. The Search Base box tells Pentaho which OU contains the users who will be able to log into
PUC. Any groups/users under this OU will have access to log into Pentaho. In this example,
we will use PentahoCustomerCareUsers:
OU=PentahoCustomerCareUsers,DC=PentahoCustomerCare,DC=com
2. The Search Filter box tells Pentaho which AD attribute will be used for login, either
sAMAccountName (where the user would type in just their username, such as clopez) or
Page 8
UserPrincipalName (where the user would type in their username and domain, such as
[email protected]). In our example, we use sAMAccountName:
(sAMAccountName={0})
We recommend you consider using the AD attribute that matches the one your users type in
when they log into your AD network.
userSearch.searchBase=OU\=PentahoCustomerCareUsers,DC\=PentahoCustomerCare,
DC\=com
userSearch.searchFilter=(sAMAccountName\={0})
As a different option, in this next code, we are telling Pentaho to grant access to those users that are
members of the ADPPentCustomerCare Group below the PentahoCustomerCareUsers OU:
userSearch.searchBase=OU\=PentahoCustomerCareUsers,DC\=PentahoCustomerCare,
DC\=com
userSearch.searchFilter=(&(sAMAccountName\={0})(memberOf\=CN\=ADPentCustome
rCare,OU\=PentahoCustomerCareGroups,DC\=PentahoCustomerCare,DC\=com))
Page 9
Roles
The Roles settings tell Pentaho where to search for the roles that are going to be displayed and used
through the PUC.
allAuthoritiesSearch.roleAttribute=cn
allAuthoritiesSearch.searchBase=OU\=PentahoCustomerCareGroups,DC\=PentahoCu
stomerCare,DC\=com
allAuthoritiesSearch.searchFilter=(&(objectClass\=group)(cn\=ADPent*))
Figure 7: Roles
1. The Role Attribute box tells Pentaho what to display when the roles are populated. In this
example, we will use the common name (CN) of the group. Groups, Roles, and Authorities
are used interchangeably.
2. The Role Search Filter box tells Pentaho what to search for. In our example, we will use the
objectClass attribute of the group:
(objectClass=group)
Note that in our example, we are filtering down not to just groups, but to those groups
whose common name starts with ADPent*. By using that wildcard, we can include groups
such as ADPentAdmins, ADPentUsers, and ADPentEAG:
(&(objectClass=group)(cn=ADPent*))
Page 10
3. The Role Search Base box tells Pentaho where to start searching for the groups that have
access to Pentaho. In our example, we are using these attributes:
OU=PentahoCustomerCareGroups,DC=PentahoCustomerCare,DC=com
When you are configuring these roles settings, keep in mind that these settings are used in
multiple places in PUC. Depending on the number of roles and groups you have, they can take
some time to load.
Page 11
6. Add or remove role permissions for specific folders by going to Browse Files, highlighting a
file in the middle pane, and then clicking Share… under the File Actions pane. Under the
Share tab under Roles:
Populator
This section populates or gathers the groups a user is a member of during the active session.
Page 12
1. The Group Role Attribute box tells Pentaho what to display in the login session as the
display attribute. In this example, we will use the CN.
2. The Group Search Base box tells Pentaho where the AD groups will be located for the
session. In this example:
OU=PentahoCustomerCareGroups,DC=PentahoCustomerCare,DC=com
3. The Group Search Filter box tells Pentaho what attribute to use from the AD groups. In this
example:
(member={0})
4. Role Prefix, Convert to Upper Case, and Subtree are legacy attributes and do not need
configuration.
populator.groupRoleAttribute=cn
populator.groupSearchBase=OU\=PentahoCustomerCareGroups,DC\=PentahoCustomer
Care,DC\=com
populator.convertToUpperCase=false
populator.searchSubtree=false
populator.groupSearchFilter=(&(member\={0})(objectClass\=group)(cn\=ADPent*
))
populator.rolePrefix=
• Use the same Group Search Base as the one in the Roles Group Search Base, as this will
eliminate performance issues when the user is accessing PUC.
• Use a filter to remove those users who are active or enabled only; see this example and
change it accordingly:
(&(memberof\=CN\=ADPentCustomerCare,OU\=PentahoCustomerCareGroups,DC\=Penta
hoCustomerCare,DC\=com)(!(userAccountControl:1.2.840.113556.1.4.803:=2)))
Wrapping Up Configuration
You have now completed all the configurations needed to connect to your LDAP/Active Directory
Server. Next:
1. Click Save.
2. Restart the Pentaho Server.
Page 13
Page 14
Manual Configurations
For more options, you can manually configure other properties. Further information is available in the
Pentaho wiki at Enabling Verbose LDAP Logging, LDAP Troubleshooting, Nested Roles or Groups
(LDAP), and Using Active Directory.
This subsection covers which files to edit and what Java class is used to decode passwords. It assumes
that you are familiar with the applicationContext-security-ldap.properties file and that you
have a working Pentaho Server already configured with LDAP or Active Directory authentication. More
information about related topics outside of this document can be found at:
<bean id="contextSource"
class="org.springframework.security.ldap.DefaultSpringSecurityContextSource
">
<constructor-arg value="${ldap.contextSource.providerUrl}"/>
<property name="userDn" value="${ldap.contextSource.userDn}"/>
<property name="password" value="${ldap.contextSource.password}"/>
</bean>
Page 15
<bean id="contextSource"
class="org.springframework.security.ldap.DefaultSpringSecurityContextSource
">
<constructor-arg value="${ldap.contextSource.providerUrl}"/>
<property name="userDn" value="${ldap.contextSource.userDn}"/>
<property name="password"
value="#{IPasswordService.decrypt('${ldap.contextSource.password}')}"/>
</bean>
The Spring Expression Language has used IPasswordService to decrypt the string in the
applicationContext-securityldap.properties file.
For the Base64 encoded string password123, it would look like this:
contextSource.password=cGFzc3dvcmQxMjM\=
If your encoded string contains an equals sign, like that shown in the encoded string above, you
will need to add a backslash in front of it to escape it properly. Failure to do this will result in a
failed authentication.
1. To create an obfuscated password for the string password123, run the following in a
command-line:
You will get the following result after the script runs:
Page 16
Encrypted 2be98afc86ad79397b80ea162dac3fd89
contextSource.password=Encrypted 2be98afc86ad79397b80ea162dac3fd89
Page 17
</bean>
</constructor-arg>
</bean>
Page 18
We do not recommend using the Share tab in a large environment, because the thousands of
user accounts can cause performance issues. Instead, configure and manage users through
roles, groups, or authorities.
Usernames on the Share tab are not configured using the Authentication Perspective. Instead, they
are configured in \pentaho-server\pentaho-solutions\system\applicationContext-
security-ldap.properties.
allUsernamesSearch.searchFilter=objectClass\=Person
allUsernamesSearch.searchBase=OU\=PentahoCustomerCareUsers,DC\=PentahoCusto
merCare,DC\=com
allUsernamesSearch.usernameAttribute=sAMAccountName
These properties are copied from the allAuthoritiesSearch attributes, but can be changed to
match your environment.
Use these instructions carefully, because you could end up with your entire Active Directory list
of users in your search box, which could slow you down when you try to search for specific
people.
Configuring Subtree
You can configure subtree to search all the roles within the parent OU.
Follow these instructions to show all the users on the Share tab:
Page 19
</constructor-arg>
<constructor-arg index="2">
<bean
class="org.pentaho.platform.plugin.services.security.userrole.ldap.transfor
m.SearchResultToAttrValueList">
<constructor-arg index="0"
value="${ldap.allUsernamesSearch.usernameAttribute}" />
</bean>
</constructor-arg>
</bean>
Page 20
6. Click on Folder Actions > Properties > Share. From here, you can share folders by user or
roles:
Page 21
Related Information
Here are some links to information that you may find helpful while using this best practices document:
Finalization Checklist
This checklist is designed to be added to any implemented project that uses this collection of best
practices, to verify that all items have been considered and reviews have been performed.
Page 22