I’d run into this issue before–and troubleshooted it a bit, but didn’t have the access or opportunity to find out the root cause, either.
See here: Problem loggin in on CentOS 7 - #11 by hexparrot
It was an identical issue for auth, but basically CentOS must handle PAM modules or such differently, that nodejs can’t tap into it. It’s my best guess that CentOS is locking it down better (and perhaps not SELinux like I posited) and the issue lies in the PAM module config: https://www.centos.org/docs/5/html/Deployment_Guide-en-US/ch-pam.html