Skip to content

Commit f0edf86

Browse files
authored
Merge pull request #140 from mraiur/master
Add option to send additional registration parameters like post_logout_redirect_uris.
2 parents bf81073 + 3837319 commit f0edf86

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

src/OpenIDConnectClient.php

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,11 @@ class OpenIDConnectClient
179179
*/
180180
private $authParams = array();
181181

182+
/**
183+
* @var array holds additional registration parameters for example post_logout_redirect_uris
184+
*/
185+
private $registrationParams = array();
186+
182187
/**
183188
* @var mixed holds well-known openid server properties
184189
*/
@@ -433,6 +438,13 @@ public function addAuthParam($param) {
433438
$this->authParams = array_merge($this->authParams, (array)$param);
434439
}
435440

441+
/**
442+
* @param $param - example: post_logout_redirect_uris=[http://example.com/successful-logout]
443+
*/
444+
public function addRegistrationParam($param) {
445+
$this->registrationParams = array_merge($this->registrationParams, (array)$param);
446+
}
447+
436448
/**
437449
* @param $jwk object - example: (object) array('kid' => ..., 'nbf' => ..., 'use' => 'sig', 'kty' => "RSA", 'e' => "", 'n' => "")
438450
*/
@@ -1222,10 +1234,10 @@ public function register() {
12221234

12231235
$registration_endpoint = $this->getProviderConfigValue('registration_endpoint');
12241236

1225-
$send_object = (object)array(
1237+
$send_object = (object ) array_merge($this->registrationParams, array(
12261238
'redirect_uris' => array($this->getRedirectURL()),
12271239
'client_name' => $this->getClientName()
1228-
);
1240+
));
12291241

12301242
$response = $this->fetchURL($registration_endpoint, json_encode($send_object));
12311243

0 commit comments

Comments
 (0)