validate/smspin failed with UnicodeEncodeError

173 views
Skip to first unread message

alext...@gmail.com

unread,
Jun 19, 2014, 6:55:00 AM6/19/14
to lin...@googlegroups.com
Hi all,
I am using LinOTP 2.7 installed in CentOS 6.5 (pip installation).

I have:

- configured an sms challenge/response policy (challenge_response=sms) as explained in the documentation
- configured sms otp token
- used the /validate/smspin? to challenge an sms
- and the /validate/check? (providing the transactionid and the otp) to validate the user

Seems to work correctly, but when I configure a policy for sms text (smstext= ”your OTP: <otp>”), triggering with /validate/smspin? results to:

"error": {
"message": "validate/smspin failed: The PIN was correct, but the SMS could not be sent: UnicodeEncodeError('ascii', u'\\u201dyour OTP: 822445\\u201d', 0, 1, 'ordinal not in range(128)')",
"code": -311
}

(I can live without this sms text policy ;-) , but I think I should spread this...)

thank you

alext...@gmail.com

unread,
Jun 19, 2014, 8:19:53 AM6/19/14
to lin...@googlegroups.com, alext...@gmail.com
further on this...
the linotp log file was like:


2014/06/19 - 13:42:44 WARNI {-1359537296} [smsprovider.HttpSMSProvider][submitMessage #136] Failed to access the HTTP SMS Service with httplib: UnicodeEncodeError('ascii', u'\u201dyour OTP: 822445\u201d', 0, 1, 'ordinal not in range(128)')
2014/06/19 - 13:42:44 ERROR {-1359537296} [smsprovider.HttpSMSProvider][urllib_request #406] HttpSMSProvider UnicodeEncodeError('ascii', u'\u201dyour OTP: 822445\u201d', 0, 1, 'ordinal not in range(128)')
2014/06/19 - 13:42:44 WARNI {-1359537296} [smsprovider.HttpSMSProvider][submitMessage #148] Failed again to access the HTTP SMS Service: Exception("Failed to send SMS. 'ascii' codec can't encode character u'\\u201d' in position 0: ordinal not in range(128)",)
2014/06/19 - 13:42:44 WARNI {-1359537296} [linotp.lib.tokens.smstoken][submitChallenge #307] [submitChallenge] The PIN was correct, but the SMS could not be sent: UnicodeEncodeError('ascii', u'\u201dyour OTP: 822445\u201d', 0, 1, 'ordinal not in range(128)')
2014/06/19 - 13:42:44 WARNI {-1359537296} [linotp.lib.tokens.smstoken][submitChallenge #307] [submitChallenge] The PIN was correct, but the SMS could not be sent: UnicodeEncodeError('ascii', u'\u201dyour OTP: 822445\u201d', 0, 1, 'ordinal not in range(128)')
2014/06/19 - 13:42:45 ERROR {-1359537296} [linotp.controllers.validate][smspin #759] [smspin] validate/smspin failed: Exception("The PIN was correct, but the SMS could not be sent: UnicodeEncodeError('ascii', u'\\u201dyour OTP: 822445\\u201d', 0, 1, 'ordinal not in range(128)')",)
2014/06/19 - 13:42:45 ERROR {-1359537296} [linotp.controllers.validate][smspin #759] [smspin] validate/smspin failed: Exception("The PIN was correct, but the SMS could not be sent: UnicodeEncodeError('ascii', u'\\u201dyour OTP: 822445\\u201d', 0, 1, 'ordinal not in range(128)')",)
2014/06/19 - 13:42:45 ERROR {-1359537296} [linotp.controllers.validate][smspin #760] [smspin] Traceback (most recent call last):
File "/opt/linotp-2.7-dev/lib/python2.7/site-packages/linotp/controllers/validate.py", line 753, in smspin
raise Exception(message)
Exception: The PIN was correct, but the SMS could not be sent: UnicodeEncodeError('ascii', u'\u201dyour OTP: 822445\u201d', 0, 1, 'ordinal not in range(128)')

2014/06/19 - 13:42:45 ERROR {-1359537296} [linotp.controllers.validate][smspin #760] [smspin] Traceback (most recent call last):
File "/opt/linotp-2.7-dev/lib/python2.7/site-packages/linotp/controllers/validate.py", line 753, in smspin
raise Exception(message)
Exception: The PIN was correct, but the SMS could not be sent: UnicodeEncodeError('ascii', u'\u201dyour OTP: 822445\u201d', 0, 1, 'ordinal not in range(128)')


when in the same policy I changed the string (smstext= "your OTP: <otp>") to (smstext= 'your OTP: <otp>') everything was great!!!

Reply all
Reply to author
Forward
0 new messages