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

Hi Murali 

Yes I have disabled that field and it's still the same. Any thoughts?

Thanks 

Nitin

Muralidharan BS
Mega Sage
Mega Sage

HI There,

Check if the user name is not having any spaces, use single word and try it. I initially had space in the username and got the same error. 

Check the steps,

1. npm install @servicenow/cli -g

2. now-cli login --host https://<yourInstance>.service-now.com --method basic --username <UserName> --password <password>

 

Thanks

Thanks for the suggestion. Unfortunately that's not the case either. I'm logging in with the default 'admin' username. Is that a possible cause? Admin can't login through these APIs as a security precaution? On vacation now, but will try it out when back at work.

I am using the admin username and I have reset the pass and tried, It is working, also tried in a lab instance which works fine too. You can check after your holidays. Happy vacation!

Timofey Kosa
Kilo Explorer

I have the same issue, how did u fix this?