ERPNext SSO and identity integration

How to connect ERPNext to Active Directory, OpenLDAP, Microsoft, Google or a custom OpenID Connect provider, map groups to roles, keep a local admin fallback and verify the result.

On this page

ERPNext SSO and identity integration: what your team must decide first

ERPNext supports two login paths: LDAP against Active Directory or OpenLDAP through LDAP Settings, and Social Login Keys for Microsoft, Google or custom OpenID Connect providers. The login screen is the easy part. The hard part is deciding how identity groups become ERPNext roles and permissions, and how you keep a way back in if the identity provider fails. An ERP that holds ledgers, bank-related postings and stock valuations must follow your joiner, mover and leaver process, so a person who changes teams or leaves the company loses access to the right documents on the same day. Because ERPNext maps LDAP groups to roles at each login, a wrong group in the directory becomes a wrong permission in the ledger within minutes of the next sign-in.

Several decisions need an owner before anyone opens LDAP Settings. First, which system is the source of truth for each person and group, and who can change group membership. Second, which ERPNext roles and user permissions each directory group should carry, including whether finance approvers, stock controllers and system managers are ever granted by group at all. Third, what happens to users who exist locally but not in the directory, and whether Social Login Keys will be used alongside LDAP or instead of it. Confirm with your identity team how deprovisioning is enforced, because a disabled directory account does not by itself end an active ERPNext session or an API key that a user created.

Keep at least one local administrator account that does not depend on the identity provider, and store its credentials under your break-glass procedure with access logged. Test that account before go-live, along with a documented path to re-enable LDAP or the social provider after an outage or a misconfiguration. Ask your ERPNext partner or internal team to confirm the exact LDAP and social login fields for your ERPNext version against the ERPNext LDAP integration documentation and the Frappe Social Login Key guide, since login settings change between releases.

Choosing LDAP or Social Login Keys for your identity provider

Choose LDAP when your users already live in Active Directory or OpenLDAP and your security team expects passwords, lockout and disablement to be enforced in that directory. ERPNext does not hold these passwords. At login, the user's credentials are checked against the directory through the LDAP Settings configured in ERPNext, and SSL/TLS options protect the bind. Roles are not assigned by hand in ERPNext for each user. The directory group membership is mapped to ERPNext roles, and that mapping is applied again at each login, so a removed group membership takes effect on the next sign-in.

  • Authentication source: the directory itself, with the service account used for binding and searching.
  • Role source: directory groups, mapped to ERPNext roles in the LDAP Settings group mapping.
  • Admin maintenance: the service account credentials, the group-to-role mapping when your directory structure changes, and TLS certificate renewal.
  • Offboarding: disabling the directory account blocks ERPNext login, but existing sessions and API keys must be reviewed separately.
  • Coverage: confirm with your directory team how nested groups and OpenLDAP schema differences will appear in the mapping.

Check that the mapping has an explicit default for users in no mapped group, and test with accounts from each group before you rely on it.

How a Frappe login is handled by LDAP or a social provider

The flow starts at the ERPNext login page, where the user's request either goes to the LDAP server for a bind and group lookup, or to an external provider through an OAuth or OpenID Connect redirect and token validation. Both external paths cross the trust boundary before ERPNext creates a session and applies roles. The local admin path skips the provider entirely, so it should be tested and documented separately. Check which groups map to which roles and confirm the admin path works before enforcing SSO.

Login paths into ERPNext, with the identity provider boundary marked.

Decisions and trade-offs for ERPNext identity

This table compares the main identity decisions for a self-hosted ERPNext: LDAP versus OpenID Connect social login, group-driven roles, self-registration, LDAP transport security and local admin accounts. Read each row for when the option fits and what it costs to run later, such as directory dependencies, role drift or account sprawl.

DecisionWhen it fitsOperational cost and trade-off
LDAP login versus OIDC social loginLDAP fits sites where Active Directory or OpenLDAP is the source of truth and staff sign in with directory credentials. OIDC fits sites that already run Microsoft, Google or a custom identity provider for single sign-on.LDAP ties sign-in to directory reachability and service account health. OIDC ties sign-in to the provider's token endpoints and app registration, so client secret rotation and redirect URL changes must be tracked.
Group-driven roles versus manual role settingGroup-driven mapping fits organizations with stable role groups in the directory and a named owner for those groups. Manual setting fits small user counts or where access is reviewed case by case.Group mapping runs at each LDAP login, so directory changes flow into ERPNext automatically. Manual setting causes role drift when people change jobs, and group mapping causes surprises if a broad group is granted a powerful ERPNext role.
Self-registration for social usersClosed registration fits finance, payroll or manufacturing sites where every account must be created by an administrator. Open registration fits low-risk portals where users need no internal roles.Open registration creates accounts for anyone who can authenticate with the provider, which leads to account sprawl. Closed registration adds an admin task for each new hire and needs a joiner and leaver process.
TLS mode for LDAPLDAPS or StartTLS fits any production deployment, because directory bind credentials and user passwords cross the network. Plain connections fit only isolated test labs.Certificate chain handling must be maintained for the directory CA. Certificate expiry or a missing internal CA certificate on the ERPNext server stops logins, so confirm the setting with your directory team before go-live.
Number of local admin accountsTwo named local administrator accounts with strong, vaulted credentials fit most sites, so that an administrator can recover access when the identity provider is down.Each local account is a standing credential that needs review, password rotation and two-factor authentication. Too many accounts create sprawl, while none leaves no way in during an outage.

How to build LDAP login with group to role mapping

This sequence takes ERPNext from a version check to working directory login, with group to role mapping, a tested default role and a Social Login Key for any OAuth or OpenID Connect provider. Each step ends with a check you can record before the next step starts.

  1. Confirm the ERPNext version and LDAP Settings

    The platform team confirms which ERPNext and Frappe Framework version is running on the site, and that the LDAP Settings document is available in the desk. Use the version listed in your own environment, and check it against the supported versions page before you change authentication, since the support status of your version determines whether you can rely on vendor fixes. Confirm the version with the site administrator rather than assuming it from the installer. The step is done when the LDAP Settings page opens for a System Manager account and you have written down the exact version string for the change record.

  2. Create a read-only directory service account

    The directory administrator creates a dedicated service account in Active Directory or OpenLDAP that ERPNext uses only to search for users and read group membership. The account needs read access to the user search base and the group objects, and no write permissions or membership in privileged groups. Store its password in your secrets manager, not in a shared document. The step is done when a directory query run with this account returns a sample user and the groups that user belongs to, and when the account has been confirmed as unable to modify objects.

  3. Set the server URL and SSL/TLS options

    In LDAP Settings, the administrator enters the directory server URL, the base search path for users and groups, and the SSL/TLS option the directory requires. Use an encrypted connection in production, and load the internal certificate authority into the ERPNext host trust store if the directory uses a private CA. Confirm the exact field names and certificate handling in the ERPNext LDAP integration documentation for your version. The step is done when the settings save without a connection error and the server certificate validates from the ERPNext host.

  4. Test the bind with a non-admin user

    The administrator signs in to ERPNext with a standard directory user who has no privileged directory rights, using the LDAP login path. The goal is to prove that authentication works for ordinary staff before any mapping is trusted. Watch the Error Log and the user's login history for failed binds, wrong search filters or certificate errors. The step is done when the test user logs in, a new or matched User record appears in ERPNext, and that user can open the desk without administrator access.

  5. Define group to role mapping and default role

    The IAM or ERP owner maps each directory group to the ERPNext roles it should receive, using the group mapping table in LDAP Settings. Set a default role for any user who belongs to no mapped group, and keep that default as narrow as possible. Review roles that grant broad access, such as System Manager, and map them only to a small administrative group. ERPNext maps groups to roles at each login, so a removed group membership removes the role on the next sign-in. The step is done when a written mapping table is approved and a test user from each mapped group shows the expected roles on the User record.

  6. Review assigned roles for test users

    For each test user from the previous step, the administrator opens the User record and compares the roles ERPNext assigned with the directory groups that user holds. Check that no user received a role from a group they should not be in, and that users with no mapped group receive only the default role. Remove any user that should not have access and confirm that a disabled directory account cannot log in. The step is done when a role review record lists each test account, its directory groups, its ERPNext roles and the reviewer's sign-off.

  7. Configure Social Login Key for OAuth or OIDC

    For any OAuth or OpenID Connect provider such as Google, Microsoft or a custom identity provider, the administrator creates a Social Login Key in ERPNext with the client ID, client secret and endpoint values issued by that provider. Register the ERPNext callback URL in the provider's application settings exactly as the Social Login Key shows it. Confirm the provider's current endpoint and scope requirements with the provider's documentation. The step is done when a test user signs in through the provider button, lands on the correct ERPNext User record and receives the roles defined for that account.

  8. Keep a local administrator account for recovery

    The platform owner keeps at least one local administrator account that does not depend on the directory, and stores its credentials in a sealed, audited location. This account lets the team recover the site if the directory, certificate or identity provider fails. Test that it can sign in while LDAP is unavailable in a non-production copy, and record who can use it and when. The step is done when the recovery login has been tested, its access is logged, and the runbook states how the account is used and when its password is rotated.

ERPNext components involved in identity

Identity for ERPNext is spread across a few configuration points rather than one switch. Each card below covers one of them, what it controls, and what to confirm in the version you deploy, so the login path works end to end before users depend on it.

LDAP Settings

LDAP Settings is the single-doctype configuration that points ERPNext at your Active Directory or OpenLDAP server. It holds the server address, the port, the TLS or SSL option, the bind account used for searches, and the search base and user identifier fields. Because every LDAP login depends on these values, a wrong search base or identifier field is the most common cause of failed logins. Confirm the exact field names and TLS options in your target version against the LDAP integration documentation before testing with real accounts.

LDAP integration docs

Group to role mapping

ERPNext can map LDAP groups to ERPNext roles and applies that mapping at each login, so role changes in the directory reach ERPNext without a manual edit. This makes the group design in your directory a security control: a broad group that grants a powerful role will grant that role to everyone in it. Review which groups map to finance, HR or administrator roles, and test with a standard user and a privileged user before go-live.

Social Login Key records

Each Social Login Key record defines one external provider, such as Google, Microsoft or a custom OpenID Connect endpoint, with its client ID, client secret and endpoint URLs. Provider settings are stored in ERPNext, so the client secret must be protected like any other credential and rotated when your identity team rotates it. Confirm which fields your version exposes for custom providers, and whether the provider is enabled for all users or only for certain login paths.

Social Login Key docs

User and role records

Users are ERPNext User records, and their access comes from assigned roles and role profiles that bundle several roles together. Identity federation does not replace these records: a user who signs in through SSO still needs an enabled User record with the right role profile, or the login succeeds but the account has little or no access. Check who creates users on first login, which role profile new accounts receive by default, and how disabled identities in the directory are disabled in ERPNext.

Site URL and redirect URI

Social login providers return the user to an exact redirect URI, which is built from the site URL configured in ERPNext. If the site name, the protocol or the public hostname differs from what you registered with the provider, the callback fails with an error that looks like a provider problem. Register the redirect URI for each environment, including staging, and confirm the public host name behind any reverse proxy or load balancer before you configure the provider.

Frappe login and session handling

Frappe controls how a login becomes a session, how long it lasts, and how two-factor authentication applies to accounts that sign in through a password or an external provider. Session behavior decides whether a disabled directory account loses access at its next request or only at its next login. Test session expiry, logout, and password-based fallback login for each identity path, and confirm the session and two-factor settings available in your target version.

How SSO changes by deployment model

With a bench install, ERPNext, the Frappe Framework and the site run directly on one host you control. You configure LDAP Settings and Social Login Keys inside the site, and the web server handling TLS is typically Nginx on the same machine. Certificates for LDAPS, the reverse proxy and any custom OpenID Connect endpoint are installed on the host or in its trust store, so your team manages them directly.

  • Redirect URL: The callback URL must match the public hostname served by Nginx, so change the site domain and proxy headers before registering the application with the provider.
  • Certificates: Install the directory's CA certificate on the host so the LDAP connection with SSL/TLS can verify the server.
  • Directory connectivity: The bench host itself must reach the domain controller or OpenLDAP port over the network, which often needs a firewall rule.
  • Server Scripts: You control the server_script_enabled setting, so scripts stay off unless a use case needs them.
  • Change control: Every change to the host and its certificates falls to your own operations process.

Before go-live, confirm the callback URL, the certificate chain and the firewall path from the application server to the directory with your network team.

How to verify SSO and confirm failures are safe

Test SSO before any user depends on it, and treat each failure path as a control you must prove, not an assumption. Start with successful login per mapped group: use one test account for each group that feeds an ERPNext role, sign in through LDAP or the social provider, and confirm the roles and user permissions on the User record match your mapping table. Then remove one test account from a directory group, wait for its next login, and confirm the role disappears. Role mapping in ERPNext applies at login, so a user who keeps an open session may retain access until that session ends. Record how long that window is in your own environment and decide whether it is acceptable for finance and stock roles.

Next, prove the refusals. Disable a directory account and confirm ERPNext refuses the login, including for a session that was already open, then check whether the existing session is terminated or merely blocked at the next request. For Social Login Keys, present an OpenID Connect token that is expired, issued for a different client ID, or signed by a key the provider does not publish, and confirm ERPNext rejects it. Stop the LDAP server or block its port from the ERPNext network and observe what users see, whether local accounts still work, and whether the error is logged. Confirm the expected behavior with your identity team and with the vendor documentation linked from the LDAP and Social Login Key pages, since behavior on provider outages depends on your configuration.

Finish by proving the local System Manager account still signs in with password login while the identity provider is down, and that its credentials are stored outside the directory. Sign-off should require written evidence for each case: the test account, the expected result, the observed result, the log entry, and the person who accepted it. Do not sign off until a restore of the local admin password has been tested and the break-glass procedure is written down with named owners.

What drives the effort of ERPNext SSO work

This table compares the main drivers of SSO effort for ERPNext, from identity sources and group mapping to multi-site setups and audit evidence. Read each row as a question to answer before scoping, since the first column names the driver and the last column shows how to keep it under control. The main takeaway is that most effort comes from directory structure and unclear role decisions, not from the login setting itself.

DriverWhy it changes effortHow to keep it down
Number of identity sourcesEach LDAP directory or OIDC provider needs its own settings, testing and failure handling, and users may exist in more than one source.Confirm one authoritative source per user population and retire parallel sources before build starts.
Groups and role mappingEvery directory group that maps to an ERPNext role must be checked for the permissions it grants, and mappings are applied at each login.Limit the mapping to a short list of groups that correspond to approved role profiles, and document the owner of each group.
Directory structure qualityNested groups, duplicate group names, or users placed in several organizational units complicate search filters and group membership checks.Ask the directory team for a clean group naming scheme and a test account list before configuration begins.
Custom OIDC endpointsCustom providers need correct discovery, client registration, redirect URLs, claim mapping and token behavior, which the provider team must confirm.Use a provider with documented endpoints and claims, and confirm the exact claim names and scopes in writing before scoping.
Multi-site or multi-company setupsEach site may need its own login settings, role mappings and user permissions, so changes multiply across sites.Decide early whether sites share one identity configuration and which settings must differ per company.
Environments (dev, staging, production)Settings, certificates, redirect URLs and test accounts must be replicated and kept in step across environments.Keep environment-specific values in a controlled list and test the same login path in staging before production changes.
Compliance evidence needsAssessors may ask for configuration exports, access reviews, admin account controls and logs showing who signed in and how.Agree the evidence list at the start, including where logs are stored and who reviews group membership changes.

What to monitor, back up and document after go-live

The first thing to set up after go-live is monitoring for failed logins and bind errors, because a broken LDAP bind or an expired provider secret usually shows up as users locked out, not as an alert. Ask the team who receives the Frappe error logs and failed login attempts, and confirm how the LDAP service account's bind failures reach them. Review those records on a schedule, and check after every directory change, such as a group rename, a moved organizational unit or a password policy update, that the group to role mapping in LDAP Settings still matches what the directory now holds. Role mappings are applied at each login, so a stale group name quietly removes access rather than raising an error.

Next, plan the credential lifecycle. The LDAP bind account password, the OAuth client secret for each Social Login Key and any signing material in a custom OpenID Connect setup all expire or get rotated on the identity provider's schedule, and each rotation must be copied into ERPNext in the same change window. Keep the local System Manager admin account and its recovery procedure in a sealed, tested form, because a sign-in outage with no working local admin can block recovery. Back up the site configuration and the SSO settings with the normal bench backup routine, and store a copy of the redirect URIs and mapping tables outside the server. Before any ERPNext upgrade, export the SSO settings, run the upgrade in staging and confirm that both LDAP and social login still work there before production.

The handover package is the runbook and the access review records. The runbook should name each identity source, its owner, the service account, the secret rotation date, the mapping table, the local admin holder and the steps to recover from a broken bind. Access reviews should record which directory groups map to which ERPNext roles, who approved each mapping and the date of the last review, and should note any accounts that still sign in with a local password. Confirm with your compliance lead which review frequency and evidence format your control framework expects, since DeployOpen prepares these records but independent auditors decide whether they are sufficient.

Questions teams ask before building ERPNext SSO

Can our internal team set up LDAP and Social Login Keys without a partner?

Yes, an experienced internal team can usually configure ERPNext LDAP login and a Social Login Key, provided it has the access and time to test both paths. The work is mostly configuration, but it touches your directory, your identity provider and ERPNext's user and role model at the same time. The main risks are mapping directory groups to the wrong ERPNext roles and leaving a login path open that bypasses your policies. Check whether your staff have run an ERPNext production bench before, since upgrades later can change how these settings behave. The ERPNext LDAP integration documentation is the starting point for the team's own build plan.

What do we need to provide before SSO work can start?

Three roles must be available and willing to act: a directory administrator who can create a read-only bind account and confirm group structure, an identity provider administrator who can register an application and issue client credentials, and an ERPNext administrator who can edit LDAP Settings and Social Login Keys. Each one should be named before scoping starts, because delays usually come from waiting for approvals rather than from the configuration itself. You also need a test environment with test users in every group that should receive a role. Ask for a written list of these dependencies in any quote so the timeline reflects your own approval cycles.

What drives the cost and duration of an ERPNext SSO project?

The main drivers are the number of identity sources, the number of group-to-role rules, and how much testing your security and compliance teams require. A single LDAP directory with a short list of roles is a small job. Adding Microsoft, Google or a custom OpenID Connect provider, nested directory groups, TLS certificate work and a documented break-glass process adds configuration and review. Cost is mostly internal staff time or partner effort, and the one-time setup is different from the recurring work of reviewing group mappings when roles change. Ask any quote to itemize the identity sources, the role matrix, the test cases and the handover of documentation.

Do Frappe Cloud shared benches support every SSO option?

Not necessarily, so confirm before you design the solution. Frappe Cloud shared site hosting starts at 5 US dollars per month according to the ERPNext pricing page, but a hosting plan does not guarantee that every authentication option or server-side customization is available on a given plan. Social Login Keys depend on the external provider and the site's configuration, while LDAP connections require network reachability from the hosting environment to your directory. Server Scripts are disabled by default from version 15 onward and cannot be used on Frappe Cloud public shared benches, which matters if your mapping logic depends on them. Confirm each option with Frappe Cloud support and your hosting plan in writing.

Is self-hosting free, and why does identity work still cost money?

ERPNext is licensed under GPL-3.0, so the software itself carries no license fee for self-hosting. Identity integration still requires labor, infrastructure and ongoing attention. Your team pays for directory configuration, identity provider registration, certificate management, testing, documentation and changes whenever a role or group moves. Hosting on your own servers or Frappe Cloud also carries its own cost, and if you want Frappe warranty coverage, the Frappe supported versions page explains that a matching Frappe Cloud support plan is required. Ask for a quote that separates one-time build work from recurring review, and confirm which parts your own staff will own after handover.

When should we bring in a partner for ERPNext identity integration?

Bring in a partner when the identity design affects access to financial or production data and your internal team cannot test it in a realistic window. Common triggers include multiple directories, regulated access reviews, a requirement to keep local admin accounts for emergencies, or an audit that will ask for evidence of role assignments. DeployOpen plans, implements, hardens and documents self-hosted open-source platforms inside your own infrastructure, and it can test the resulting login paths and prepare the evidence your compliance team asks for. It does not issue audit reports or certifications, so independent auditors remain responsible for assessment. Ask for a fixed scope in writing before any work starts.

How DeployOpen scopes and hands over ERPNext identity work

The sequence moves from a written scope to a tested, documented login setup that your team can operate after handover. Each step produces a record your security and ERP owners can review.

  1. Agree the scope in writing

    DeployOpen and your team agree in writing which login methods are in scope: LDAP against Active Directory or OpenLDAP, Social Login Keys for Microsoft, Google or a custom OpenID Connect provider, and the local admin accounts that stay as a break-glass path. The scope names the ERPNext version, the sites and environments covered, the deliverables and the acceptance criteria. Most engagements are fixed-scope, so the document is the basis for the quote. DeployOpen does not publish a price list. Work does not start until both parties have signed the scope.

  2. Discover identity sources and role model

    DeployOpen reviews your identity sources, directory structure, group naming, and how existing ERPNext users and roles map to them. Your identity team confirms which groups grant which ERPNext roles, which accounts are service or shared accounts, and who approves changes. The output is a role mapping table and a list of open questions such as duplicate accounts, disabled users with active ERPNext records, or groups that nest across domains. The step is complete when your owners have signed off the mapping.

  3. Confirm the target platform and certificate chain

    Before configuration, DeployOpen checks the ERPNext and Frappe versions in use, the hosting model (your own servers, Docker, or Frappe Cloud), and the TLS certificate chain that the identity provider and the ERPNext site will use. Confirm with your directory and identity provider teams which SSL/TLS options the LDAP server supports and which redirect URIs and client registrations the OAuth or OpenID Connect provider requires. Some settings depend on the platform release, so the team should verify them against the documentation for the version you run. The step closes with a connectivity test from the ERPNext host to each identity endpoint.

  4. Build in your environment

    DeployOpen configures LDAP Settings and Social Login Keys in a non-production site inside your own infrastructure, so credentials and directory data never leave your environment. The build includes group to role mapping that runs at each login, the client secret handling for OIDC providers, and documented settings for local admin accounts. Configuration changes are tracked in version control or an equivalent change log. The step is complete when a test user can sign in through each method and receives the expected roles.

  5. Verify with failure tests

    Verification covers the normal path and the failures that cause outages or access problems. Tests include a user removed from a directory group, an account that is disabled upstream, an expired or revoked client secret, an unreachable directory server, a certificate mismatch, and a login attempt with the local admin account. DeployOpen records the expected and actual result for each case. Any gap found goes back into the build. The step closes with a test report that your security team can review.

  6. Hand over the runbook and configuration record

    Handover includes a runbook for routine operation, such as rotating the OIDC client secret, changing the directory bind account, adding a group mapping, and recovering access through the local admin account. The configuration record lists every LDAP and Social Login Key setting, the role mapping, the owners of each identity source, and the dates of changes. Your team runs one supervised login cycle before sign-off. The step is complete when your owners accept the runbook and record in writing.

  7. Retest after changes and support the rollout

    After handover, DeployOpen provides retest support for changes to the identity provider, the ERPNext version, or the role model, under the retest terms in the written scope. Retainer support is available as a separate written agreement for teams that want ongoing help. The output is a retest record for each change, appended to the configuration record. Your team keeps the operational ownership throughout.

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.