@@ -212,12 +212,11 @@ def _validate_claims(request, claims):
212212def validate_logout_request (request , id_token_hint , client_id , post_logout_redirect_uri ):
213213 """
214214 Validate an OIDC RP-Initiated Logout Request.
215- `(prompt_logout, (post_logout_redirect_uri, application) , token_user)` is returned.
215+ `(prompt_logout, application, token_user)` is returned.
216216
217217 `prompt_logout` indicates whether the logout has to be confirmed by the user. This happens if the
218218 specifications force a confirmation, or it is enabled by `OIDC_RP_INITIATED_LOGOUT_ALWAYS_PROMPT`.
219- `post_logout_redirect_uri` is the validated URI where the User should be redirected to after the
220- logout. Can be None. None will redirect to "/" of this app. If it is set `application` will also
219+ If it is set `application` will also
221220 be set to the Application that is requesting the logout. `token_user` is the id_token user, which will
222221 used to revoke the tokens if found.
223222
@@ -274,7 +273,7 @@ def validate_logout_request(request, id_token_hint, client_id, post_logout_redir
274273 if not application .post_logout_redirect_uri_allowed (post_logout_redirect_uri ):
275274 raise InvalidOIDCRedirectURIError ("This client does not have this redirect uri registered." )
276275
277- return prompt_logout , ( post_logout_redirect_uri , application ) , token_user
276+ return prompt_logout , application , token_user
278277
279278
280279class RPInitiatedLogoutView (OIDCLogoutOnlyMixin , FormView ):
@@ -315,7 +314,7 @@ def get(self, request, *args, **kwargs):
315314 state = request .GET .get ("state" )
316315
317316 try :
318- prompt , ( redirect_uri , application ) , token_user = validate_logout_request (
317+ prompt , application , token_user = validate_logout_request (
319318 request = request ,
320319 id_token_hint = id_token_hint ,
321320 client_id = client_id ,
@@ -325,7 +324,7 @@ def get(self, request, *args, **kwargs):
325324 return self .error_response (error )
326325
327326 if not prompt :
328- return self .do_logout (application , redirect_uri , state , token_user )
327+ return self .do_logout (application , post_logout_redirect_uri , state , token_user )
329328
330329 self .oidc_data = {
331330 "id_token_hint" : id_token_hint ,
@@ -347,15 +346,15 @@ def form_valid(self, form):
347346 state = form .cleaned_data .get ("state" )
348347
349348 try :
350- prompt , ( redirect_uri , application ) , token_user = validate_logout_request (
349+ prompt , application , token_user = validate_logout_request (
351350 request = self .request ,
352351 id_token_hint = id_token_hint ,
353352 client_id = client_id ,
354353 post_logout_redirect_uri = post_logout_redirect_uri ,
355354 )
356355
357356 if not prompt or form .cleaned_data .get ("allow" ):
358- return self .do_logout (application , redirect_uri , state , token_user )
357+ return self .do_logout (application , post_logout_redirect_uri , state , token_user )
359358 else :
360359 raise LogoutDenied ()
361360
0 commit comments