diff --git a/templates/_auth_ldap.erb b/templates/_auth_ldap.erb index b447ab98e..289468f55 100644 --- a/templates/_auth_ldap.erb +++ b/templates/_auth_ldap.erb @@ -3,9 +3,13 @@ com.dtolabs.rundeck.jetty.jaas.JettyCachingLdapLoginModule <%= @ldap_auth_flag % contextFactory="com.sun.jndi.ldap.LdapCtxFactory" providerUrl="ldap://<%= @auth_config['ldap']['server'] %>:<%= @auth_config['ldap']['port'] %>" authenticationMethod="simple" - forceBindingLogin="<%= @auth_config['ldap']['force_binding'] %>"<% if @auth_config['ldap']['bind_dn'] %> - bindDn="CN=<%= @auth_config['ldap']['bind_dn']%>,<%= @auth_config['ldap']['user_base_dn'] %>"<% end %><% if @auth_config['ldap']['bind_password'] %> - bindPassword="<%= @auth_config['ldap']['bind_password']%>"<% end %> + forceBindingLogin="<%= @auth_config['ldap']['force_binding'] %>" +<%- if @auth_config['ldap']['bind_dn'] -%> + bindDn="CN=<%= @auth_config['ldap']['bind_dn']%>,<%= @auth_config['ldap']['user_base_dn'] %>" +<%- end -%> +<%- if @auth_config['ldap']['bind_password'] -%> + bindPassword="<%= @auth_config['ldap']['bind_password']%>" +<%- end -%> userBaseDn="<%= @auth_config['ldap']['user_base_dn'] %>" userRdnAttribute="<%= @auth_config['ldap']['user_rdn_attribute'] %>" userIdAttribute="<%= @auth_config['ldap']['user_id_attribute'] %>" @@ -13,8 +17,10 @@ com.dtolabs.rundeck.jetty.jaas.JettyCachingLdapLoginModule <%= @ldap_auth_flag % roleBaseDn="<%= @auth_config['ldap']['role_base_dn'] %>" roleNameAttribute="<%= @auth_config['ldap']['role_name_attribute'] %>" roleMemberAttribute="<%= @auth_config['ldap']['role_member_attribute'] %>" - roleObjectClass="<%= @auth_config['ldap']['role_object_class'] %>"<% if @auth_config['ldap']['supplemental_roles'] %> - supplementalRoles="<%= @auth_config['ldap']['supplemental_roles'] %>"<% end %> + roleObjectClass="<%= @auth_config['ldap']['role_object_class'] %>" +<%- if @auth_config['ldap']['supplemental_roles'] -%> + supplementalRoles="<%= @auth_config['ldap']['supplemental_roles'] %>" +<%- end -%> cacheDurationMillis="300000" reportStatistics="true" nestedGroups="<%= @auth_config['ldap']['nested_groups'] %>";