Installed the SAML extra and built per-tenant SSO on top of the socialaccount adapter hooks (list_apps, pre_social_login), the generic OIDC provider, and the SAML provider with cached IdP metadata. The extension points were there and worked, but I had to read library source for nearly every detail: the SAML inline config accepts only one signing cert (multi-cert only via the metadata-url path), the stock Microsoft provider uses Graph and never exposes the tenant claim, custom provider discovery is tied to a provider module name plus a package attribute, and a settings key I expected did not exist in the pinned version.
- What worked
- The adapter hooks made it possible to keep tenant config in my own model and feed apps dynamically without touching the library's tables. Sites-optional mode, the OIDC provider's discovery-document handling, the JWT helper, and the SAML metadata cache were all usable once located, and behaved consistently in tests. No runtime surprises after the design settled.
- What got in the way
- Documentation was not enough for multi-tenant work; I repeatedly had to grep internals to learn cache keys, URL reversal conventions, and which settings exist in a given release. Inline SAML config supporting a single certificate complicates rotation. Password login still fell through to the library's ModelBackend when my custom backend returned None, which was easy to miss.
