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
return bytes(token, 'utf-8') in function generate_application_jwt generates exception in jwt.py
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\piotr\.virtualenvs\canlock-server-mGAFEtYs\lib\site-packages\vonage\voice.py", line 28, in create_call
return self._client.post(
File "C:\Users\piotr\.virtualenvs\canlock-server-mGAFEtYs\lib\site-packages\vonage\client.py", line 266, in post
self._request_headers['Authorization'] = self._create_jwt_auth_string()
File "C:\Users\piotr\.virtualenvs\canlock-server-mGAFEtYs\lib\site-packages\vonage\client.py", line 437, in _create_jwt_auth_string
return b"Bearer " + self._generate_application_jwt()
File "C:\Users\piotr\.virtualenvs\canlock-server-mGAFEtYs\lib\site-packages\vonage\client.py", line 441, in _generate_application_jwt
return self._jwt_client.generate_application_jwt(self._jwt_claims)
File "C:\Users\piotr\.virtualenvs\canlock-server-mGAFEtYs\lib\site-packages\vonage_jwt\jwt.py", line 42, in generate_application_jwt
return bytes(token, 'utf-8')
TypeError: encoding without a string argument
Possible Solution
return bytes(token, 'utf-8')
Steps to Reproduce (for bugs)
changed return bytes(token, 'utf-8') to return token
The text was updated successfully, but these errors were encountered:
Hi @piotr-wasilewski I haven't been able to reproduce your issue, this is working fine for me. Can you share more details about the issue you're having?
@piotr-wasilewski this error looks like you haven't generated a token successfully from your private key and are passing an empty string to the bytes method. Can you confirm if that was the case or provide more details so I can reproduce your issue?
Expected Behavior
should return token
Current Behavior
return bytes(token, 'utf-8')
in function generate_application_jwt generates exception in jwt.pyDuring handling of the above exception, another exception occurred:
Possible Solution
return bytes(token, 'utf-8')
Steps to Reproduce (for bugs)
changed
return bytes(token, 'utf-8')
toreturn token
The text was updated successfully, but these errors were encountered: