@@ -50,11 +50,37 @@ def test_get_connect_discovery_info(self):
50
50
"token_endpoint_auth_methods_supported" : ["client_secret_post" , "client_secret_basic" ],
51
51
"claims_supported" : ["sub" ],
52
52
}
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/" )
54
80
self .assertEqual (response .status_code , 200 )
55
81
assert response .json () == expected_response
56
82
57
- def expect_json_response_with_rp (self , base ):
83
+ def expect_json_response_with_rp_logout (self , base ):
58
84
expected_response = {
59
85
"issuer" : f"{ base } " ,
60
86
"authorization_endpoint" : f"{ base } /authorize/" ,
@@ -83,7 +109,7 @@ def expect_json_response_with_rp(self, base):
83
109
84
110
def test_get_connect_discovery_info_with_rp_logout (self ):
85
111
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 )
87
113
88
114
def test_get_connect_discovery_info_without_issuer_url (self ):
89
115
self .oauth2_settings .OIDC_ISS_ENDPOINT = None
@@ -117,7 +143,7 @@ def test_get_connect_discovery_info_without_issuer_url_with_rp_logout(self):
117
143
self .oauth2_settings .OIDC_RP_INITIATED_LOGOUT_ENABLED = True
118
144
self .oauth2_settings .OIDC_ISS_ENDPOINT = None
119
145
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" )
121
147
122
148
def test_get_connect_discovery_info_without_rsa_key (self ):
123
149
self .oauth2_settings .OIDC_RSA_PRIVATE_KEY = None
0 commit comments