It would be pretty easy (but a lot of work) to roll your own using Django. Is there anything that works out of the box? and is battle tested?
I would consider looking into Keycloak, which is an opensource platform similar to Okta/Auth0 that you can self host: