authentication via django-mellon example added
This commit is contained in:
parent
bdd7984dfa
commit
10e8bff81c
|
@ -12,3 +12,22 @@ DATABASES = {
|
||||||
'NAME': 'db.sqlite3',
|
'NAME': 'db.sqlite3',
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
## Django Mellon configuration
|
||||||
|
# you need to generate SSL certificates in your current directory to make it functionnal :
|
||||||
|
#
|
||||||
|
# openssl genpkey -algorithm rsa -pkeyopt rsa_keygen_bits:2048 -out key.cert
|
||||||
|
# openssl req -x509 -new -out cert.pem -subj '/CN=whocaresIdo' -key key.cert -days 3650
|
||||||
|
#
|
||||||
|
# you also need to get the idp metadata and call it idp-metadata.xml
|
||||||
|
# Uncomment the following lines to enable SAML support
|
||||||
|
#INSTALLED_APPS += ('mellon',)
|
||||||
|
#AUTHENTICATION_BACKENDS = ( 'mellon.backends.SAMLBackend',)
|
||||||
|
#LOGIN_URL = 'mellon_login'
|
||||||
|
#LOGOUT_URL = 'mellon_logout'
|
||||||
|
#MELLON_PUBLIC_KEYS = ['cert.pem']
|
||||||
|
#MELLON_PRIVATE_KEY = 'key.cert'
|
||||||
|
#MELLON_IDENTITY_PROVIDERS = [
|
||||||
|
# {'METADATA': 'idp-metadata.xml',
|
||||||
|
# 'GROUP_ATTRIBUTE': 'role'},
|
||||||
|
# ]
|
||||||
|
|
|
@ -139,3 +139,18 @@ try:
|
||||||
except ImportError:
|
except ImportError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
LOGIN_REDIRECT_URL = '/'
|
||||||
|
|
||||||
|
# mellon authentication params
|
||||||
|
MELLON_ATTRIBUTE_MAPPING = {
|
||||||
|
'username': '{attributes[username][0]}',
|
||||||
|
'email': '{attributes[email][0]}',
|
||||||
|
'first_name': '{attributes[first_name][0]}',
|
||||||
|
'last_name': '{attributes[last_name][0]}',
|
||||||
|
}
|
||||||
|
|
||||||
|
MELLON_SUPERUSER_MAPPING = {
|
||||||
|
'roles': 'Admin::Hobo',
|
||||||
|
}
|
||||||
|
|
||||||
|
MELLON_USERNAME_TEMPLATE = '{attributes[username][0]}'
|
||||||
|
|
|
@ -2,3 +2,4 @@ django<1.7
|
||||||
-e git+http://repos.entrouvert.org/gadjo.git/#egg=gadjo
|
-e git+http://repos.entrouvert.org/gadjo.git/#egg=gadjo
|
||||||
-e git+http://repos.entrouvert.org/django-allauth-authentic2.git/#egg=allauth_authentic2
|
-e git+http://repos.entrouvert.org/django-allauth-authentic2.git/#egg=allauth_authentic2
|
||||||
celery
|
celery
|
||||||
|
django-mellon
|
||||||
|
|
Loading…
Reference in New Issue