Tenant Validation: What is the workaround auth0 Clients should follow?

Continuing the discussion from Tenants are not isolated by domain (URL)?:

I would like to know if on the client side we would like to do some validation if the auth0 tenant exist or not ? what should be the workflow , I couldn’t get the curl or any URL hit at all validating the tenant Name.

they all return 301 , 302 only. This makes it hard for our deployment automation. please help on the tenant validation.

>> curl -i "http://this-is-fake-tenant.eu.auth0.com/"
HTTP/1.1 301 Moved Permanently
Date: Fri, 02 Oct 2020 13:22:35 GMT
Transfer-Encoding: chunked
Connection: keep-alive
Cache-Control: max-age=3600
Expires: Fri, 02 Oct 2020 14:22:35 GMT
Location: https://amaggi-piku-dev.eu.auth0.com/
cf-request-id: 058b139fae0000a7356c930200000001
Set-Cookie: __cf_bm=3dde7131f413615cd12729ce10f7c3a79d41bc02-1601644955-1800-AXISZuN4+u4hrNq+Z09C+t5Fu32u3cxXkq90mSQqx3dSwWY4oqznMHGPTF70k4pRbib4MDcLNezVc9pF/JM7Ac4=; path=/; expires=Fri, 02-Oct-20 13:52:35 GMT; domain=.eu.auth0.com; HttpOnly; SameSite=None
X-Content-Type-Options: nosniff
Server: cloudflare
CF-RAY: 5dbebbac4e09a735-DUB
alt-svc: h3-27=":443"; ma=86400, h3-28=":443"; ma=86400, h3-29=":443"; ma=86400

This doesn’t make sense.

Can you provide more details? Why do you need to validate whether a particular tenant exists or not? I would assume you know your own tenants.

Thanks @markd for your response. Yes I know my own tenants , the reason I need to know is because I am looking to integrate the tenant creation in our automation flow and part of that is to identify if the tenant exists if not skip the step and if it doesn’t create one and then keep in the same next cycle etc.

But by the looks of the URL and response it seems that Auth0 has no implementation of default errors and you always redirect user to same login page and never show any 404 signs so it makes the automation hard.

In my case I probably can go and list all my tenants and traverse and check each one against the input etc , which sort of makes it a bit lengthy process for a small use case.

There’s no way to programatically create new tenants at the moment. Or at least there is no way to do that via an API.