Metadata-Version: 2.1
Name: django-freeipa-auth-json
Version: 0.1.2.dev1
Summary: FreeIPA authentication for Django using FreeIPA JSON API
Home-page: https://github.com/puttsk/django-freeipa-auth
Author: Putt Sakdhnagool
Author-email: putt.sakdhnagool@nectec.or.th
License: UNKNOWN
Project-URL: Bug Reports, https://github.com/puttsk/slurm-sbalance/issues
Project-URL: Source, https://github.com/puttsk/slurm-sbalance/
Keywords: django freeipa authentication
Platform: UNKNOWN
Classifier: Development Status :: 3 - Alpha
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.6
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*, <4
Description-Content-Type: text/markdown

django-freeipa-auth
====================

`django-freeipa-auth` provides a Django backend authentication app for FreeIPA authentication. The app uses FreeIPA JSON API for its operation. 

Quick start
------------

1. Install using `pip`

```
pip install django-freeipa-auth-json
```

2. Add `freeipa` to `INSTALLED_APPS` in the settings file.

```python
INSTALLED_APPS = [
    ...
    'freeipa',
]
```

3. Add `freeipa.auth.backends.AuthenticationBackend` to `AUTHENTICATION_BACKENDS` in the settings file.

```python
AUTHENTICATION_BACKENDS = [
    ...
    'freeipa.auth.backends.AuthenticationBackend',
]
```

4. Add following settings to the setting files

```python
# REQUIRED: 
IPA_AUTH_SERVER = 'ipa.demo1.freeipa.org'

# OPTIONAL:
IPA_AUTH_SERVER_SSL_VERIFY = True
IPA_AUTH_SERVER_API_VERSION = '2.230'
# Automatically update user information when logged in
IPA_AUTH_AUTO_UPDATE_USER_INFO = True  
# Automatically create and update user groups.
IPA_AUTH_UPDATE_USER_GROUPS = True 

# Dictionary mapping FreeIPA field to Django user attributes
IPA_AUTH_FIELDS_MAP = { 'givenname': 'first_name',
                        'sn'       : 'last_name',
                        'mail'     : 'email',
                      }
```

Command Line
--------------

`django-freeipa-auth` provide `syncipa` command to import and update users stored in Django database with FreeIPA server.

```
usage: manage.py syncipa [-h] [-u USER] [-p PASSWD] 

Synchronizing data with FreeIPA server

optional arguments:
  -h, --help                  show this help message and exit

login arguments: require a user with permission to query all users (e.g. administrator.)
  -u USER, --user USER
  -p PASSWD, --passwd PASSWD  
```


