Revision b08aadc0
b/snf-astakos-app/astakos/im/settings.py | ||
---|---|---|
181 | 181 |
SHIBBOLETH_MIGRATE_EPPN = getattr(settings, 'ASTAKOS_SHIBBOLETH_MIGRATE_EPPN', |
182 | 182 |
False) |
183 | 183 |
|
184 |
# Migrate eppn identifiers to remote id |
|
185 |
SHIBBOLETH_MIGRATE_EPPN = getattr(settings, 'ASTAKOS_SHIBBOLETH_MIGRATE_EPPN', |
|
186 |
False) |
|
187 |
|
|
184 | 188 |
# Strict shibboleth usage |
185 | 189 |
SHIBBOLETH_REQUIRE_NAME_INFO = getattr(settings, |
186 | 190 |
'ASTAKOS_SHIBBOLETH_REQUIRE_NAME_INFO', |
b/snf-astakos-app/astakos/im/tests/auth.py | ||
---|---|---|
384 | 384 |
@im_settings(RECAPTCHA_ENABLED=True, RATELIMIT_RETRIES_ALLOWED=3) |
385 | 385 |
def test_login_ratelimit(self): |
386 | 386 |
from django.core.cache import cache |
387 |
cache.clear()
|
|
387 |
[cache.delete(key) for key in cache._cache.keys()]
|
|
388 | 388 |
|
389 | 389 |
credentials = {'username': 'γιού τι έφ', 'password': 'password'} |
390 | 390 |
r = self.client.post(ui_url('local'), credentials, follow=True) |
... | ... | |
396 | 396 |
r = self.client.post(ui_url('local'), credentials, follow=True) |
397 | 397 |
fields = r.context['login_form'].fields.keyOrder |
398 | 398 |
self.assertTrue('recaptcha_challenge_field' in fields) |
399 |
r = self.client.post(ui_url('local'), follow=True) |
|
400 |
fields = r.context['login_form'].fields.keyOrder |
|
401 |
self.assertTrue('recaptcha_challenge_field' in fields) |
|
402 | 399 |
|
403 | 400 |
def test_no_moderation(self): |
404 | 401 |
# disable moderation |
... | ... | |
820 | 817 |
|
821 | 818 |
# new academic user |
822 | 819 |
self.assertFalse(academic_users.filter(email='newuser@synnefo.org')) |
823 |
cl_newuser.set_tokens(eppn="newusereppn", mail="newuser@synnefo.org",
|
|
820 |
cl_newuser.set_tokens(remote_user="newusereppn", mail="newuser@synnefo.org",
|
|
824 | 821 |
surname="Lastname") |
825 | 822 |
r = cl_newuser.get(ui_url('login/shibboleth?'), follow=True) |
826 | 823 |
initial = r.context['signup_form'].initial |
b/snf-astakos-app/astakos/im/views/target/shibboleth.py | ||
---|---|---|
72 | 72 |
pass |
73 | 73 |
|
74 | 74 |
pending_users = \ |
75 |
<<<<<<< HEAD |
|
75 | 76 |
PendingThirdPartyUser.objects.filter(third_party_identifier=eppn, |
76 | 77 |
provider='shibboleth') |
78 |
======= |
|
79 |
PendingThirdPartyUser.objects.filter(third_party_identifier=eppn, |
|
80 |
provider='shibboleth') |
|
81 |
>>>>>>> astakos: Shibboleth EPPN migration functionality |
|
77 | 82 |
|
78 | 83 |
for pending in pending_users: |
79 | 84 |
msg = "Migrating pending user %s eppn (%s -> %s)" |
... | ... | |
158 | 163 |
fullname = '%s %s' % (first_name, last_name) |
159 | 164 |
|
160 | 165 |
if not any([first_name, last_name]) and \ |
161 |
<<<<<<< HEAD |
|
162 |
settings.SHIBBOLETH_REQUIRE_NAME_INFO: |
|
163 |
======= |
|
164 | 166 |
settings.SHIBBOLETH_REQUIRE_NAME_INFO: |
165 |
>>>>>>> astakos: Set initial signup values if available |
|
166 | 167 |
raise KeyError(_(astakos_messages.SHIBBOLETH_MISSING_NAME)) |
167 | 168 |
|
168 | 169 |
except KeyError, e: |
... | ... | |
175 | 176 |
|
176 | 177 |
affiliation = tokens.get(Tokens.SHIB_EP_AFFILIATION, 'Shibboleth') |
177 | 178 |
email = tokens.get(Tokens.SHIB_MAIL, '') |
178 |
<<<<<<< HEAD |
|
179 | 179 |
provider_info = {'eppn': eppn, 'email': email, 'name': fullname, |
180 | 180 |
'headers': shibboleth_headers, 'user_id': user_id} |
181 |
======= |
|
182 |
eppn_info = tokens.get(Tokens.SHIB_EPPN) |
|
183 |
provider_info = {'eppn': eppn_info, 'email': email, 'name': fullname, |
|
184 |
'headers': shibboleth_headers} |
|
185 |
userid = eppn |
|
186 |
|
|
187 |
>>>>>>> astakos: Set initial signup values if available |
|
188 | 181 |
|
189 | 182 |
try: |
190 | 183 |
return handle_third_party_login(request, 'shibboleth', |
... | ... | |
196 | 189 |
'first_name': first_name, |
197 | 190 |
'last_name': last_name, |
198 | 191 |
'email': email} |
199 |
<<<<<<< HEAD |
|
200 | 192 |
return handle_third_party_signup(request, user_id, 'shibboleth', |
201 |
======= |
|
202 |
return handle_third_party_signup(request, userid, 'shibboleth', |
|
203 |
>>>>>>> astakos: Set initial signup values if available |
|
204 | 193 |
third_party_key, |
205 | 194 |
provider_info, |
206 | 195 |
user_info, |
Also available in: Unified diff