@@ -50,11 +50,37 @@ def test_get_connect_discovery_info(self):
5050 "token_endpoint_auth_methods_supported" : ["client_secret_post" , "client_secret_basic" ],
5151 "claims_supported" : ["sub" ],
5252 }
53- response = self .client .get (reverse ("oauth2_provider:oidc-connect-discovery-info" ))
53+ response = self .client .get ("/o/.well-known/openid-configuration" )
54+ self .assertEqual (response .status_code , 200 )
55+ assert response .json () == expected_response
56+
57+ def test_get_connect_discovery_info_deprecated (self ):
58+ expected_response = {
59+ "issuer" : "http://localhost/o" ,
60+ "authorization_endpoint" : "http://localhost/o/authorize/" ,
61+ "token_endpoint" : "http://localhost/o/token/" ,
62+ "userinfo_endpoint" : "http://localhost/o/userinfo/" ,
63+ "jwks_uri" : "http://localhost/o/.well-known/jwks.json" ,
64+ "scopes_supported" : ["read" , "write" , "openid" ],
65+ "response_types_supported" : [
66+ "code" ,
67+ "token" ,
68+ "id_token" ,
69+ "id_token token" ,
70+ "code token" ,
71+ "code id_token" ,
72+ "code id_token token" ,
73+ ],
74+ "subject_types_supported" : ["public" ],
75+ "id_token_signing_alg_values_supported" : ["RS256" , "HS256" ],
76+ "token_endpoint_auth_methods_supported" : ["client_secret_post" , "client_secret_basic" ],
77+ "claims_supported" : ["sub" ],
78+ }
79+ response = self .client .get ("/o/.well-known/openid-configuration/" )
5480 self .assertEqual (response .status_code , 200 )
5581 assert response .json () == expected_response
5682
57- def expect_json_response_with_rp (self , base ):
83+ def expect_json_response_with_rp_logout (self , base ):
5884 expected_response = {
5985 "issuer" : f"{ base } " ,
6086 "authorization_endpoint" : f"{ base } /authorize/" ,
@@ -83,7 +109,7 @@ def expect_json_response_with_rp(self, base):
83109
84110 def test_get_connect_discovery_info_with_rp_logout (self ):
85111 self .oauth2_settings .OIDC_RP_INITIATED_LOGOUT_ENABLED = True
86- self .expect_json_response_with_rp (self .oauth2_settings .OIDC_ISS_ENDPOINT )
112+ self .expect_json_response_with_rp_logout (self .oauth2_settings .OIDC_ISS_ENDPOINT )
87113
88114 def test_get_connect_discovery_info_without_issuer_url (self ):
89115 self .oauth2_settings .OIDC_ISS_ENDPOINT = None
@@ -117,7 +143,7 @@ def test_get_connect_discovery_info_without_issuer_url_with_rp_logout(self):
117143 self .oauth2_settings .OIDC_RP_INITIATED_LOGOUT_ENABLED = True
118144 self .oauth2_settings .OIDC_ISS_ENDPOINT = None
119145 self .oauth2_settings .OIDC_USERINFO_ENDPOINT = None
120- self .expect_json_response_with_rp ("http://testserver/o" )
146+ self .expect_json_response_with_rp_logout ("http://testserver/o" )
121147
122148 def test_get_connect_discovery_info_without_rsa_key (self ):
123149 self .oauth2_settings .OIDC_RSA_PRIVATE_KEY = None
0 commit comments