Frappe Based App: LDAP login

Has there been any development on this? LDAP, WordPress, and Stripe are pretty much the only integrations I’m interested in. I’ve been waiting to move my enterprise clients over to ERPNext, but require LDAP for authentication :-/

newest commit is from November 2015
@andromache @chlarsen have you tried to install it?
@saurabh6790 any news from your end?

I try to install by this instructions on repository, but i get this error, when i try open LDAP for the search box:

  • 14.04.1-Ubuntu
  • With: python-dev libldap2-dev libsasl2-dev libssl-dev and python-ldap

Traceback (innermost last): File "/home/thiagopr/frappe-bench/apps/frappe/frappe/app.py", line 57, in application response = frappe.handler.handle() File "/home/thiagopr/frappe-bench/apps/frappe/frappe/handler.py", line 19, in handle execute_cmd(cmd) File "/home/thiagopr/frappe-bench/apps/frappe/frappe/handler.py", line 36, in execute_cmd ret = frappe.call(method, **frappe.form_dict) File "/home/thiagopr/frappe-bench/apps/frappe/frappe/__init__.py", line 806, in call return fn(*args, **newargs) TypeError: get() takes exactly 1 argument (0 given)

When i try do reinstall:
bench get-app frappe_ldap https://github.com/saurabh6790/frappe_ldap.git INFO:bench.app:getting app frappe_ldap Cloning into 'frappe_ldap'... remote: Counting objects: 97, done. remote: Total 97 (delta 0), reused 0 (delta 0), pack-reused 97 Unpacking objects: 100% (97/97), done. Checking connectivity... done. installing frappe_ldap INFO:bench.app:installing frappe_ldap Wrote ./assets/js/print_format_v3.min.js - 18k Wrote ./assets/js/frappe-web.min.js - 101k Wrote ./assets/js/form.min.js - 113k Wrote ./assets/js/report.min.js - 157k Wrote ./assets/js/erpnext.min.js - 36k Wrote ./assets/css/list.min.css - 6k Wrote ./assets/js/erpnext-web.min.js - 1k Wrote ./assets/css/report.min.css - 7k Wrote ./assets/css/frappe-web.css - 51k Wrote ./assets/js/list.min.js - 66k Wrote ./assets/js/dialog.min.js - 58k Wrote ./assets/js/desk.min.js - 874k Wrote ./assets/css/form.min.css - 2k Wrote ./assets/js/editor.min.js - 26k Wrote ./assets/css/erpnext.css - 1k Wrote ./assets/css/desk.min.css - 256k Wrote ./assets/css/module.min.css - 2k frappe-bench-frappe-web: stopped frappe-bench-node-socketio: stopped frappe-bench-frappe-async-worker: stopped frappe-bench-frappe-longjob-worker: stopped frappe-bench-frappe-workerbeat: stopped frappe-bench-frappe-worker: stopped frappe-bench-frappe-web: started frappe-bench-node-socketio: started frappe-bench-frappe-async-worker: started frappe-bench-frappe-longjob-worker: started frappe-bench-frappe-workerbeat: started frappe-bench-frappe-worker: started

  • Install the app:

bench frappe --install_app frappe_ldap site1.local frappe app is not installed. Run the following command to install frappe bench get-app frappe https://github.com/frappe/frappe.git Traceback (most recent call last): File "/usr/local/bin/bench", line 9, in <module> load_entry_point('bench==3.0.0', 'console_scripts', 'bench')() File "/home/thiagopr/bench-repo/bench/cli.py", line 20, in cli return old_frappe_cli() File "/home/thiagopr/bench-repo/bench/cli.py", line 78, in old_frappe_cli os.execv(f, [f] + sys.argv[2:]) OSError: [Errno 2] No such file or directory

  • But i’m sure that Frappe installed:

bench get-app frappe https://github.com/frappe/frappe.git INFO:bench.app:getting app frappe fatal: destination path 'frappe' already exists and is not an empty directory. Traceback (most recent call last): File "/usr/local/bin/bench", line 9, in <module> load_entry_point('bench==3.0.0', 'console_scripts', 'bench')() File "/home/thiagopr/bench-repo/bench/cli.py", line 40, in cli bench_command() File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 716, in __call__ return self.main(*args, **kwargs) File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 696, in main rv = self.invoke(ctx) File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 1060, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 889, in invoke return ctx.invoke(self.callback, **ctx.params) File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 534, in invoke return callback(*args, **kwargs) File "/home/thiagopr/bench-repo/bench/commands/make.py", line 28, in get_app get_app(name, git_url, branch=branch) File "/home/thiagopr/bench-repo/bench/app.py", line 55, in get_app cwd=os.path.join(bench, 'apps')) File "/home/thiagopr/bench-repo/bench/utils.py", line 99, in exec_cmd raise CommandFailedError(cmd) bench.utils.CommandFailedError: git clone https://github.com/frappe/frappe.git --origin upstream frappe

  • And now, this is my Login Page:

Hallo,

after installing the frappe_ldap app, the login page looks corrupted and even the administrator login is not working anymore. I am using Debian 8 Jessie.

I used the following commands to install it:
bench get-app frappe GitHub - frappe/frappe: Low code web framework for real world applications, in Python and Javascript
bench install-app frappe_ldap

Also installing the app via web interface leads to the same problem.

Thank you very much for your help.
Lars

Hi everyone,

For those errores above, there are some corrections on code.
Details are in

Commit “Recuperación login”

The changes are for:

  • Recover in few steps login CSS for erpNext and LDAP
  • Recover login functionality for an user

I’m working still on other things (like Add Modules, edit configuration installer, others), but you can add the changes generated until now and get the login fixed. Already read, test and review other posts discussion about it until an stable version.

My recommendation is to :slight_smile:

  • Make the install through the App Installer available on the Search Engine inside ErpNext. After installation the only way you can access the LDAP modules is (again) with Search Engine (working on the Module Menu).

  • The next error happens because during installation is set that only the Administrator profile can access the DocTypes, so be sure to login correctly.

File “/home/thiagopr/frappe-bench/apps/frappe/frappe/init.py”, line 806, in call
return fn(*args, **newargs)
TypeError: get() takes exactly 1 argument (0 given)

Hope it helps,

4 Likes

@violetasdev thanks.

After v7 we will look to upgrade the LDAP app and make it a standard in ERPNext

CC @saurabh6790

4 Likes

Hi, I try to install frappe_ldap from your repository:

bench get-app frappe_ldap https://github.com/violetasdev/frappe_ldap.git

My ERPNext setup:

Installed Apps
ERPNext: v7.0.58
Frappe Framework: v7.0.44
LDAP: v0.0.1

And now, I’m get this error log:

Traceback (most recent call last):
  File "/home/frappe/frappe-bench/apps/frappe/frappe/app.py", line 55, in application
    response = frappe.handler.handle()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/handler.py", line 19, in handle
    execute_cmd(cmd)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/handler.py", line 30, in execute_cmd
    method = get_attr(cmd)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/handler.py", line 114, in get_attr
    method = frappe.get_attr(cmd)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 859, in get_attr
    return getattr(get_module(modulename), methodname)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 643, in get_module
    return importlib.import_module(modulename)
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
ImportError: No module named LDAP_settings

The login page not have a LDAP Auth option. What can I do?

Hi @Thiago_Pereira

  • First of all, the LDAP Module is working on V.6.
  • After getting the app, did you run the installation trough ERPNext installer? It will create all the dependences. Search for App Installer and try it.

If the error continues, we must watch the version, look for installed files and review if the only thing missing is the sql query to access.

I have an installation manual but it is in Spanish, let me know if it would help you.

Greetings,

1 Like

Tks for the answer, your installation manual can help me.

@Thiago_Pereira in v7.1-beta, LDAP is a part of the core framework.

1 Like

@rmehta

That’s good news. Good work team.
Are we going to use OpenLDAP server http://www.openldap.org ? Or can we use it as an option?

Thanks,
Nick

That’s a good news @rmehta! Thanks

Where could i find the LDAP setting in v7.1-beta?
I also mentioned in this thread, LDAP login and employee database - #5 by saurabh6790

Thanks a lot.

Hi

Same as @bzero , i am a little confused as to where the LDAP application is or how it can be installed. I am running the production and also development instances / VM , but can’t see or make sense where or how to activate or install this?

I have followed some instructions on Github but these dont seem to be working

Can someone please help or provide some clear instructions on how this can be enabled? This is a great feature, but very poor communication and documentation on this topic…

Please help

Many thanks :slight_smile:

Ignore my previous post

I have managed to install the app without a problem

many thanks guys, this system now totally rocks…

In one of my other instances, it comes up with the below errors @saurabh6790

frappe@erpnext:~/frappe-bench$ bench get-app frappe_ldap GitHub - saurabh6790/frappe_ldap
INFO:bench.app:getting app frappe_ldap
fatal: destination path ‘frappe_ldap’ already exists and is not an empty directory.
Traceback (most recent call last):
File “/usr/local/bin/bench”, line 11, in
load_entry_point(‘bench’, ‘console_scripts’, ‘bench’)()
File “/home/frappe/bench-repo/bench/cli.py”, line 40, in cli
bench_command()
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 716, in call
return self.main(*args, **kwargs)
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 696, in main
rv = self.invoke(ctx)
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 1060, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 889, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 534, in invoke
return callback(*args, **kwargs)
File “/home/frappe/bench-repo/bench/commands/make.py”, line 30, in get_app
get_app(git_url, branch=branch)
File “/home/frappe/bench-repo/bench/app.py”, line 62, in get_app
cwd=os.path.join(bench_path, ‘apps’))
File “/home/frappe/bench-repo/bench/utils.py”, line 127, in exec_cmd
raise CommandFailedError(cmd)
bench.utils.CommandFailedError: git clone GitHub - saurabh6790/frappe_ldap --origin upstream
frappe@erpnext:~/frappe-bench$

Can someone please help with this? I have installed the dependencies, but it seems like my first failed install its not letting me install it again…

If someone can help i would appreciate it

See this: LDAP Login Not Working - #11 by Thiago_Pereira

is there any way I can connect to active directory???

by using ldap