python-social-auth/social-core

Use fullname and first_name/last_name ~interchangeably

dehnert opened this issue · 0 comments

Expected behaviour

When the SAML backend supplies a fullname, my Django user should have first_name and last_name set: if fullname is set but not first_name/last_name, PSA should (optionally?) generate a first_name and last_name automatically (my inclination is something like first_name, _space, last_name = fullname.rpartition(' ')). If there are systems (that is, non-Django web frameworks) that want a fullname, it should do the opposite transformation when fullname is missing.

Actual behaviour

My Django user has neither first_name nor last_name.

What are the steps to reproduce this issue?

Input clear steps to reproduce the issue for a maintainer.

  1. Use social_django
  2. Configure the SAML backend to return a fullname, but not a first_name or last_name
  3. Log in using SAML
  4. Observe that the Django user created doesn't have a first_name/last_name set

Any logs, error output, etc?

N/A

Any other comments?

Unfortunate I don't understand how data flows through PSA well enough to supply a patch.

I suspect that this ideally wants to be configurable (on/off and perhaps a custom fullname->first_name/last_name function) per-backend.