{"id":17222898,"url":"https://github.com/rush/node-authenticate-pam","last_synced_at":"2025-08-08T02:46:40.455Z","repository":{"id":3774293,"uuid":"4851336","full_name":"Rush/node-authenticate-pam","owner":"Rush","description":"Asynchronous PAM authentication for NodeJS","archived":false,"fork":false,"pushed_at":"2022-11-11T08:10:23.000Z","size":26,"stargazers_count":46,"open_issues_count":11,"forks_count":55,"subscribers_count":9,"default_branch":"master","last_synced_at":"2024-10-19T21:11:00.433Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Rush.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"MIT-LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null}},"created_at":"2012-07-01T15:50:37.000Z","updated_at":"2023-12-23T21:17:28.000Z","dependencies_parsed_at":"2023-01-11T20:11:59.351Z","dependency_job_id":null,"html_url":"https://github.com/Rush/node-authenticate-pam","commit_stats":null,"previous_names":["rushpl/node-authenticate-pam"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rush%2Fnode-authenticate-pam","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rush%2Fnode-authenticate-pam/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rush%2Fnode-authenticate-pam/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rush%2Fnode-authenticate-pam/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Rush","download_url":"https://codeload.github.com/Rush/node-authenticate-pam/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248799968,"owners_count":21163404,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-15T04:06:40.318Z","updated_at":"2025-04-14T00:18:08.978Z","avatar_url":"https://github.com/Rush.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"node-authenticate-pam\n=====================\n\nAsynchronous PAM authentication for NodeJS\n\n*You will most likely need to run it as root in most common environments!*\n**Running as non-root on my system (openSUSE 12.1) made a segfault happen somewhere in `libpam`! - but seems ok on on openSUSE Leap 42.2**\n\nIt tries to superseed the previous and outdated node-pam extension with the following improvements:\n* Allows to provide own service name, for example common-auth or any custom service name defined in `/etc/pam.d`\n* Allows to provide PAM_RHOST via 'remoteHost' option. It is used to provide remote network authentication that will skip any local only authentication methods like for example fingerprint reading.\n* Already mentioned utilization of libuv and node-gyp\n* Proper type checking in C++ code, it throws exception if bad types are given\n* In case of error it passes the error string containing both pam function and `pam_strerror()` results\n\nExample\n=========\n\nSimple usage\n------------\nDefault service_name for `pam_start(2)` is 'login'.\n\n```js\nvar pam = require('authenticate-pam');\npam.authenticate('myusername', 'mysecretpassword', function(err) {\n    if(err) {\n      console.log(err);\n    }\n    else {\n      console.log(\"Authenticated!\");\n    }\n  });\n```\n\nUsage with options:\n-------------------\nProper apps should provide their own service name. Sample services are located in `/etc/pam.d`.\nAs an example lookup a service name file for `sshd`.\nTo do proper network authentication you should also provide `remoteHost` key to the options argument. It will be passed to pam as `PAM_RHOST` (`pam_set_item(2)`)\n\n```js\nvar pam = require('authenticate-pam');\npam.authenticate('rush', 'mysecretpassword', function(err) {\n    if(err) {\n      console.log(err);\n    }\n    else {\n      console.log(\"Authenticated!\");\n    }\n}, {serviceName: 'myapp', remoteHost: 'localhost'});\n```\n    \nInstall\n-------------------\nFirst you need install the development version of PAM libraries for your distro.\n\n**Centos and RHEL**:\n`yum install pam-devel`\n\n**Debian/Ubuntu**:\n`apt-get install libpam0g-dev`\n\n**debian6/maverick/natty**:\n`apt-get install libreadline5-dev`\n\n**oneiric (and any newer, eg. Debian 7 or Ubuntu 12.04)**:\n`apt-get install libreadline-gplv2-dev`\n\nThen you can install the module:\n`npm install authenticate-pam`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frush%2Fnode-authenticate-pam","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frush%2Fnode-authenticate-pam","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frush%2Fnode-authenticate-pam/lists"}