From 2df6114bc449194fa99aae3f7c41b37e1ea0dbcf Mon Sep 17 00:00:00 2001
From: Daniel Wagner-Hall <dawagner@gmail.com>
Date: Tue, 2 Feb 2016 19:21:49 +0000
Subject: [PATCH] Log more diagnostics for unrecognised access tokens

---
 synapse/api/auth.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/synapse/api/auth.py b/synapse/api/auth.py
index c5a2865e2..5bba9343f 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.",