pam_python
pam_python copied to clipboard
privacyidea-pam.py not working with sms token
privacyidea 3.6.3 privacyidea_pam.py 2.11 pam-python 1.0.8 (with a patch for working with python 3.9)
Error:
12:15:48 vpn7 ocserv[460]: offline check returned: False, None 12:15:48 vpn7 ocserv[460]: /usr/lib/python3/dist-packages/urllib3/connectionpool.py:1015: InsecureRequestWarning: Unverified HTTPS request is being made to host 'otp.dev'. Adding certifica> 12:15:48 vpn7 ocserv[460]: warnings.warn( 12:15:50 vpn7 ocserv[460]: requests > 1.0 12:15:50 vpn7 ocserv[460]: Prompting for challenge response 12:15:50 vpn7 ocserv[460]: Traceback (most recent call last): File "/usr/lib/python3/dist-packages/privacyidea_pam.py", line 329, in pam_sm_authenticate rval = Auth.authenticate(pamh.authtok) File "/usr/lib/python3/dist-packages/privacyidea_pam.py", line 194, in authenticate rval = self.challenge_response(transaction_id, File "/usr/lib/python3/dist-packages/privacyidea_pam.py", line 210, in challenge_response pam_message = self.pamh.Message(self.pamh.PAM_PROMPT_ECHO_ON, message) TypeError: Message() argument 2 must be str, not bytes 12:15:50 vpn7 ocserv[460]: privacyidea_pam: Message() argument 2 must be str, not bytes 12:15:50 vpn7 [460]: PAM authenticate error for 'user': Authentication failure 2:15:50 vpn7 [460]: PAM-auth pam_auth_pass: Authentication failure
after changing the 188 line in privacyidea_pam.py, everything worked: --- message = detail.get("message").encode("utf-8") +++ message = detail.get("message")