The custom OAuth provider class needs to implement
def is_configured(self):
return True
Without that Authentik backend does not consider injected provider as configured and fails with an error "You must set the environment variable for at least one oauth provider to use oauth authentication."
See
oauth_providers.py
def get_configured_oauth_providers():
return [p.id for p in providers if p.is_configured()]