Giter Site home page Giter Site logo

django-ldap-sync's Introduction

django-ldap-sync

django-ldap-sync provides a Django management command that synchronizes LDAP users and groups from an authoritative server. It performs a one-way synchronization that creates and/or updates the local Django users and groups.

This synchronization is performed each time the management command is run and can be fired manually on demand, via an automatic cron script or as a periodic Celery task.

Quickstart

  1. Install the application:

    pip install django-ldap-sync
    
  2. Append it to the installed apps:

    INSTALLED_APPS = (
        # ...
        'ldap_sync',
    )
    
  3. Configure the required settings.

  4. Run the synchronization management command:

    manage.py syncldap
    

For more information on installation and configuration, see the included documentation or read the documentation online at django-ldap-sync.readthedocs.org.

django-ldap-sync's People

Contributors

jbittel avatar localfolkhero avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

django-ldap-sync's Issues

TypeError: unsupported operand type(s)

Hello. Python 3.10.6 return this error.

python3 manage.py syncldap
Traceback (most recent call last):
  File "/opt/src/devapi_django/manage.py", line 22, in <module>
    main()
  File "/opt/src/devapi_django/manage.py", line 18, in main
    execute_from_command_line(sys.argv)
  File "/usr/local/lib/python3.10/dist-packages/django/core/management/__init__.py", line 442, in execute_from_command_line
    utility.execute()
  File "/usr/local/lib/python3.10/dist-packages/django/core/management/__init__.py", line 436, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/local/lib/python3.10/dist-packages/django/core/management/base.py", line 412, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/usr/local/lib/python3.10/dist-packages/django/core/management/base.py", line 458, in execute
    output = self.handle(*args, **options)
  File "/usr/local/lib/python3.10/dist-packages/ldap_sync/management/commands/syncldap.py", line 13, in handle
    sync_ldap.sync_users()
  File "/usr/local/lib/python3.10/dist-packages/ldap_sync/sync.py", line 48, in sync_users
    user_attributes = self.settings.USER_ATTRIBUTES.keys() + self.settings.USER_EXTRA_ATTRIBUTES.keys()
TypeError: unsupported operand type(s) for +: 'dict_keys' and 'dict_keys'

Group sync is not working

Hello,

when trying to have my LDAP groups synced, I don't get any value.

Reading sync.py, I find this on line 63:

defaults[field] = self.settings.GROUP_ATTRIBUTES[ldap_name][0].decode('utf-8')

Shouldn't it be:

defaults[field] = ldap_attributes[ldap_name][0].decode('utf-8')

:-/ ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.