To get the best of both "build" and "buy", I recommend using one of the open source alternatives.
That way, you have as much control over it as if you built it yourself but it comes ready made and off the shelf.
The open source options are: Keycloak, SuperTokens, Ory and many more
(Im the cofounder of SuperTokens)