Skip to content
This repository has been archived by the owner on Mar 8, 2023. It is now read-only.

privacyidea-pam.py not working with sms token #27

Open
svk-28 opened this issue Dec 29, 2021 · 0 comments
Open

privacyidea-pam.py not working with sms token #27

svk-28 opened this issue Dec 29, 2021 · 0 comments

Comments

@svk-28
Copy link

svk-28 commented Dec 29, 2021

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")

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant