external_auth reworked for BYOD database.