You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While testing out the OAuth1 functionality, I bumped into the following:
2014-07-22 09:50:35,460 [ERROR] django.request: Internal Server Error: /xAPI/OAuth/initiate
Traceback (most recent call last):
File "/home/adllrs/LRS/env/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 111, in get_response
response = callback(request, *callback_args, **callback_kwargs)
File "/home/adllrs/LRS/ADL_LRS/oauth_provider/views.py", line 41, in request_token
token = oauth_server.fetch_request_token(oauth_request)
File "/home/adllrs/LRS/ADL_LRS/oauth_provider/oauth/oauth.py", line 405, in fetch_request_token
self._check_signature(oauth_request, consumer, None)
File "/home/adllrs/LRS/ADL_LRS/oauth_provider/oauth/oauth.py", line 505, in _check_signature
token, signature)
File "/home/adllrs/LRS/ADL_LRS/oauth_provider/oauth/oauth.py", line 601, in check_signature
built = self.build_signature(oauth_request, consumer, token)
File "/home/adllrs/LRS/ADL_LRS/oauth_provider/oauth/oauth.py", line 633, in build_signature
hashed = hmac.new(key, raw, sha)
File "/usr/lib/python2.7/hmac.py", line 133, in new
return HMAC(key, msg, digestmod)
File "/usr/lib/python2.7/hmac.py", line 72, in __init__
self.outer.update(key.translate(trans_5C))
TypeError: character mapping must return integer, None or unicode
From what I can find out, HMAC does not accept unicode for the key, but for reasons I haven't figured out yet, is receiving a unicode key.
My temporary solution is to edit ADL_LRS/oauth_provider/oauth/oauth.py
line 633, from:
hashed = hmac.new(key, raw, sha)
to:
hashed = hmac.new(str(key), raw, sha)
My envorinment:
Unbuntu 14.04 LTS server 64bit
Python 2.7.6
The text was updated successfully, but these errors were encountered:
Do you have any code/process to duplicate the issue? I cannot duplicate it. There is an open pull request now that uses an updated version of the oauth library so hopefully it will handle this.
Unfortunately I have no procedure. A basic Ubuntu 14.04 LTS install, and that's pretty much it.
I can see tests in the merge request, and it is quite possible that my current odd setup is the issue. The tests are good enough for me, and my current easy fix-of-fortune is doing the job for the moment.
I will create a new bug, with documentation, if the problem reoccurs on a new setup.
While testing out the OAuth1 functionality, I bumped into the following:
From what I can find out, HMAC does not accept unicode for the key, but for reasons I haven't figured out yet, is receiving a unicode key.
My temporary solution is to edit ADL_LRS/oauth_provider/oauth/oauth.py
line 633, from:
hashed = hmac.new(key, raw, sha)
to:
hashed = hmac.new(str(key), raw, sha)
My envorinment:
The text was updated successfully, but these errors were encountered: