summary refs log tree commit diff
path: root/tests/handlers/test_oidc.py
diff options
context:
space:
mode:
authorBBBSnowball <bbbsnowball@gmail.com>2020-10-01 19:54:35 +0200
committerGitHub <noreply@github.com>2020-10-01 13:54:35 -0400
commit05ee048f2c9ce0bb8a7d2430b21ca3682ef5858b (patch)
tree87485cf6c0e87b270db93ff00e6eeda9c2b3236c /tests/handlers/test_oidc.py
parentMerge tag 'v1.21.0rc1' into develop (diff)
downloadsynapse-05ee048f2c9ce0bb8a7d2430b21ca3682ef5858b.tar.xz
Add config option for always using "userinfo endpoint" for OIDC (#7658)
This allows for connecting to certain IdPs, e.g. GitLab.
Diffstat (limited to '')
-rw-r--r--tests/handlers/test_oidc.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/tests/handlers/test_oidc.py b/tests/handlers/test_oidc.py
index d5087e58be..b6f436c016 100644
--- a/tests/handlers/test_oidc.py
+++ b/tests/handlers/test_oidc.py
@@ -286,9 +286,15 @@ class OidcHandlerTestCase(HomeserverTestCase):
                 h._validate_metadata,
             )
 
-        # Tests for configs that the userinfo endpoint
+        # Tests for configs that require the userinfo endpoint
         self.assertFalse(h._uses_userinfo)
-        h._scopes = []  # do not request the openid scope
+        self.assertEqual(h._user_profile_method, "auto")
+        h._user_profile_method = "userinfo_endpoint"
+        self.assertTrue(h._uses_userinfo)
+
+        # Revert the profile method and do not request the "openid" scope.
+        h._user_profile_method = "auto"
+        h._scopes = []
         self.assertTrue(h._uses_userinfo)
         self.assertRaisesRegex(ValueError, "userinfo_endpoint", h._validate_metadata)