summary refs log tree commit diff
path: root/synapse/handlers/identity.py
diff options
context:
space:
mode:
authorMark Haines <mark.haines@matrix.org>2015-04-30 16:54:55 +0100
committerMark Haines <mark.haines@matrix.org>2015-04-30 16:54:55 +0100
commit2d4d2bbae4f35e3128fa492e45cfc5b0750524bc (patch)
tree8e3fa03a60443dc2a1af80d5fb13aa0e28ffddca /synapse/handlers/identity.py
parentWrite a default log_config when generating config (diff)
parentAdd get_rooms_for_user cache (diff)
downloadsynapse-2d4d2bbae4f35e3128fa492e45cfc5b0750524bc.tar.xz
Merge branch 'develop' into markjh/config_cleanup
Conflicts:
	synapse/config/captcha.py
Diffstat (limited to 'synapse/handlers/identity.py')
-rw-r--r--synapse/handlers/identity.py19
1 files changed, 17 insertions, 2 deletions
diff --git a/synapse/handlers/identity.py b/synapse/handlers/identity.py
index cbb3184ca5..6200e10775 100644
--- a/synapse/handlers/identity.py
+++ b/synapse/handlers/identity.py
@@ -87,14 +87,29 @@ class IdentityHandler(BaseHandler):
         logger.debug("binding threepid %r to %s", creds, mxid)
         http_client = SimpleHttpClient(self.hs)
         data = None
+
+        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")
+
         try:
             data = yield http_client.post_urlencoded_get_json(
                 "https://%s%s" % (
-                    creds['id_server'], "/_matrix/identity/api/v1/3pid/bind"
+                    id_server, "/_matrix/identity/api/v1/3pid/bind"
                 ),
                 {
                     'sid': creds['sid'],
-                    'client_secret': creds['client_secret'],
+                    'client_secret': client_secret,
                     'mxid': mxid,
                 }
             )