pamtester can be used to test your PAM setup, to install it:
pamtester
pkg install pamtester
To test for example openvpn:
pamtester -v openvpn test authenticate