summaryrefslogtreecommitdiff
path: root/service/pixelated/resources/auth.py
diff options
context:
space:
mode:
authorNavaL <mnandri@thoughtworks.com>2016-01-27 19:29:36 +0100
committerNavaL <mnandri@thoughtworks.com>2016-01-28 10:43:14 +0100
commit766c5617007650d90f1d249aaa253755dcd1906c (patch)
treeebe66b6219cbbab28b5101a72a3338210c69f99c /service/pixelated/resources/auth.py
parent29f0bd4576955536d3714b1c095bcfe387ec51b9 (diff)
making async setup user services after auth
Issue #583
Diffstat (limited to 'service/pixelated/resources/auth.py')
-rw-r--r--service/pixelated/resources/auth.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/service/pixelated/resources/auth.py b/service/pixelated/resources/auth.py
index 4eb6bd02..5e0221cb 100644
--- a/service/pixelated/resources/auth.py
+++ b/service/pixelated/resources/auth.py
@@ -53,12 +53,12 @@ class LeapPasswordChecker(object):
def _validate_credentials():
try:
srp_auth = SRPAuth(self._leap_provider.api_uri, self._leap_provider.local_ca_crt)
- srp_auth.authenticate(credentials.username, credentials.password)
+ return srp_auth.authenticate(credentials.username, credentials.password)
except SRPAuthenticationError:
raise UnauthorizedLogin()
- def _authententicate_user(_):
- return authenticate_user(self._leap_provider, credentials.username, credentials.password)
+ def _authententicate_user(srp_auth):
+ return authenticate_user(self._leap_provider, credentials.username, credentials.password, auth=srp_auth)
d = threads.deferToThread(_validate_credentials)
d.addCallback(_authententicate_user)
@@ -131,7 +131,6 @@ class PixelatedAuthSessionWrapper(object):
def getChildWithDefault(self, path, request):
request.postpath.insert(0, request.prepath.pop())
-
return self._authorizedResource(request)
def _authorizedResource(self, request):