Asynchronous PAM authentication for Node.JS
Asynchronous PAM authentication for NodeJS
You will most likely need to run it as root in most common environments!
Running as non-root on my system (openSUSE 12.1) made a segfault happen somewhere in
It tries to superseed the previous and outdated node-pam extension with the following improvements:
Default service_name for
pam_start(2) is 'login'.
var pam = require'authenticate-pam';pamauthenticate'myusername' 'mysecretpassword'iferrconsole.logerr;elseconsole.log"Authenticated!";;
Proper apps should provide their own service name. Sample services are located in
As an example lookup a service name file for
To do proper network authentication you should also provide
remoteHost key to the options argument. It will be passed to pam as
var pam = require'authenticate-pam';pamauthenticate'rush' 'mysecretpassword'iferrconsole.logerr;elseconsole.log"Authenticated!";serviceName: 'myapp' remoteHost: 'localhost';
npm install authenticate-pam