zcli login -i login error | Community
Skip to main content

zcli login -i login error

  • January 30, 2023
  • 10 replies
  • 0 views

"failed to log in to your account: ."

Hi, trying to use ZCLI and can't seem to login?

The credentials are correct.

Password access is enabled on the zendesk API, along with token access.

Also tried logging in with the token by putting my email/token in the password field but no luck.

Additionally, does ZCLI require the zendesk account owners login details instead of an admin user?

10 replies

Zach22
  • January 31, 2023

Hi Alex,

I can understand that the prompt is a little unclear for using an API token. In order to use an API token to log in, you will need to enter your email address and then '/token'. For example test@demo.com/token and then enter the API token as a password. ZCLI does not require the Zendesk account owner's login details, an admin user will do just fine.

Hope this helps!


  • Author
  • January 31, 2023

Many thanks Zach.

Still unsure why the password access wasn't working but got in with the token access.


  • February 9, 2023

So, if I am using environment variables, I would need to set:

ZENDESK_SUBDOMAIN = mysubdomain

ZENDESK_EMAIL = username@mycompany.com/token

ZENDESK_PASSWORD = api token

Correct?  If so, that is exactly what I am doing, and I still get the message "Failed to load secure credentials store: use environment variables to log in.  You can user credentials stored in environment variables..."


James148
  • February 9, 2023

Hi @kent11,

If you're using environment variables, omit "/token" from the ZENDESK_EMAIL value. ZCLI will append this suffix for you. I'll update the docs to make this clearer.

Hope that helps!


  • February 11, 2023

Part of my problem was not knowing that if you choose to use the environment variables, you do NOT need to execute the zcli login command.  That part was not clear to me.


James148
  • February 12, 2023

Thanks for the feedback, Kent.

We've made some recent changes to the docs to make this more clear:

  • You can authenticate ZCLI using one method (profiles or environment variables): docs
  • Order of precedence for profiles vs environment variables: docs

  • August 26, 2024

@james148 or others on the Zendesk documentation team:

The current documentation for profiles is incorrect. It says `/token` should be appended to the email when doing `zcli login -i` but that throws this error: 

Failed to log in to your account: .`

Removing `/token` did, however, successfully login to the profile.

This is the section that needs to be fixed: https://developer.zendesk.com/documentation/apps/getting-started/using-zcli/#profiles

ZCLI Version: @zendesk/zcli/1.0.0-beta.47 darwin-x64 node-v20.17.0
 


Zach22
  • August 26, 2024

Hi @nate21 , thanks for flagging this issue. As of version 1.0.0-beta.47, the login command no longer requires '/token' to be appended to your email address. Ill be sure to make sure this is updated in our documentation accordingly.


Jorge43
  • February 18, 2025

The support page titled “Previewing Theme Changes Locally” also still says you need “/token” after the email. Got stuck with “Failed to log in to your account .” for a while until I saw this page.


Zach22
  • February 18, 2025

Hi @jorge43 , thanks for flagging this issue. It looks like we missed updating this documentation previously, so I've gone ahead and organized to have this updated.