django-imapauth
===============
django-imapauth is a simple IMAP authentification backend for django.
Quick start
-----------
Requirements :
* Django 1.4.3 (tested).
1. Install the app
pypi version
```
pip install django-imapauth
```
development version
```
pip install -e git+http://github.com/ouhouhsami/django-imapauth.git#egg=django-imapauth
```
2. Add ```'imapauth.backends.IMAPBackend'``` to your ```AUTHENTICATION_BACKENDS``` setting
```
AUTHENTICATION_BACKENDS = (
'imapauth.backends.IMAPBackend',
'django.contrib.auth.backends.ModelBackend',
)
```
3. Add ```IMAPAUTH_HOST``` in your settings
```
IMAPAUTH_HOST = 'my_imap_host'
```
Usage
-----
With django-imapauth, when a user try to authenticate in your system, the ```IMAPBackend``` will try to connect to the ```IMAPAUTH_HOST``` with his credentials.
Be careful, it's not because a user is authenticated that he can access the admin site. For that, refer to the example below, and use ```CustomIMAPBackend``` in ```AUTHENTICATION_BACKENDS```:
from imapauth.backends import IMAPBackend
class CustomIMAPBackend(IMAPBackend):
def authenticate(self, username=None, password=None):
user = super(CustomIMAPBackend, self).authenticate(username, password)
if user is None:
return None
user.is_staff = True
user.save()
return user
Further information
-------------------
IMAPBackend copied from http://www.djangorocks.com/tutorials/creating-a-custom-authentication-backend/creating-the-imap-authentication-backend.html
Metadata
Release files for django-imapauth 0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| django-imapauth-0.1.tar.gz | 3.5 kB | Without provenance | Details for django-imapauth-0.1.tar.gz |
Release files / django-imapauth-0.1.tar.gz
| Download URL | django-imapauth-0.1.tar.gz |
|---|---|
| Size | 3.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
99b99d198b037a5877a3a28a8f63410c848befaefafb178624cd70d42a2caee7
|
|
BLAKE2b-256 checksum How to use checksums |
82c5b200afcb4033d779c7040f11a22bc71f901555bee6f94bbc890b5c53aeab
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for django-imapauth 0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.