Skip to content

Commit da506df

Browse files
committed
tell idp not to cache BC logout response
1 parent b8c23e4 commit da506df

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

lib/Controller/LoginController.php

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -964,7 +964,12 @@ public function backChannelLogout(string $providerIdentifier, string $logout_tok
964964
$this->sessionMapper->delete($oidcSession);
965965
}
966966

967-
return new JSONResponse([], Http::STATUS_OK);
967+
// Tell the Idp not to cache the response
968+
// Per RFC : https://openid.net/specs/openid-connect-backchannel-1_0.html#BCResponse
969+
$response = new JSONResponse([], Http::STATUS_OK);
970+
$response.cacheFor(0);
971+
972+
return $response;
968973
}
969974

970975
/**
@@ -992,13 +997,17 @@ private function getBackchannelLogoutErrorResponse(
992997
'. This is likely a Nextcloud OIDC configuration issue.');
993998
}
994999

995-
return new JSONResponse(
1000+
$response = new JSONResponse(
9961001
[
9971002
'error' => $error,
9981003
'error_description' => $description,
9991004
],
10001005
Http::STATUS_BAD_REQUEST,
10011006
);
1007+
// Tell the Idp not to cache the response
1008+
// Per RFC : https://openid.net/specs/openid-connect-backchannel-1_0.html#BCResponse
1009+
$response.cacheFor(0);
1010+
return $response;
10021011
}
10031012

10041013
private function toCodeChallenge(string $data): string {

0 commit comments

Comments
 (0)