now-cli login giving me unauthorized for confirmed credentials

cedricvl
Kilo Contributor

Following all steps on https://developer.servicenow.com/dev.do#!/guides/orlando/now-experience/cli/getting-started, I have now-cli working, but I cannot login to any instance using the admin credentials I know work just fine:

```

$ node --version
v12.16.1

$ now-cli --version
Now CLI @17.0.3

$ now-cli login --host https://xxxx.service-now.com --method basic --username admin --password yyyy
✖ Connection to 'https://xxxx.service-now.com' failed. Credentials not saved.
Response code 401 (Unauthorized)

 login [host] [method] [username] [password]

Login to a glide instance.

```

Is any config required on the instance level to get now-cli logins work?

 
16 REPLIES 16

jwd3
Tera Contributor

Do you happen to have Multi-factor authentication turned on for the instance?  MFA seems to break the now-cli login and you have to turn it off temporarily to deploy.

cedricvl
Kilo Contributor

Thanks for replying @jwd ! MFA is not enabled. It's a basic free personal instance running Orlando. Nothing in particular enabled.

 

Hello

I came across the same issue. now cli throws me an error 'Credentials are not saved' with 401 response code. However I see we have the MFA enabled. I don't think I can disable MFA for my account, as it is enabled via a system property. What would be the alternate ways to login with MFA enabled? 

Any help is appreciated

Thanks

Nitin

HI Nitin,

Did you get any change to disable the MFA in your sys_user table. The field name in Enable Multifactor Authentication in list view. 

Thanks