mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-08-11 20:00:17 -04:00
Add config option for always using "userinfo endpoint" for OIDC (#7658)
This allows for connecting to certain IdPs, e.g. GitLab.
This commit is contained in:
parent
0b68577ed6
commit
05ee048f2c
6 changed files with 65 additions and 15 deletions
|
@ -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)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue