diff options
author | Tulio Casagrande <tcasagra@thoughtworks.com> | 2016-09-23 15:28:59 -0300 |
---|---|---|
committer | Tulio Casagrande <tcasagra@thoughtworks.com> | 2016-09-23 15:38:47 -0300 |
commit | 62e7904d8791a600474ca6491db75eb9102a1093 (patch) | |
tree | 180235903c9c0d195083f89fb740f641218a7319 /service/pixelated/resources/auth.py | |
parent | e2cb0deda1e0668dd23e0fefc8020d10c1cad488 (diff) |
Replace SRPSession usages with bonafide
In order to replace leap_auth with bonafide, we created a
class to hold the user credentials
Diffstat (limited to 'service/pixelated/resources/auth.py')
-rw-r--r-- | service/pixelated/resources/auth.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/service/pixelated/resources/auth.py b/service/pixelated/resources/auth.py index 5581d080..66aac4e5 100644 --- a/service/pixelated/resources/auth.py +++ b/service/pixelated/resources/auth.py @@ -17,7 +17,6 @@ import logging import re -from leap.exceptions import SRPAuthenticationError from twisted.cred.checkers import ANONYMOUS from twisted.cred.credentials import ICredentials from twisted.cred.error import UnauthorizedLogin @@ -30,6 +29,7 @@ from twisted.web import util from twisted.cred import error from twisted.web.resource import IResource, ErrorPage +from leap.bonafide._srp import SRPAuthError from pixelated.config.leap import create_leap_session, authenticate from pixelated.resources import IPixelatedSession @@ -50,7 +50,7 @@ class LeapPasswordChecker(object): def requestAvatarId(self, credentials): try: auth = yield authenticate(self.provider, credentials.username, credentials.password) - except SRPAuthenticationError: + except SRPAuthError: raise UnauthorizedLogin() leap_session = yield create_leap_session(self.provider, credentials.username, credentials.password, auth) |