Why first LDAP logins to Redmine fail to create accounts
A directory user signs in successfully against LDAP, yet Redmine shows a generic failure and no account appears in the user list. The first login is the step that fails, because on-the-fly creation has to turn directory attributes into a complete Redmine user record in the same request. In core Redmine, the LDAP authentication source settings tell the application which directory attributes map to the login, first name, last name and email fields. On first sign-in, Redmine reads those attributes, creates the user, and only then completes the session. If any mapped value is missing, malformed or rejected by a validation rule, the user record is never saved, and the login returns a message that rarely names the attribute at fault.
The usual causes are small and specific. Attribute names in the authentication source are case-sensitive for the directory's schema, so a mismatch such as Mail where the directory returns mail leaves the email field empty. Accounts without an email address in the directory fail the user validation, and any required custom field on the user form that has no LDAP mapping blocks creation too. Confirm the attribute names against a real entry before changing anything, and confirm with your directory team whether every account that should sign in carries a mail value. The Redmine installation guide covers the authentication settings, but your own directory schema decides which values exist.
This page is for administrators and platform engineers who have LDAP sign-in working for existing accounts but see new staff fail on their first login. It is also for anyone deciding whether on-the-fly creation should stay enabled. Native LDAP support is part of core Redmine, so no plugin is needed for this path. Single sign-on through SAML or OpenID Connect is a separate question, handled by plugins or a reverse proxy, and it does not fix a directory attribute problem.
Which LDAP source settings affect on-the-fly account creation
This table compares the LDAP authentication source settings that decide whether a first sign-in creates a Redmine account and whether that account can be used. Read each row as a check to make against your own Redmine version, since menu labels and defaults differ between releases and should be confirmed there. The main takeaway is that a missing or mismatched attribute usually fails the login before any permission problem appears.
| Setting | When it fits | What breaks when it is wrong |
|---|---|---|
| Login attribute | Matches the name users type at sign-in, such as sAMAccountName for Active Directory or uid for OpenLDAP and FreeIPA | Lookups return no entry, so the login is refused and no account is created. Attribute names are case-sensitive in the directory query, so a mismatch in case can fail silently. |
| First name attribute mapping | Points to the directory attribute that holds the given name, usually givenName | If the attribute is empty or misnamed, the account is created with a blank or placeholder first name, which can cause later validation errors on profile edits. |
| Last name attribute mapping | Points to the directory attribute that holds the surname, usually sn | A missing value can block account creation because Redmine requires a last name on the user record, so the login appears to fail for no obvious reason. |
| Email attribute mapping | Points to the directory attribute that holds the primary mail address, usually mail | A user with no mail value in the directory cannot be saved with a valid address. Notifications and password recovery then fail, and the creation step may be rejected. |
| On-the-fly creation toggle | Enabled when you want directory users to get an account at first login without an administrator creating it | When disabled, valid directory users are refused with a message that looks like a wrong password. When enabled without the attributes above, accounts are half-built or never saved. |
| Account activation on creation | Set so new directory accounts are active at once, or left for administrator approval where your process requires review | Accounts created in a locked or pending state let users authenticate but not work, which looks like a permissions fault. Confirm the exact option name and default in your Redmine version. |
| Required custom fields | Only relevant if your administrators mark user custom fields as required | A required custom field with no matching directory value blocks account creation, and the error may not name the field clearly. Check the field list before enabling creation. |
| Attribute value encoding and multiple values | Single-valued attributes are the safe default for name and mail mapping | A multi-valued mail attribute or an unexpected encoding can produce an address Redmine rejects, so the first login fails even though the user exists in the directory. |
How to trace a failed first login step by step
This sequence reproduces a failed first LDAP sign-in, confirms what Redmine received from the directory, corrects the attribute mapping and proves that the account is created and reused on the second login.
Reproduce the failure with a test user
Pick a test account in the directory that has never signed in to Redmine, and confirm it is enabled, has a mail attribute and belongs to the group that is allowed to sign in. Attempt the first login from a browser in a private window, using the same LDAP authentication mode that production users will use. Record the exact time, the username typed and the message shown. Note whether the message is the generic invalid login notice or something more specific. You are done when the failure repeats on demand, so later checks compare against a known result.
Enable production logging for authentication
On the Redmine host, review the production log settings and make sure the log level records authentication activity without changing other configuration. Keep a separate copy of the log file, then reproduce the test login and capture the lines written during that attempt, using the timestamp recorded in the previous step. Look for the LDAP authentication entry, the attribute names Redmine tried to read and any exception text. Log lines differ between Redmine versions, so confirm the wording against your installed release before relying on a search string. You are done when you have a log excerpt that covers one complete failed attempt.
Query the directory entry with an LDAP search tool
From a host that can reach the same domain controller or directory server, run an LDAP search for the test user with the same bind method and base DN that the Redmine LDAP source uses. Ask for the attributes that the Redmine source maps for login, first name, last name and email, and note the exact spelling and letter case the directory returns. Attribute names are case-sensitive in the mapping fields, and a mail value may be empty for some accounts. You are done when you have the directory's real attribute names and values for the test user, written down side by side with the Redmine mapping.
Compare the mapping with the directory attributes
Place the Redmine LDAP source settings next to the directory output and check each mapped field. Confirm that the login attribute, the first name, last name and email fields match the directory spelling exactly, and that the email attribute returns a value for the test user. Also check whether Redmine requires any custom fields that the directory does not populate, since a required field left empty can block account creation. Correct the mismatch in the LDAP source, changing only the field that differs. You are done when every mapped attribute matches a value you saw in the directory search.
Retry the first login after the correction
Repeat the first sign-in with the same test user from a private browser window, then check the Redmine user list in the administration area. A new account should exist with the directory login, name and email, and its authentication source should point to the LDAP source. Review the production log for the same attempt, confirming that the error is gone and that no new exception appears. If the account is still missing, go back to the log excerpt and the directory output rather than changing several settings at once. You are done when the first login succeeds and the account is visible to an administrator.
Confirm the second login reuses the account
Sign out, then sign in again with the same test user. The second attempt should succeed without creating a duplicate account, so check the user list for a single entry with that login. Confirm that the account keeps the same identifier and that the mapped name and email still match the directory. If a second account appears, stop and check whether the login name was changed by case or by a different attribute between attempts. You are done when one account exists, the second login succeeds and the record matches the directory values.
Why case-sensitive attribute names break account creation
When Redmine creates an account on first LDAP login, it reads each directory attribute named in the authentication source's attribute mapping and copies the value into the matching user field. Those names are matched exactly. If the mapping says Mail but the directory returns mail, or it says givenName where the entry uses a different spelling, Redmine does not raise an error for that field. It leaves the field empty. The login can still succeed, and the user is then rejected later for a missing email or name, so the failure appears somewhere other than the mapping that caused it. Treat every blank field after a first login as a mapping mismatch until proven otherwise.
The naming differs by directory. Active Directory usually exposes the login name as sAMAccountName, the email as mail and the display name as displayName, but the attribute names it returns can vary with the schema and with which fields are populated. OpenLDAP and FreeIPA commonly use uid for the login name, with mail, givenName and sn for the email and name fields. Attribute names are not case-normalized by Redmine, so a mapping copied from a forum post or from another directory can look right and still return nothing. Do not assume the names from memory or from documentation for another product.
Confirm the names before editing the mapping. Pick one account that logs in successfully at the directory level, then run an LDAP search against that single entry with a bind account you already trust and request all user attributes, using ldapsearch with the entry's DN or a unique login filter. Record the attribute names exactly as the server prints them, including capitalization, and compare them one by one with the mapping fields in the Redmine administration screen for the authentication source. Test the corrected mapping with a new test user rather than an existing account, because an account created with empty fields keeps them until an administrator edits it.
Common causes of account creation errors
When Redmine creates an account on the first LDAP login, the directory entry has to supply everything the local user record requires. Most failed first logins trace back to one of the six causes below, and each one shows up with a different symptom, so start with the message the user sees and work toward the directory.
Missing or empty mail attribute
Redmine needs an email address before it can save a new user, and the LDAP mapping for mail is where this breaks most often. If the directory entry has no mail value, or the attribute is named differently in your schema, the user sees a generic login failure. Check the mail mapping in the authentication source, then search the user's entry with ldapsearch and confirm the attribute returns a non-empty value.
Required custom fields left empty
Any custom field marked as required for users in Redmine must have a value before the account is saved, and LDAP can only fill it if an attribute is mapped to it. A field with no mapping stays blank, so the account fails validation even though the login itself succeeded. Compare the required user custom fields in administration with the attribute mappings on the LDAP source, and either map each field or make it optional.
Attribute mapping typos
Attribute names in the LDAP source are case-sensitive in the way your directory returns them, so givenName and givenname may not behave the same across tools and schemas. A single misspelled name leaves the field empty without raising an obvious error. Copy each attribute name directly from the raw ldapsearch output for a test user instead of typing it from memory, then retest the login.
Login name collision with an existing account
If a local Redmine account already uses the same login, the directory user cannot be created as a new record, and the sign-in fails even though the password is correct. This often happens after a user was created by hand, imported earlier, or belonged to another authentication source. Search the users list for the login, confirm whether it belongs to the same person, and decide whether to link, rename or remove the older record before the next attempt.
Missing first or last name
Redmine requires both a first name and a last name on each user record, so a directory entry that stores only a display name or only one of the two attributes will fail creation. Service accounts, contractors and some legacy entries are the usual sources. Confirm that the givenName and sn attributes, or the attributes you mapped for them, return values for the failing user before changing any Redmine setting.
Blocked by group or filter restriction
When the LDAP source limits sign-in with a filter or group condition, a user outside that scope never reaches account creation, and the message can look the same as a wrong password. Run the source's filter against the user's distinguished name with ldapsearch. If the user is missing from the result, the problem is membership in the allowed group, not Redmine's user creation.
Why Redmine error messages point away from the real cause
When on-the-fly creation fails, the browser often shows less than the server knows. A user may see a general login failure, or a validation message about a field they never typed, such as an email address or a required custom field. That second case is the misleading one: Redmine reuses the new account form to report problems with the account it tried to build from the directory entry, so the message describes the form rather than the LDAP attributes that populated it. Treat the browser message as a symptom, not a diagnosis.
Work from the server side instead. Reproduce the failed login, then read the Redmine production log around that timestamp for the attempt, and note which user record or attribute the failure names. Next, pull the same user's entry from the directory using the same search settings Redmine uses, and compare each attribute Redmine maps against what the entry actually contains. A mismatch in attribute name, a blank value or a value that fails a Redmine validation rule will usually show up in that comparison within a few minutes. Confirm the exact log location and level for your installation against the Redmine installation guide, since they depend on how you deploy.
Plan for this during rollout rather than during the first incident. Ask the team that owns the directory which attributes are populated for every account that should sign in, and test with a representative sample of accounts, including contractors and accounts with unusual name formats. Keep a short record of each failure you reproduce, the log entry, the attribute involved and the fix, so that the next person does not restart the investigation from the browser message.
How a first LDAP login flows from the browser to a new Redmine account
The diagram starts with the user submitting credentials in the browser and follows the request into Redmine's authentication source. Redmine binds or searches the directory, maps the returned attributes onto a new user record, and validates that record before saving it. The trust boundary sits between Redmine and the directory, and the log entry is written in Redmine as the login completes or fails. When a first login fails, check the mapped attributes and the validation step first, since those are where the error message is usually generated.
Request path for a first LDAP login, with the trust boundary and log write point marked.
Security points when tracing directory traffic
Tracing why a first LDAP login fails usually means turning up logging and inspecting directory queries, which can expose credentials and personal data. The cards below cover the controls that keep that diagnosis from creating a new security problem. Apply them together, and remove any temporary tracing as soon as the fix is verified.
Log queries without credentials
Capture the search filter, base DN, requested attributes and result codes, but never the user's password or the bind credential. When you inspect a failed login, confirm that the log line shows the attribute names Redmine sent, such as mail or sAMAccountName, and that the password field is masked or absent. Redact employee identifiers and email addresses before you share a log excerpt with a vendor, a colleague or a ticket.
Restrict who reads production logs
Debug output from a failed first login can include usernames, group memberships and directory structure. Limit read access to the Redmine log files and the host's log store to the operators who are working the incident, and record who opened them. Confirm that log shipping to a central platform keeps the same restriction, because copies in a shared index are easy to overlook.
Trace over LDAPS only
Simple binds and search results sent over plain LDAP on port 389 expose the bind password and directory data to anyone on the path. Point the Redmine LDAP source at LDAPS on port 636 while you trace, and confirm the certificate chain is trusted by the Redmine host. Avoid packet captures of cleartext LDAP as a debugging shortcut, since a capture file holds the same secrets as the wire.
Revert debug logging after the fix
Verbose Rails and LDAP logging slows the application and keeps sensitive detail on disk long after the incident is closed. Once the first login succeeds, set the log level back to the production default, restart Redmine so the change takes effect, and delete any temporary capture files. Record the change in your ticket so the next reviewer knows the verbose setting was intentional and is no longer active.
Scope the stored bind credential
If Redmine binds with a service account to search for users, that password is stored in the Redmine configuration. Use a read-only account limited to the search base that Redmine needs, not a domain administrator. Check who can read the configuration file and the database backups that include it, and rotate the password if it appeared in a log, a screenshot or a support message during troubleshooting.
Questions teams ask before fixing LDAP account creation
How long does diagnosing a failed LDAP account creation usually take?
The time depends less on Redmine than on how many layers are involved: the Redmine LDAP authentication source settings, the directory schema and attribute names, the account's own attributes in the directory, and any required custom fields in Redmine. A single cause, such as a wrong attribute name for the login or mail field, can often be confirmed quickly once the directory response is visible. Teams with several directories, delegated administration or no access to a test account usually need longer, because each check waits on someone else. Ask any provider to state which of these layers they will test and what access they need before giving an estimate.
Can our internal administrators fix this without outside help?
Often yes, if one person can edit the LDAP authentication source in the Redmine administration area, read the Redmine production log, and run a directory search from a host that can reach the domain controllers. The work is mostly methodical: confirm the login attribute and mail attribute names match what the directory actually returns, check whether the account has an email value, and confirm that any required custom field has a default or is filled during sign-in. Outside help is most useful when the directory team restricts search access, when the problem only appears for some users, or when the same symptom has already been tried several times without a clear cause.
What does the work need from the directory team?
The directory team is needed for facts that only they can see, and the requests are usually small:
- A bind account or dynamic bind method that can search the relevant base DN, with the exact distinguished name format confirmed.
- A test user account, ideally a disabled or non-production one, whose attribute values can be read without changing anything.
- Confirmation of the attribute names in use, including whether the directory is Active Directory, OpenLDAP or FreeIPA, since login attributes and mail attributes differ between them.
- Read access to directory-side logs or a time window when the test logins are made, so that search requests can be matched to Redmine log lines.
Ask the directory team to confirm any change to access policy before work starts, so that the troubleshooting does not trigger lockouts.
What does a fixed-scope LDAP troubleshooting engagement cover?
A fixed-scope engagement usually covers a defined set of symptoms, a defined set of directories and Redmine instances, and a written list of outputs. Typical items are reviewing the authentication source configuration, tracing the directory search and bind traffic for a named test user, identifying the attribute mismatch or missing value, recommending the change, and verifying a successful first login with account creation. The scope should state whether testing covers only the listed user types, whether custom field defaults are changed, and whether documentation is delivered. Cost is driven by the number of directories, the number of failure cases, how much directory-side access is available, and whether a retest is included. Ask for a written scope and quote before work starts.
Are existing Redmine accounts affected by the fix?
Existing accounts are usually unaffected when the fix changes only how new logins are mapped, because Redmine already holds those accounts and their authentication source link. The risk comes from changes that alter the login name, the mail address or the authentication mode, since a changed attribute can make a returning user appear as a new account or fail to match an existing one. Before changing anything, export the current user list, note which accounts use the LDAP source, and test the fix with one existing user and one new user. Confirm the exact behavior in the Redmine version you run, because account matching rules depend on settings.
Will the LDAP fix survive a Redmine upgrade?
A configuration fix normally survives an upgrade because it lives in the authentication source settings and the database, which the upgrade procedure carries forward. The Redmine upgrade guide calls for backing up the database and uploaded files, copying configuration to the new installation, and running the database migration and plugin migration steps. What can break is an LDAP plugin or a custom field change that depends on a specific Redmine version, so check plugin compatibility with the target release before upgrading. Redmine 7.0.x is the fully supported line, so plan upgrade testing against that release and retest one new and one existing LDAP login after each upgrade.
Why do first LDAP logins fail with misleading error messages?
Redmine often reports a generic login failure when account creation fails after a successful bind, so the message does not name the missing attribute or required field. The usual causes are an attribute name that differs in case or spelling from what the directory returns, a mail value that is empty, or a required custom field that Redmine cannot fill during on-the-fly creation. To find the real cause, read the production log for the failed request and compare the attributes returned by a directory search for the same user. Treat the log line as the authority, not the message on the sign-in page.
How DeployOpen troubleshoots Redmine LDAP account creation
DeployOpen approaches on-the-fly LDAP account creation as a traced problem, not a guess: we reproduce the failed first login, compare what the directory returns with what Redmine expects, and fix the mapping and settings in your environment. Work is planned as a fixed-scope engagement against your own Redmine and directory.
How we scope
- We confirm which directory you use, which login attribute users sign in with, and whether first logins fail for every user or only some.
- The written scope names the Redmine version, LDAP mode, attribute mapping and test accounts we will check.
- Engagements are fixed-scope, with deliverables and timelines agreed in writing before work starts, and no quote is issued without that scope.
How we build
- We capture directory traffic for a failed login and compare returned attribute names, case and values with the Redmine LDAP source settings.
- We correct attribute mapping, required fields and custom field defaults, then test the first login with accounts that have complete and incomplete directory entries.
- We document each change, the trace evidence behind it and the error messages that pointed to the cause, so your team can reproduce the diagnosis.
How we hand over
- You receive a written runbook covering the working configuration, test accounts, and the steps for tracing a failed directory login.
- We walk your administrators through the Redmine logs and the directory queries used, so they can handle the next incident themselves.
- Known limits, such as settings that only apply to new accounts, are listed so your team knows what to confirm after future changes.
How we support
- Ongoing support, upgrades and continuous testing are available as retainers, including checks after Redmine upgrades or directory changes.
- Authentication changes can be retested after each Redmine upgrade, since the login path and plugins may change between releases.
- Please ask for a quote built from the written scope. DeployOpen does not publish a price list.

