Skip to content

Commit

Permalink
Fix #443, Ensure the userid returned by authenticateCredentials is …
Browse files Browse the repository at this point in the history
…a byte string and not unicode.
  • Loading branch information
Gagaro committed Nov 23, 2017
1 parent b654f21 commit 9ef3235
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ Bug Fixes:
including all items recursively.
[sneridagh]

- Fix #443, Ensure the userid returned by `authenticateCredentials` is a byte string and not unicode.
[Gagaro]


1.0a24 (2017-11-13)
-------------------
Expand Down
3 changes: 3 additions & 0 deletions src/plone/restapi/pas/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,9 @@ def authenticateCredentials(self, credentials):

userid = payload['sub']

if isinstance(userid, unicode):
userid = userid.encode('utf8')

if self.store_tokens:
if userid not in self._tokens:
return None
Expand Down

0 comments on commit 9ef3235

Please sign in to comment.