The following product requirements cause implementation challenges:
- Authentication via third party providers
- No storage of user credentials
- Access to the Wagtail CMS
A key stakeholder requirement is that users login via third-party services. This means:
- The credentials are handled and stored by the identity provider
- We only receive the user identity, and an affirmation of their authenticity.
This automatically poses a problem with the Wagtail CMS, which requires on its own accord:
- A user identity (username)
- A user credential (password)
Evidently, requirement (1) means we do not possess the password, with the exception of intercepting it via a form and a proxy network request (which, mind you, is not always possible). Furthermore, requirement (2) would be violated if we do capture and store the credential. This is not a hard requirement, but imposes a data handling burden which (1) was supposed to alleviate.
Should we decide not to violate (2) (which is not always possible), then we are left with determining what to do about (3). After all, it needs credentials too. We could use the client's identity as that for the CMS, which is fine. However, we cannot use the password, because we presume now to not store it.
A workaround might be to create separate credentials upon first-login with the third-party provider to use with the Wagtail CMS. However, this:
- Reintroduces (2), as these credentials (if improperly stored) would allow someone to impersonate the user on the site (albeit not on sister federated sites)
- Would be inaccessible after the user first log's out, given that the Django/Wagtail credential store auto-hashes the password, and the plaintext input would then be lost for the following re-authentication (unless you store it alongside in plaintext, which would be grossly irresponsible)
A workaround to this workaround would be to ask the user to maintain this separate set of credentials, but then that would invalidate (1), reducing it from a sign-in service to more of a register-referral service.
The current solutions, as I see it are:
- Require users to maintain a separate set of credentials
- Provide a third party authentication module to Wagtail/Django, or write our own
- Implement a completely custom user model.