Projet

Général

Profil

« Précédent | Suivant » 

Révision 78775031

Ajouté par Serghei Mihai il y a presque 8 ans

authentication views fix

Voir les différences:

corbo/settings.py
107 107
# default mass emails expeditor
108 108
CORBO_DEFAULT_FROM_EMAIL = 'webmaster@localhost'
109 109

  
110
# django-mellon settings
110

  
111
# Authentication settings
112
try:
113
    import mellon
114
except ImportError:
115
    mellon = None
116

  
117
if mellon is not None:
118
    AUTHENTICATION_BACKENDS = (
119
        'mellon.backends.SAMLBackend',
120
        'django.contrib.auth.backends.ModelBackend',
121
    )
122

  
123
LOGIN_URL = '/login/'
124
LOGIN_REDIRECT_URL = '/'
125
LOGOUT_URL = '/logout/'
126

  
111 127
MELLON_ATTRIBUTE_MAPPING = {
112
    'username': '{attributes[username][0]}',
113 128
    'email': '{attributes[email][0]}',
114 129
    'first_name': '{attributes[first_name][0]}',
115 130
    'last_name': '{attributes[last_name][0]}',
116 131
}
117 132

  
118
if 'mellon' in INSTALLED_APPS:
119
    AUTHENTICATION_BACKENDS = ('mellon.backends.SAMLBackend', )
120
    LOGIN_URL = 'mellon_login'
121
    LOGOUT_URL = 'mellon_logout'
133
MELLON_SUPERUSER_MAPPING = {
134
    'is_superuser': 'true',
135
}
136

  
137
MELLON_USERNAME_TEMPLATE = '{attributes[name_id_content]}'
138

  
139
MELLON_IDENTITY_PROVIDERS = []
122 140

  
123 141
local_settings_file = os.environ.get('CORBO_SETTINGS_FILE',
124 142
        os.path.join(os.path.dirname(__file__), 'local_settings.py'))

Formats disponibles : Unified diff