GEANT / simplesamlphp-module-selfregister

SimpleSAMLphp Selfregister Module
MIT License
10 stars 14 forks source link

Auto-create userid (login with email address) #16

Open peter- opened 6 years ago

peter- commented 6 years ago

See the updated README for a quick intro!

Re-instantiate functionality that was available in earlier selfregister versions, partially using old code still in use in an older deployment (createUserId(), createUniqueUserId()).

Note that the function createUniqueUserId() included here currenly contains 3 implementations (2 of which are commented out), with comments detailing their pros and cons: The main issue here is that most IDPs will at some point have to support identifiers that prohibit identifier re-assignment from one subject to another (currently in SAML those are persistent NameIDs, subject-id and pairwise-id, plus the older attributes eduPersonTargetedId and eduPersonUniqueId) -- not being able to support such identifiers will severly limit the usefulness of an IDP.
Now, uniqueness among existing entries in the backend storage is trivial (and already included in selfregister code), but uniqueness across time and including previously deleted userids is much harder. So a simplistic implementation was chosen that is time-based, assuming that values generated later will never be identical to values generated earlier, even if those earlier records have meanwhile been deleted. (Another option would have been to re-think the account deletion process, merely marking deleted accounts as inactive and only keeping the userid around, but no other data. This seems much more involved, though, and so has been left as a suggestion for later changes.)

Before merging the above situation (3 implementations, one of which even has its own configuration parameter in the Class's constructor, also commented out here) should be cleaned up, I guess.

Defaults have all been left unchanged, though, so this new (or merely revived) functionality is fully optional.

Btw, if this approach (of avoiding userids altogether, from a subject's perspective) becomes more popular something should probably be done here to make changing the displayed strings easier: Currenty one has to create a custom module with a custom theme, duplicating most of the templates included in the selfregister module, only in order to reference a custom distionary that then says "Email address" instead of "UserID" throughout the registration process (UI, emails).