https://github.com/hugapi/hug_authentication_ldap
A hug extension providing ldap based authentication support
https://github.com/hugapi/hug_authentication_ldap
Last synced: 3 months ago
JSON representation
A hug extension providing ldap based authentication support
- Host: GitHub
- URL: https://github.com/hugapi/hug_authentication_ldap
- Owner: hugapi
- License: mit
- Created: 2016-04-06T02:17:58.000Z (about 9 years ago)
- Default Branch: develop
- Last Pushed: 2022-12-26T20:30:07.000Z (over 2 years ago)
- Last Synced: 2025-01-09T22:52:01.617Z (4 months ago)
- Language: Python
- Size: 549 KB
- Stars: 12
- Watchers: 9
- Forks: 2
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
hug_authentication_ldap
===================[](http://badge.fury.io/py/hug_authentication_ldap)
[](https://travis-ci.org/timothycrosley/hug_authentication_ldap)
[](https://coveralls.io/github/timothycrosley/hug_authentication_ldap?branch=master)
[](https://pypi.python.org/pypi/hug_authentication_ldap/)
[](https://gitter.im/timothycrosley/hug?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)Easy to use LDAP based authentication support for hug:
```py
import hug
import hug_authentication_ldapauthentication = hug_authentication_ldap.basic('myldap.server.net', 'uid={user_name},ou=people')
@hug.get(requires=authentication)
def say_hello(hug_user):
return 'Hello {}!'.format(hug_user.name)
```Or, for general reusable LDAP password verification within hug:
```py
import hug
import hug_authentication_ldapldap_check = hug_authentication_ldap.verify('myldap.server.net', 'uid={user_name},ou=people')
@hug.get()
def check(user_name, password):
if ldap_check(user_name, password):
return Truereturn False
```Installing hug_authentication_ldap
===================Installing hug_authentication_ldap is as simple as:
```bash
pip3 install hug_authentication_ldap --upgrade
```Ideally, within a virtual environment.
What is hug_authentication_ldap?
===================An extension for hug that provides LDAP based authentication support
--------------------------------------------
Thanks and I hope you find hug_authentication_ldap helpful!
~Timothy Crosley