From 62e7904d8791a600474ca6491db75eb9102a1093 Mon Sep 17 00:00:00 2001 From: Tulio Casagrande Date: Fri, 23 Sep 2016 15:28:59 -0300 Subject: Replace SRPSession usages with bonafide In order to replace leap_auth with bonafide, we created a class to hold the user credentials --- service/pixelated/resources/auth.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'service/pixelated/resources/auth.py') 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) -- cgit v1.2.3