Skip to content

Commit e97762a

Browse files
author
bmauser
committed
support optional GET parameters for end_session_endpoint
1 parent bc719cc commit e97762a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/OpenIDConnectClient.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,12 +427,13 @@ public function authenticate(): bool
427427
*
428428
* @param string $idToken ID token (obtained at login)
429429
* @param string|null $redirect URL to which the RP is requesting that the End-User's User Agent
430+
* @param array $params Optional GET parameters to end-session endpoint
430431
* be redirected after a logout has been performed. The value MUST have been previously
431432
* registered with the OP. Value can be null.
432433
*
433434
* @throws OpenIDConnectClientException
434435
*/
435-
public function signOut(string $idToken, $redirect) {
436+
public function signOut(string $idToken, $redirect, array $params = []) {
436437
$sign_out_endpoint = $this->getProviderConfigValue('end_session_endpoint');
437438

438439
if($redirect === null){
@@ -444,6 +445,9 @@ public function signOut(string $idToken, $redirect) {
444445
'post_logout_redirect_uri' => $redirect];
445446
}
446447

448+
if($params)
449+
$signout_params = array_merge($signout_params, $params);
450+
447451
$sign_out_endpoint .= (strpos($sign_out_endpoint, '?') === false ? '?' : '&') . http_build_query( $signout_params, '', '&', $this->encType);
448452
$this->redirect($sign_out_endpoint);
449453
}

0 commit comments

Comments
 (0)