Interested in a ServiceNow event built for developers? Registration for now[dev]26 is officially open!

BryceG
ServiceNow Employee

OAuth is much better and safer than basic auth and these days it's not much more work to authenticate with now-sdk.  The OAuth app registry comes on every instance and is ready for you to use.  

 

Run this command and specify the alias to name the credential:

now-sdk auth --add https://{instance}.service-now.com --alias {myinstance}

 

Select "Oauth" and follow the instructions and you're ready to go!  It will bring up a browser, allow you to login, request permissions and then instruct you to paste a token back to the terminal.  

 

That credential is now ready to be used with the sdk for development!

 

You can specify the alias to use with the -a flag, or select it as default.

now-sdk install -a myinstance

 

Find more help and instructions: https://servicenow.github.io/sdk/cli#auth

Comments
Shiva Prasad
Tera Contributor

How can you authenticate from behind a proxy ? Any proxy settings file with in SDK or does it take from visual studio code the settings?

Version history
Last update:
2 weeks ago
Updated by: