Auth0 Home Blog Docs

Securing a node CLI with auth0


#1

I’m a little lost trying to get a CLI I’m developing to be a client for auth0. I have auth0 set up with a database connection and users and an oclif based node.js CLI application. I’d like to prompt users to login and then use the token I recieve to send to our web services. I pulled auth0-js from npm which we use on our web site. WebAuth is browser only and I can’t instansiate Authentication directly as it doesn’t have a login method that takes the same email/password credentials. Am I barking up the wrong tree?


#2

Hi @piers

Since you’re using node.js you want to use the node-auth0 library instead of the auth0-js library.

With this library you can use the Database Authenticator to login using username / password combo (relevant docs).

Hope this helps!