@@ -171,7 +171,7 @@ def test_get_jwks_info_multiple_rsa_keys(self):
171171
172172@pytest .mark .django_db
173173@pytest .mark .parametrize ("ALWAYS_PROMPT" , [True , False ])
174- def test_validate_logout_request (oidc_tokens , other_application , other_user , rp_settings , ALWAYS_PROMPT ):
174+ def test_validate_logout_request (oidc_tokens , public_application , other_user , rp_settings , ALWAYS_PROMPT ):
175175 rp_settings .OIDC_RP_INITIATED_LOGOUT_ALWAYS_PROMPT = ALWAYS_PROMPT
176176 oidc_tokens = oidc_tokens
177177 application = oidc_tokens .application
@@ -211,7 +211,7 @@ def test_validate_logout_request(oidc_tokens, other_application, other_user, rp_
211211 validate_logout_request (
212212 user = oidc_tokens .user ,
213213 id_token_hint = id_token ,
214- client_id = other_application .client_id ,
214+ client_id = public_application .client_id ,
215215 post_logout_redirect_uri = "http://other.org" ,
216216 )
217217 with pytest .raises (InvalidOIDCClientError ):
@@ -304,11 +304,27 @@ def test_rp_initiated_logout_get_id_token_redirect_with_state(loggend_in_client,
304304
305305@pytest .mark .django_db
306306def test_rp_initiated_logout_get_id_token_missmatch_client_id (
307- loggend_in_client , oidc_tokens , other_application , rp_settings
307+ loggend_in_client , oidc_tokens , public_application , rp_settings
308308):
309309 rsp = loggend_in_client .get (
310310 reverse ("oauth2_provider:rp-initiated-logout" ),
311- data = {"id_token_hint" : oidc_tokens .id_token , "client_id" : other_application .client_id },
311+ data = {"id_token_hint" : oidc_tokens .id_token , "client_id" : public_application .client_id },
312+ )
313+ assert rsp .status_code == 400
314+ assert is_logged_in (loggend_in_client )
315+
316+
317+ @pytest .mark .django_db
318+ def test_rp_initiated_logout_public_client_redirect_client_id (
319+ loggend_in_client , oidc_non_confidential_tokens , public_application , rp_settings
320+ ):
321+ rsp = loggend_in_client .get (
322+ reverse ("oauth2_provider:rp-initiated-logout" ),
323+ data = {
324+ "id_token_hint" : oidc_non_confidential_tokens .id_token ,
325+ "client_id" : public_application .client_id ,
326+ "post_logout_redirect_uri" : "http://other.org" ,
327+ },
312328 )
313329 assert rsp .status_code == 400
314330 assert is_logged_in (loggend_in_client )
0 commit comments