mirror of https://github.com/apache/nifi.git
NIFI-655:
- Adding support for specifying the user search base and user search filter in the active directory provider.
This commit is contained in:
parent
6f82802f7a
commit
09cb608859
|
@ -29,18 +29,23 @@ public class ActiveDirectoryProvider extends AbstractLdapProvider {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected AbstractLdapAuthenticationProvider getLdapAuthenticationProvider(LoginIdentityProviderConfigurationContext configurationContext) throws ProviderCreationException {
|
protected AbstractLdapAuthenticationProvider getLdapAuthenticationProvider(LoginIdentityProviderConfigurationContext configurationContext) throws ProviderCreationException {
|
||||||
final String domain = configurationContext.getProperty("Domain");
|
|
||||||
if (StringUtils.isBlank(domain)) {
|
|
||||||
throw new ProviderCreationException("The Active Directory Domain must be specified.");
|
|
||||||
}
|
|
||||||
|
|
||||||
final String url = configurationContext.getProperty("Url");
|
final String url = configurationContext.getProperty("Url");
|
||||||
if (StringUtils.isBlank(url)) {
|
if (StringUtils.isBlank(url)) {
|
||||||
throw new ProviderCreationException("The Active Directory Url must be specified.");
|
throw new ProviderCreationException("The Active Directory 'Url' must be specified.");
|
||||||
}
|
}
|
||||||
|
|
||||||
final String rootDn = configurationContext.getProperty("Root DN");
|
final String domain = configurationContext.getProperty("Domain");
|
||||||
|
final String userSearchBase = configurationContext.getProperty("User Search Base");
|
||||||
return new ActiveDirectoryLdapAuthenticationProvider(domain, url, StringUtils.isBlank(rootDn) ? null : rootDn);
|
|
||||||
|
final ActiveDirectoryLdapAuthenticationProvider activeDirectoryAuthenticationProvider =
|
||||||
|
new ActiveDirectoryLdapAuthenticationProvider(StringUtils.isBlank(domain) ? null : domain, url, StringUtils.isBlank(userSearchBase) ? null : userSearchBase);
|
||||||
|
|
||||||
|
final String userSearchFilter = configurationContext.getProperty("User Search Filter");
|
||||||
|
if (StringUtils.isNotBlank(userSearchFilter)) {
|
||||||
|
activeDirectoryAuthenticationProvider.setSearchFilter(userSearchFilter);
|
||||||
|
}
|
||||||
|
|
||||||
|
return activeDirectoryAuthenticationProvider;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue