Page MenuHomePhabricator

Prevent users from editing their username / real name during self-service registration
Closed, ResolvedPublic

Description

Currently, we on-board users into phabricator manually; i.e. human administrators must add accounts and send invite emails. We'd like to automate this, such that human admins need not be involved in account creation.

We use Google Apps as a primary "truth store" for user identity and authentication, and, for our use case, it's sufficient to say that if you have a <username>@<organization>.com address, you're allowed to have a phabricator account too. Existing functionality (turning on registration in the Google auth provider, but applying a restrictive setting for auth.email-domains) can get us this far.

The problem is, we also want to ensure that users' phabricator usernames match their google usernames - i.e. if your google login is foobar@<organization>.com, then your phabricator username must be foobar as well (we enforce this currently via our manual process, but ... manual process). When users register via Google OAuth, Phabricator does pre-populate the username / real name fields with the values we want, but then, the end-user then has the opportunity to change them. We'd like to have the option to prevent that.

Related Objects

Event Timeline

This is possible today, although only via the older events API:

  • Drop something like P1214 into src/extensions/.
  • Also call setCanEditRealName(false).
  • Disable account.editable in Config.

These hooks and options are rarely used and the events system is gradually being replaced with EngineExtensions, but I don't have any particular plans to touch this part of the code in the near future.

(The $profile object is a PhabricatorRegistrationProfile and has a few other methods available.)

epriestley claimed this task.

Presuming this is resolved, let us know if that isn't the case.