Skip to content

fix for user logins with shibboleth

Alexander Pace requested to merge fix-contacts into master

The schema where all usernames are lower-case was never enforced for logins coming from shibboleth on the web. The byproduct of this was users logging in to the site, and not being able to see their alert info (like phone and email) since that was tied to their lowercase account.

Note that all users' interaction on the web and with the API are unaffected by this bug. But, an unaffected consequence of this is that users that logged into the web interface in the last three weeks now have a separate account (@LIGO.ORG) that can safely be deleted. There are only 37 accounts on the production server at the moment. So after this gets deployed, an admin should run:

In :from django.contrib.auth.models import User, Group

# Look at the accounts:

In :  User.objects.filter(username__contains='LIGO.ORG')
Out: <QuerySet [<User: thomas.dent@LIGO.ORG>, <User: samuele.ronchini@LIGO.ORG>, <User: richard.oshaughnessy@LIGO.ORG>, <User: daniel.williams@LIGO.ORG>, <User: rhiannon.udall@LIGO.ORG>, <User: edoardo.milotti@LIGO.ORG>, <User: fiona.panther@LIGO.ORG>, <User: aaron.zimmerman@LIGO.ORG>, <User: sushant.sharma-chaudhary@LIGO.ORG>, <User: lorena.magana-zertuche@LIGO.ORG>, <User: simone.albanesi@LIGO.ORG>, <User: derek.davis@LIGO.ORG>, <User: leo.singer@LIGO.ORG>, <User: keita.kawabe@LIGO.ORG>, <User: andrew.lundgren@LIGO.ORG>, <User: nicolas.arnaud@LIGO.ORG>, <User: manoj.kovalam@LIGO.ORG>, <User: judith.racusin@LIGO.ORG>, <User: albertcheng.zhang@LIGO.ORG>, <User: gayathri.v@LIGO.ORG>, '...(remaining elements truncated)...']>

# Count how many:

In :  User.objects.filter(username__contains='LIGO.ORG').count()
Out: 37

# Wipe them:

for u in User.objects.filter(username__contains='LIGO.ORG'):
    u.delete()

Merge request reports