Do you want to use names but populate the name field via the API? If that’s the case, the recommended solution is generally DiscourseConnect - Official Single-Sign-On for Discourse (sso).
But if you really want names enabled (making David’s solution not what you want) and don’t want SSO (which is how most people solve what I think your problem is) then you could populate it with your API Magic and hide or otherwise change the ability to edit it in the UX with a theme component.