summary refs log tree commit diff
path: root/synapse
diff options
context:
space:
mode:
authorDavid Baker <dave@matrix.org>2015-04-29 15:40:35 +0100
committerDavid Baker <dave@matrix.org>2015-04-29 15:41:29 +0100
commitb7788f80a3d47faef7656ab2cc3f18628bd0b20b (patch)
tree4bfbb7929d3d597b483ee0685b719c3c6108ccb1 /synapse
parentpushers table requires an access_token (diff)
downloadsynapse-b7788f80a3d47faef7656ab2cc3f18628bd0b20b.tar.xz
Accept both camelcase and underscore threepid creds for transition
Diffstat (limited to '')
-rw-r--r--synapse/handlers/identity.py23
1 files changed, 19 insertions, 4 deletions
diff --git a/synapse/handlers/identity.py b/synapse/handlers/identity.py
index ad8246b58c..a3025bc0db 100644
--- a/synapse/handlers/identity.py
+++ b/synapse/handlers/identity.py
@@ -44,19 +44,34 @@ class IdentityHandler(BaseHandler):
         # XXX: make this configurable!
         # trustedIdServers = ['matrix.org', 'localhost:8090']
         trustedIdServers = ['matrix.org']
-        if not creds['id_server'] in trustedIdServers:
+
+        if 'id_server' in creds:
+            id_server = creds['id_server']
+        elif 'idServer' in creds:
+            id_server = creds['idServer']
+        else:
+            raise SynapseError(400, "No id_server in creds")
+
+        if 'client_secret' in creds:
+            client_secret = creds['client_secret']
+        elif 'clientSecret' in creds:
+            client_secret = creds['clientSecret']
+        else:
+            raise SynapseError(400, "No client_secret in creds")
+
+        if not id_server in trustedIdServers:
             logger.warn('%s is not a trusted ID server: rejecting 3pid ' +
-                        'credentials', creds['id_server'])
+                        'credentials', id_server)
             defer.returnValue(None)
 
         data = {}
         try:
             data = yield http_client.get_json(
                 "https://%s%s" % (
-                    creds['id_server'],
+                    id_server,
                     "/_matrix/identity/api/v1/3pid/getValidated3pid"
                 ),
-                {'sid': creds['sid'], 'client_secret': creds['client_secret']}
+                {'sid': creds['sid'], 'client_secret': client_secret}
             )
         except CodeMessageException as e:
             data = json.loads(e.msg)