This enables using a custom user model with a primary key with a name different than 'id'; refs #22889.