Commit 60c0601e authored by Kostas Papadimitriou's avatar Kostas Papadimitriou
Browse files

Shibboleth fixes

- Do not require name (some providers don't provide it)
- Proper can_add_auth_provider use
parent 661fd0a4
......@@ -95,7 +95,7 @@ def login(
elif Tokens.SHIB_NAME in tokens and Tokens.SHIB_SURNAME in tokens:
realname = tokens[Tokens.SHIB_NAME] + ' ' + tokens[Tokens.SHIB_SURNAME]
raise KeyError(_(astakos_messages.SHIBBOLETH_MISSING_NAME))
realname = ''
except KeyError, e:
# invalid shibboleth headers, redirect to login, display message
messages.error(request, e.message)
......@@ -113,8 +113,7 @@ def login(
# automatically add eppn provider to user
user = request.user
if not request.user.can_add_auth_provider('shibboleth',
messages.error(request, 'Account already exists.')
return HttpResponseRedirect(reverse('edit_profile'))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment