summary refs log tree commit diff
diff options
context:
space:
mode:
authorDavid Baker <dave@matrix.org>2019-06-11 19:53:20 +0100
committerDavid Baker <dave@matrix.org>2019-06-11 19:53:20 +0100
commitc130100a510f1fa67a96cdc3beec417508c84943 (patch)
tree4a340b63b76ac0492fc22e93bf59f9d6c69dbae5
parenttry different attrs (diff)
downloadsynapse-dbkr/saml_auth0_test.tar.xz
-rw-r--r--synapse/rest/saml2/response_resource.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/synapse/rest/saml2/response_resource.py b/synapse/rest/saml2/response_resource.py
index ae2af07ce5..bdd956e694 100644
--- a/synapse/rest/saml2/response_resource.py
+++ b/synapse/rest/saml2/response_resource.py
@@ -62,13 +62,13 @@ class SAML2ResponseResource(Resource):
         if saml2_auth.not_signed:
             raise CodeMessageException(400, "SAML2 response was not signed")
 
-        if "uid" not in saml2_auth.ava:
+        if "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/upn" not in saml2_auth.ava:
             logger.info("ava: %r", saml2_auth.ava)
-            raise CodeMessageException(400, "uid not in SAML2 response")
+            raise CodeMessageException(400, "upn not in SAML2 response")
 
-        username = saml2_auth.ava["uid"][0]
+        username = saml2_auth.ava["http://schemas.xmlsoap.org/ws/2005/05/identity/claims/upn"][0]
 
-        displayName = saml2_auth.ava.get("displayName", [None])[0]
+        displayName = saml2_auth.ava.get("http://schemas.auth0.com/nickname", [None])[0]
         return self._sso_auth_handler.on_successful_auth(
             username, request, relay_state,
             user_display_name=displayName,