Access multiple tenants from Auth0 CLI login

I am starting to use Auth0 CLI and it is generally working nicely, but I cannot choose a tenant when I login (auth0 login). It always defaults to the same tenant (which happens not to be our production tenant).

If I specify --domain on the auth0 login command, I end up with an “Activation Denied” error in the browser after confirming the code, etc.

Has anyone else run into this issue and how did you resolve it?

Hi,

Are you using a private cloud or a public cloud? I am encountering the same issue in the private cloud, where we can only log in to one tenant at a time using the client credentials method (such as domain Client ID and secret). If it’s a public cloud, I can log in as a user and access multiple tenants without any issues.

Hmm. We are public cloud.

When I use the “auth0 login” command (MacOS, terminal shell window) it logs in fine (as user) but always goes to our non-production tenant. There is no tenant choice dropdown available in the browser.

If I try to use “auth0 login --domain ” to login as user to a specific tenant, then that is when I end up with the “Activation Denied” page in the browser.

Hi @timc

Welcome to the Auth0 Community!

Thank you for posting your question. I couldn’t reproduce this issue on my end, but I found this GitHub issue that may be a good hint → unable to login to a different tenant · Issue #1003 · auth0/auth0-cli · GitHub. Can you try to reinstall your package or check if you are using the latest version? In terms of switching between default tenants, you can use the auth0 tenants use [tenant_name] command or simply auth0 tenants use and pick the tenant from the dropdown. Also you can try to clear your browser cache and try to re-login.

Thanks
Dawid

Not Sure if it is resolved if not use below commend. You can switch tenant by using this commend.

auth0 tenants use tenantdomain.us.auth0.com

Sorry, but the “auth0 tenants use” command doesn’t work for me because the “auth0 tenants list” command only lists the one tenant that I’m logged in to.

Also, clearing the browser cache for auth0 did not help either.

Here is what I do:

  1. In MacOS terminal session, type “auth0 login”
  2. Choose “as a user”
  3. Press enter to open browser to log in
  4. In browser (Safari), I see a “Device Confirmation” window
  5. I click “Confirm” on the device confirmation window
  6. I see an “App Authorization” window - there is a long list of things the app will have access to, but there is no drop down to choose from available tenants
  7. I click “Accept”
  8. I see a “Congratulations” browser window
  9. In the terminal session, it says “Successfully logged in” and shows “Tenant: release-…”
  10. “auth0 tenants list” shows only the one tenant that I am logged into

This is NOT solved. How do I unsolve my topic?

The github issue linked to only shows that somebody cloned the repo and ran it that way. Do I really have to do that?

I log in to auth0 in the browser with Google SSO, in case that matters.

There must be a dropdown on point number 6. I have attached a sample image from when I am logged in. You have access to both tenants in the same email, correct? Check my attached image.

That is my problem, there is no dropdown.

Here is my screen shot:

Hi Folks,

To solve the issue from the thread, you, as a tenant member, need to have admin privileges to access the tenant settings from the Auth0 CLI.

Thanks
Dawid

Thank you, Dawid, for your investigation and response.

I don’t need to access tenant settings, though, I just want to be able to do the same things in the production tenant from the Auth0 CLI that I can already do in the Auth0 Dashboard - examine our users, create/delete users, reset MFA for our users, etc.

If that is not possible without Admin role/privilege in the production tenant, then I will see if I can get that.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.