summary refs log tree commit diff
path: root/synapse/api
diff options
context:
space:
mode:
authorDaniel Wagner-Hall <dawagner@gmail.com>2016-02-02 19:22:43 +0000
committerDaniel Wagner-Hall <dawagner@gmail.com>2016-02-02 19:22:43 +0000
commit2e36689df33b6c2a6c9ff91b966373515c8dbe1e (patch)
tree35c5180ead04a957ee9036f18a7256586d69df01 /synapse/api
parentExplain what W503 is (diff)
parentLog more diagnostics for unrecognised access tokens (diff)
downloadsynapse-2e36689df33b6c2a6c9ff91b966373515c8dbe1e.tar.xz
Merge pull request #553 from matrix-org/daniel/accesstokenlogging
Log more diagnostics for unrecognised access tokens
Diffstat (limited to 'synapse/api')
-rw-r--r--synapse/api/auth.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/synapse/api/auth.py b/synapse/api/auth.py
index c5a2865e26..5bba9343f6 100644
--- a/synapse/api/auth.py
+++ b/synapse/api/auth.py
@@ -696,6 +696,7 @@ class Auth(object):
     def _look_up_user_by_access_token(self, token):
         ret = yield self.store.get_user_by_access_token(token)
         if not ret:
+            logger.warn("Unrecognised access token - not in store: %s" % (token,))
             raise AuthError(
                 self.TOKEN_NOT_FOUND_HTTP_STATUS, "Unrecognised access token.",
                 errcode=Codes.UNKNOWN_TOKEN
@@ -713,6 +714,7 @@ class Auth(object):
             token = request.args["access_token"][0]
             service = yield self.store.get_app_service_by_token(token)
             if not service:
+                logger.warn("Unrecognised appservice access token: %s" % (token,))
                 raise AuthError(
                     self.TOKEN_NOT_FOUND_HTTP_STATUS,
                     "Unrecognised access token.",