Toby
Toby

Reputation: 242

Django LDAP with OpenWisp Django-IPAM

I'm trying to setup OpenWisp Django-IPAM with WebUI authentication via LDAP. We have an OpenLDAP server within our network and I am looking to use a simple LDAP lookup to check for a valid user object for login.

I see that the API's generics.py file has an authentication_classes section, which then contains SessionAuthentication and BasicAuthentication.

Is this the same mechanism that handles the authentication for the Web UI? Is there a way to configure OpenWisp Django-IPAM to use something like Django-Auth-LDAP for authentication when logging into the web interface?

Upvotes: 2

Views: 292

Answers (2)

nemesifier
nemesifier

Reputation: 8529

Something like django-auth-ldap will help, but users will have to start a session by authenticating against the django authentication backends before being able to use the API (eg: login via the admin or provide another login view).

After a successful LDAP authentication using the method mentioned above, a new local user will be created, which maps the LDAP user.

I'm not sure if LDAP authentication requires a redirect to another application (like oauth2 or SAML) or if username and password are just redirected behind the scenes, in the latter case, BasicAuthentication should work, I just look at its code and it looks like it respect the standard django authentication framework, which supports multiple authentication backends (the LDAP backend is provided by the third party app suggested above).

A sidenote: we're moving the development of django-ipam to openwisp-ipam, It's mostly the same. I suggest you to upgrade.

Upvotes: 1

Noumbissi Valere
Noumbissi Valere

Reputation: 51

the authentication of the web UI of OpenWISP Django-IPAM works like default authentication of other django projects. So to use LDAP authentication at the web UI, you simply need to edit your settings.py file to contain the setups as shown here.

Upvotes: 2

Related Questions