Redmine LDAP dynamic bind with $login

Dynamic bind lets Redmine check each user's password by binding to the directory as that user, so no service account password is stored in Redmine. It has limits for account creation and searching that teams must plan for.

On this page

Why Redmine LDAP dynamic bind avoids a stored service account password

Dynamic bind lets Redmine check a password without holding a directory password of its own. A security team that does not want a service account password saved in the Redmine database or configuration can set the account field of the LDAP authentication source to the placeholder $login. When someone signs in, Redmine substitutes the username they typed into that placeholder and binds to the directory as that user, using the password they entered. Redmine authenticates against LDAP natively, so this is a setting inside the authentication source and needs no plugin.

The feature answers one question: can this person prove their identity to the directory? It does not give Redmine a standing identity for reading the directory. Any lookup that runs before or alongside the bind, such as finding a user record, reading attributes for account creation, or resolving group membership, runs with the rights the signing-in user holds, and those rights are often narrower than the Redmine team expects. That gap decides whether a service account is still needed. Confirm with your directory team which attributes Redmine must read at first login, whether ordinary users can read them, and whether users can bind against the domain controllers or directory servers Redmine will reach. Test with a non-administrative account before rollout.

Make this choice before go-live, because it shapes how accounts are created and what happens when a password changes. Users who first sign in through an LDAP source are recorded against that source, so changing the design later means reviewing those accounts again. Write down the bind pattern, the directory account type, and who approves any service account exception, so the security review and the operations runbook describe the same setup. If the design avoids a stored secret, record that the Redmine installation holds no directory credential. If a stored account is unavoidable, it needs a named owner, read access limited to what logins require, and a rotation plan.

Dynamic bind or a service account search: which option fits

This table compares binding to LDAP as the signing-in user with a service account that searches the directory first, covering what is stored, how login names resolve and whether accounts can be created on the fly. Read each row against your directory's permissions, which you should confirm with your directory administrators before choosing. The main takeaway is that dynamic bind avoids a stored password only when the user's own credentials can locate their entry.

Decision pointDynamic bind as the userService account search, then bind
Stored passwordNo directory password is stored in RedmineA service account password is stored in Redmine configuration
How the login name is resolvedThe typed name is inserted into the DN template, so it must match the exact format the directory expectsRedmine searches for the entry using the login attribute, so partial or alternate names can still resolve
Login name formatsUsually limited to one format, such as a full DN or user principal name, depending on directory setupCan accept several attribute values, such as sAMAccountName or an email address, if the search filter allows it
On-the-fly account creationWorks only if the attributes Redmine needs are readable with the user's own credentialsGenerally more reliable, because the search can read the attributes before the user binds
Directory read permissions neededThe signing-in user must be able to read their own entry and the attributes Redmine mapsThe service account needs read access to search the base DN and the mapped attributes for all users who sign in
Anonymous readsNot required, but the user's own entry must not be hidden from themOften unnecessary if the service account has read access, which should be confirmed with directory administrators
Group-based login restrictionHarder to enforce, since the filter cannot be checked before the bindEasier to apply, because an LDAP filter can be checked during the search
Operational riskFewer secrets to rotate and fewer accounts to auditThe service account password needs rotation, monitoring and restricted use
When it fitsSimple single-directory setups with consistent login formats and no need to searchMultiple login formats, group restriction or account creation for many users, with a documented service account

How a $login bind flows from sign-in to Redmine account

The flow starts when a user submits a login and password on the Redmine sign-in form. Redmine's LDAP authentication source builds the bind identity by substituting the submitted login into the account template, then sends the password to the directory as a bind request. The directory sits across the trust boundary and answers only accepted or refused. The password crosses that boundary but is never written to the Redmine database. If the bind succeeds, Redmine checks whether a local user record exists and either signs the user in or, where on-the-fly creation is enabled, creates one. When sign-in fails, check the template and the directory's answer first.

Password passes through to the directory, and Redmine stores only the local account.

Account formats Active Directory accepts for dynamic bind

The user principal name (UPN) format builds the bind identity from the name the user types plus a domain suffix, such as jsmith@example.com. In a dynamic bind, Redmine substitutes the text the user entered into the $login placeholder, so a bind template like $login@example.com expands to the UPN the directory expects. This format is often the closest match to how people think about their sign-in, and it does not require the user to know the directory structure. It fits best when the UPN suffix in Active Directory matches the template exactly and the user's login name is unique across the forest.

  • Placeholder expansion: $login is replaced with the typed name, so $login@example.com becomes jsmith@example.com.
  • Suffix must match: The suffix must be a UPN suffix registered in the forest, not just a DNS name that resembles it.
  • Multiple suffixes: Domains with several UPN suffixes need a decision about which one users sign in with.
  • Typed input: Users who type the full UPN would produce a doubled suffix, so decide whether the login form accepts that.
  • Test first: Run a bind with a known account and confirm it succeeds and that a wrong password fails.

Confirm the exact UPN suffixes your forest accepts with your directory administrators before you commit to this template.

Where on-the-fly creation and searching break under dynamic bind

Dynamic bind only proves that a password is correct. When Redmine binds as the signing-in user, the directory answers one question: can this distinguished name and password authenticate? Redmine gets no standing identity it can use to query the directory on its own behalf. It cannot search for other users, list members of a group, or resolve a login name to an entry it has not already seen with that user's credentials. Anything that depends on looking someone up before they sign in, such as an administrator typing a login into the user form or a background job refreshing attributes, needs a directory identity that is separate from the user. That gap is the main reason a service account is still needed for many setups, and it should be decided before the first user signs in, not after.

On-the-fly account creation is the place where this limit shows up first. Redmine builds the new local account from attributes it reads during the successful bind, so those reads run with the user's own rights. Directories are often configured so that ordinary users can read their own entry but not the mail, display name or custom attributes of other fields the Redmine form expects. If a mapped attribute is hidden from the bind identity, the account is created with an empty value or the attempt fails, and the administrator sees a login problem rather than a directory permissions problem. Confirm with the directory team, using a regular user account rather than an administrator, which attributes the mapping needs and whether the user can read each of them.

Required fields in Redmine add a second blocker. Custom user fields marked as required, or a mail address that the instance validates strictly, can stop the account from being saved even when authentication succeeded. Review every required user field and its default before enabling on-the-fly creation, and decide which ones the directory will supply and which must be filled by an administrator afterward. Troubleshooting these failures is covered in the sibling topic on on-the-fly LDAP user creation, so this section only sets the design expectation: creation under dynamic bind is limited to what a signed-in user can read about themselves.

How to configure the LDAP source for dynamic bind

This sequence turns a directory account format you have already tested into a working Redmine LDAP source that authenticates users by binding as themselves, with on-the-fly account creation set deliberately. It ends with a verified sign-in by an ordinary user and a matching account record.

  1. Confirm the directory endpoint and encryption

    The Redmine administrator, working with the directory team, confirms the host name, port and transport the server will use, such as LDAPS on 636 or StartTLS on the standard LDAP port, and confirms that the Redmine host trusts the certificate chain of the domain controller or directory server. Do not proceed with plain LDAP for user passwords. The check is that a directory client on the Redmine host can open an encrypted connection to the chosen endpoint and receive a certificate that validates against the internal CA.

  2. Confirm the bind identity format outside Redmine

    Before touching Redmine, test the account template with a command-line LDAP client from the Redmine host. Substitute a real test user's login name for the placeholder and try the format your directory expects, such as a user principal name in the form user@domain for Active Directory or a full distinguished name for OpenLDAP or FreeIPA. The check is that the test bind succeeds with the correct password and fails with a wrong one, which confirms the format and that the directory returns the expected error for bad credentials.

  3. Create the LDAP authentication source

    In the Redmine administration area, an administrator opens the authentication modes section and adds a new LDAP authentication source. Enter a name that staff will recognize, the host, port and encryption option confirmed earlier, and the base DN for user searches if the source will also be used for on-the-fly creation. Leave the account template field for the next step. The check is that the source appears in the list and the connection test in the form reports success.

  4. Enter the account template containing $login

    In the account field of the LDAP source, enter the bind format from the test, with the literal token $login where the signing-in name belongs. For example, a UPN-style template places $login in front of the domain suffix, while a DN-style template places it inside the user's common name or uid attribute. Redmine substitutes the typed login name and binds with the user's own password, so no service account password is stored. The check is that the template, with $login replaced by a test name, matches the string you verified in step two exactly.

  5. Set the login attribute and attribute mapping

    Still in the source form, set the attribute the directory uses for the login name, such as sAMAccountName for Active Directory or uid for OpenLDAP and FreeIPA, and map the first name, last name and email attributes to the names your directory uses. Attribute names are case sensitive in the directory, so copy them from the directory schema or the test output rather than from memory. The check is that a search for one known user with the same attribute names returns values for all mapped fields.

  6. Decide on-the-fly account creation

    Choose whether Redmine creates an account the first time a directory user signs in. Enable on-the-fly creation only if the mapped attributes always include a valid email address and any custom fields Redmine requires are either optional or can be filled from the directory. Otherwise, leave it disabled and create accounts manually, so that failures are visible to administrators. The check is that the option matches the written access decision for this deployment and that the required-field list has been reviewed with the team that owns the directory.

  7. Test sign-in with a non-administrator account

    Sign out of the administrator session and sign in at the Redmine login page as an ordinary directory user, selecting the new LDAP source if the login form offers a choice. Use a password that is only known to that user, not the administrator's. The check is that the sign-in succeeds, the user reaches a page they are allowed to see, and the Redmine administration area lists a user record with the expected login name, email and authentication mode. If sign-in fails, check the Redmine log for the directory response before changing the template.

Security considerations of binding as the signing-in user

Binding as the signing-in user removes the stored directory password, but it moves trust to the directory's own controls. The cards below cover what that shifts in password policy, transport, input handling, logging and offboarding, and what to check in your Redmine and directory settings before go-live.

No stored directory password

With dynamic bind, Redmine does not keep a service account password in configuration.yml or the database. The trade-off is that every sign-in sends the user's own password to the directory, so the secret is exposed on each login rather than once at setup. Confirm that no bind account remains configured for user lookups, and record which features, such as on-the-fly account creation, still depend on one.

Directory password policy and lockout

Redmine checks the password against the directory, so the directory's lockout threshold, password complexity and expiry rules now govern Redmine logins. Repeated wrong passwords from Redmine can lock an account in Active Directory or OpenLDAP. Ask the directory team for the lockout settings in advance, and decide whether Redmine's own login failure handling should be reviewed alongside them.

LDAPS or StartTLS for credentials

A simple bind sends the password to the directory server, so the connection must be encrypted. Use LDAPS on port 636 or StartTLS on the standard port, and verify the server certificate against your internal certificate authority. A plain LDAP connection on port 389 without encryption exposes the signing-in user's password on the network, so treat it as unacceptable for production.

Escaping the login template value

Dynamic bind builds the bind DN from the login name typed by the user, so a value containing LDAP special characters can change the DN being bound. Redmine's LDAP settings use the $login placeholder, and the value should be escaped for DN syntax, with the login restricted to expected characters. Test with names containing commas, equals signs, backslashes and wildcards before you rely on the template.

Audit trails on both sides

A successful or failed sign-in appears in Redmine's own logs and in the directory's event or access logs, but each records different fields. Redmine shows which account signed in, while the directory shows the bind attempt and any lockout. Confirm where each log is kept, how long it is retained, and whether the two can be matched by username and time when investigating an incident.

Offboarding through the directory

Because Redmine checks the password on each attempt, disabling or deleting the account in the directory stops new sign-ins at once. Existing Redmine sessions and API keys are separate, so they must be revoked in Redmine as part of offboarding. Document both steps in the same runbook, and test that a disabled directory account can no longer open a session.

When a service account is still needed

Dynamic bind removes the stored password only for the sign-in itself. Once Redmine has verified a user's credentials by binding as that user, it has no directory read rights beyond what the user's own entry allows. That is enough for simple authentication, but several common needs fall outside it. Searching for users by name or group, syncing attributes such as email or department onto existing accounts, and restricting login to members of a directory group through a filter that reads another object all require the directory to answer queries the user may not be permitted to make. When those needs exist, a read-only service account is still the practical choice, and the decision should be made with the directory team, not by the Redmine administrator alone.

Keep the service account narrow, separately credentialed and documented. Grant it read access only to the user and group containers Redmine must query, with no write permissions and no membership in privileged groups. Give it a dedicated name that identifies its purpose, and store its password in a secrets mechanism your organization already audits, with a rotation owner and a schedule written down. Confirm with the directory team whether the account can be restricted from interactive logon, and whether its password can be changed without disrupting the Redmine service. Record which Redmine settings depend on it, so that a rotation or directory change does not silently break sign-in for every user.

Review the account whenever the Redmine requirements change. Each new feature that depends on directory reads, such as a group filter, attribute sync or scheduled account maintenance, should trigger a check that the account still has only the rights it needs. Ask the directory team to confirm the exact attributes and containers the account can read, and test that a user outside the permitted group is still refused. Because the account can read directory data for every Redmine user, treat its access logs and failed bind attempts as part of your normal review, and remove the account entirely if the feature that required it is retired.

Questions teams ask about dynamic bind effort, cost and what they must provide

Can we set up Redmine LDAP dynamic bind without outside help?

Yes, if you have a Redmine administrator who can edit the authentication source and a directory administrator who can confirm the account format, search base and attribute names. The configuration itself is a few fields in the Redmine administration area. The work that usually takes longer is testing: confirming that each user's bind succeeds, that the login attribute matches what people type, and that failed logins produce useful log entries. Teams without a directory specialist often find that part is where outside help saves the most time.

What makes dynamic bind effort go up or down?

The main drivers are the shape of the directory and how much Redmine needs to know about each user. Effort rises with:

  • Several domains or forests, each needing its own authentication source
  • Users who sign in with different name formats, such as a short name, a user principal name or a mail address
  • Attributes that must be copied into Redmine, such as first name, last name, mail and custom fields
  • Requirements to create accounts on the fly for first logins
  • Complex testing, including failover to domain controllers and LDAPS certificate checks

A single domain with one login format and a short attribute list is the simplest case.

What do we need to provide from the directory team?

Ask the directory team for the following before work starts:

  • The directory server names and whether LDAPS on port 636 is available
  • The base distinguished name that contains the users who should sign in
  • The attribute that holds the login name your users type
  • Confirmation of the bind format the directory accepts for a user signing in
  • The attributes for name and mail, and how they are populated
  • A test account in a known state, plus a group or filter if only some users may sign in
  • A change window or contact for testing against live domain controllers

If the directory team cannot confirm these details, the configuration will be guesswork.

How long does testing usually take for dynamic bind?

No supplied figure gives a reliable duration, so treat any number you see as a guess until the scope is written. Testing time depends on how many domains and login formats must work, how many user types need to be checked, and whether the directory team must approve each change. A single directory with one login format usually needs a short test cycle. Several domains with account formats that differ by department take longer because each format needs its own sign-in test. Ask the vendor for the testing steps in the written scope and the number of environments they will test in.

Does Redmine itself have a licence cost for LDAP authentication?

No. Redmine is released under the GNU General Public License v2 and has no paid edition, so LDAP authentication support is part of the free software. The costs you will pay are for hosting, implementation time, any plugins you choose, upgrades and the people who maintain the system. Licence cost should not be the deciding factor when you compare options. Ask each provider to show which costs are one-time and which recur each year.

What should we ask for in a dynamic bind quote?

A useful quote follows from a written scope, so ask for the following:

  • The directories, domains and login formats in scope
  • The attributes to map and whether on-the-fly account creation is included
  • The testing plan, including who performs it and which environments are used
  • Handover documents, including the configuration record and a runbook for password or account changes
  • What is one-time work and what is ongoing support or retainer work
  • Assumptions about access, change windows and directory team time

Ask for a fixed-scope proposal where possible, so changes to the scope are visible.

Will a service account still be needed after we switch to dynamic bind?

Often yes, though not always for sign-in itself. Dynamic bind lets Redmine authenticate each user with that user's own credentials, so no stored service password is needed for the login step. A service account can still be needed for other tasks, such as searching the directory for users when creating accounts, listing members or syncing attributes. Confirm with the directory team which lookups Redmine must perform and whether those lookups are allowed under the user's own credentials.

How DeployOpen scopes and delivers Redmine LDAP authentication

DeployOpen plans and builds the Redmine LDAP dynamic bind with $login setup inside your own infrastructure, starting with a written scope that states whether a service account is needed at all. The work covers directory format, login behavior, testing against your real directory and a handover your team can run without us.

How we scope

  • Confirm which directory you run (Active Directory, OpenLDAP or FreeIPA) and the account name format users type at sign-in.
  • Decide whether users may be created on the fly at first login and which directory attributes must map to Redmine fields.
  • Record in the written scope whether a bind account stays, which searches it performs, and who approves that decision.

How we build

  • Configure the LDAP authentication source in Redmine with the $login placeholder and test the bind path against a non-production directory first.
  • Verify LDAPS, certificate trust and the search base with directory queries, so failed logins can be traced to a specific setting.
  • Check on-the-fly account creation with test users that cover missing email addresses and required custom fields.

How we hand over

  • Deliver the final configuration, the test cases used and the directory queries your team can rerun after changes.
  • Document which login behaviors depend on a service account, so future directory or Redmine upgrades keep the same security decision.
  • Walk your identity and Redmine administrators through troubleshooting steps for the most common sign-in failures.

How we support

  • Engagements are fixed-scope, with scope, deliverables and timelines agreed in writing before work starts.
  • Ongoing support, Redmine upgrades and continuous testing are available as retainers if your directory or Redmine version changes.
  • Ask any quote to itemize directory testing, Redmine configuration, handover and any retainer separately.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.