Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Add some more details to LDAP form

Oliver Güntherf16411ba37b1
diff --git a/app/views/ldap_auth_sources/_form.html.erb b/app/views/ldap_auth_sources/_form.html.erb
index 830fdd051ce..eb4cb525870 100644
--- a/app/views/ldap_auth_sources/_form.html.erb
+++ b/app/views/ldap_auth_sources/_form.html.erb
@@ -34,9 +34,28 @@ See docs/COPYRIGHT.rdoc for more details.
<%= error_messages_for :auth_source %>
+<% if @auth_source.new_record? %>
+ <div class="notification-box -info">
+ <a title="close" class="notification-box--close icon-context icon-close"></a>
+ <div class="notification-box--content">
+ <%= t('ldap_auth_sources.technical_warning_html') %>
+ </div>
+ </div>
+<% end %>
+
<section class="form--section">
- <div class="form--field -required"><%= f.text_field 'name', required: true, container_class: '-middle' %></div>
- <div class="form--field -required"><%= f.text_field 'host', required: true, container_class: '-middle' %></div>
+ <div class="form--field -required">
+ <%= f.text_field 'name', required: true, container_class: '-middle' %>
+ <span class="form--field-instructions">
+ <%= t('ldap_auth_sources.attribute_texts.name') %>
+ </span>
+ </div>
+ <div class="form--field -required">
+ <%= f.text_field 'host', required: true, container_class: '-middle' %>
+ <span class="form--field-instructions">
+ <%= t('ldap_auth_sources.attribute_texts.host') %>
+ </span>
+ </div>
<div class="form--field -required"><%= f.text_field 'port', required: true, size: 6, container_class: '-xslim' %></div>
<fieldset class="form--fieldset">
@@ -74,25 +93,93 @@ See docs/COPYRIGHT.rdoc for more details.
</div>
</fieldset>
<fieldset class="form--fieldset">
- <legend class="form--fieldset-legend"><%= t(:label_details) %></legend>
- <div class="form--field"><%= f.text_field 'account', container_class: '-middle' %></div>
+ <legend class="form--fieldset-legend"><%= t('ldap_auth_sources.system_account') %></legend>
+ <p><%= t 'ldap_auth_sources.system_account_legend' %></p>
+
+ <div class="form--field">
+ <%= f.text_field 'account', container_class: '-middle' %>
+ <span class="form--field-instructions">
+ <%= t('ldap_auth_sources.attribute_texts.system_user_dn_html') %>
+ </span>
+ </div>
<div class="form--field">
<%= f.password_field 'account_password',
label: AuthSource.human_attribute_name(:password),
placeholder: ((@auth_source.new_record? || @auth_source.account_password.blank?) ? '' : ('●'*15)),
autocomplete: 'off',
container_class: '-middle' %>
+ <span class="form--field-instructions">
+ <%= t('ldap_auth_sources.attribute_texts.system_user_password') %>
+ </span>
</div>
- <div class="form--field"><%= f.text_field 'base_dn', size: 60, container_class: '-wide' %></div>
- <div class="form--field"><%= f.check_box 'onthefly_register', label: AuthSource.human_attribute_name(:onthefly) %></div>
</fieldset>
</section>
<fieldset class="form--fieldset">
- <legend class="form--fieldset-legend"><%=t(:label_attribute_plural)%></legend>
- <div class="form--field -required"><%= f.text_field 'attr_login', label: AuthSource.human_attribute_name(:login), required: true, size: 20, container_class: '-middle' %></div>
- <div class="form--field"><%= f.text_field 'attr_firstname', label: AuthSource.human_attribute_name(:firstname), size: 20, container_class: '-middle' %></div>
- <div class="form--field"><%= f.text_field 'attr_lastname', label: AuthSource.human_attribute_name(:lastname), size: 20, container_class: '-middle' %></div>
- <div class="form--field"><%= f.text_field 'attr_mail', label: AuthSource.human_attribute_name(:mail), size: 20, container_class: '-middle' %></div>
- <div class="form--field"><%= f.text_field 'attr_admin', label: AuthSource.human_attribute_name(:admin), size: 20, container_class: '-middle' %></div>
+ <legend class="form--fieldset-legend"><%=t('ldap_auth_sources.ldap_details')%></legend>
+ <div class="form--field">
+ <%= f.text_field 'base_dn', size: 60, container_class: '-wide' %>
+ <span class="form--field-instructions">
+ <%= t('ldap_auth_sources.attribute_texts.base_dn') %>
+ </span>
+ </div>
+ <div class="form--field">
+ <%= f.check_box 'onthefly_register', label: AuthSource.human_attribute_name(:onthefly) %>
+ <span class="form--field-instructions">
+ <%= t('ldap_auth_sources.attribute_texts.onthefly_register') %>
+ </span>
+ </div>
+</fieldset>
+
+<fieldset class="form--fieldset">
+ <legend class="form--fieldset-legend"><%=t('ldap_auth_sources.user_settings')%></legend>
+ <p><%= t 'ldap_auth_sources.user_settings_legend' %></p>
+
+ <div class="form--field -required">
+ <%= f.text_field 'attr_login',
+ label: AuthSource.human_attribute_name(:login),
+ required: true,
+ size: 20,
+ placeholder: 'uid',
+ container_class: '-middle' %>
+ <span class="form--field-instructions">
+ <%= t('ldap_auth_sources.attribute_texts.login_map') %>
+ </span>
+ </div>
+ <div class="form--field">
+ <%= f.text_field 'attr_firstname',
+ label: AuthSource.human_attribute_name(:firstname),
+ size: 20,
+ placeholder: 'givenName',
+ container_class: '-middle' %>
+ <span class="form--field-instructions">
+ <%= t('ldap_auth_sources.attribute_texts.generic_map', attribute: AuthSource.human_attribute_name(:firstname)) %>
+ </span>
+ </div>
+ <div class="form--field">
+ <%= f.text_field 'attr_lastname',
+ label: AuthSource.human_attribute_name(:lastname),
+ size: 20,
+ placeholder: 'sn',
+ container_class: '-middle' %>
+ <span class="form--field-instructions">
+ <%= t('ldap_auth_sources.attribute_texts.generic_map', attribute: AuthSource.human_attribute_name(:lastname)) %>
+ </span>
+ </div>
+ <div class="form--field">
+ <%= f.text_field 'attr_mail',
+ label: AuthSource.human_attribute_name(:mail),
+ size: 20,
+ placeholder: 'mail',
+ container_class: '-middle' %>
+ <span class="form--field-instructions">
+ <%= t('ldap_auth_sources.attribute_texts.generic_map', attribute: AuthSource.human_attribute_name(:mail)) %>
+ </span>
+ </div>
+ <div class="form--field">
+ <%= f.text_field 'attr_admin', label: AuthSource.human_attribute_name(:admin), size: 20, container_class: '-middle' %>
+ <span class="form--field-instructions">
+ <%= t('ldap_auth_sources.attribute_texts.admin_map_html') %>
+ </span>
+ </div>
</fieldset>
diff --git a/config/locales/en.yml b/config/locales/en.yml
index 1da045c6b9c..7254a7d1a67 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -79,7 +79,40 @@ en:
no_results_content_text: Create a new authentication mode
ldap_auth_sources:
+ technical_warning_html: |
+ This LDAP form requires technical knowledge of your LDAP / Active Directory setup.
+ <br/>
+ <a href="https://www.openproject.org/help/administration/manage-ldap-authentication/">Please visit our documentation for detailed instructions</a>.
+ attribute_texts:
+ name: Arbitrary name of the LDAP connection
+ host: LDAP host name or IP address
+ login_map: The attribute key in LDAP that is used to identify the unique user login. Usually, this will be `uid` or `samAccountName`.
+ generic_map: The attribute key in LDAP that is mapped to the OpenProject `%{attribute}` attribute
+ admin_map_html: "Optional: The attribute key in LDAP that <strong>if present</strong> marks the OpenProject user an admin. Leave empty when in doubt."
+ system_user_dn_html: |
+ Enter the DN of the system user used for read-only access.
+ <br/>
+ Example: uid=openproject,ou=system,dc=example,dc=com
+ system_user_password: Enter the bind password of the system user
+ base_dn: |
+ Enter the Base DN of the subtree in LDAP you want OpenProject to look for users and groups.
+ OpenProject will filter for provided usernames in this subtree only.
+ Example: ou=users,dc=example,dc=com
+ onthefly_register: |
+ If you check this box, OpenProject will automatically create new users from their LDAP entries
+ when they first authenticate with OpenProject.
+ Leave this unchecked to only allow existing accounts in OpenProject to authenticate through LDAP!
+
connection_encryption: 'Connection encryption'
+ system_account: 'System account'
+ system_account_legend: |
+ OpenProject requires read-only access through a system account to lookup users and groups in your LDAP tree.
+ Please specify the bind credentials for that system user in the following section.
+ ldap_details: 'LDAP details'
+ user_settings: 'Attribute mapping'
+ user_settings_legend: |
+ The following fields are related to how users are created in OpenProject from LDAP entries and
+ what LDAP attributes are used to define the attributes of an OpenProject user (attribute mapping).
tls_mode:
plain: 'none'
simple_tls: 'simple_tls'