diff --git a/config-templates/authsources.php b/config-templates/authsources.php index 0d76a862d69c84337a95171b7ee237e95ca494c0..66fd41eb2b532775b44851ddf87786fd96652f35 100644 --- a/config-templates/authsources.php +++ b/config-templates/authsources.php @@ -109,6 +109,13 @@ $config = array( //'http://axschema.org/contact/country/home', //'http://axschema.org/pref/language', ), + // custom extension arguments + 'extension.args' => array( + //'http://specs.openid.net/extensions/ui/1.0' => array( + // 'mode' => 'popup', + // 'icon' => 'true', + //), + ), ), */ diff --git a/modules/openid/lib/Auth/Source/OpenIDConsumer.php b/modules/openid/lib/Auth/Source/OpenIDConsumer.php index 903f7d90aaeac9f033de70bc5fc80680ef3f1935..09b0ad914b97b6939cd58ffb6704c9e2349e2c42 100644 --- a/modules/openid/lib/Auth/Source/OpenIDConsumer.php +++ b/modules/openid/lib/Auth/Source/OpenIDConsumer.php @@ -56,6 +56,11 @@ class sspmod_openid_Auth_Source_OpenIDConsumer extends SimpleSAML_Auth_Source { */ private $validateSReg; + /** + * List of custom extension args + */ + private $extensionArgs; + /** * Constructor for this authentication source. * @@ -80,6 +85,8 @@ class sspmod_openid_Auth_Source_OpenIDConsumer extends SimpleSAML_Auth_Source { $this->requiredAXAttributes = $cfgParse->getArray('attributes.ax_required', array()); $this->validateSReg = $cfgParse->getBoolean('sreg.validate',TRUE); + + $this->extensionArgs = $cfgParse->getArray('extension.args', array()); } @@ -203,6 +210,14 @@ class sspmod_openid_Auth_Source_OpenIDConsumer extends SimpleSAML_Auth_Source { } + foreach($this->extensionArgs as $ext_ns => $ext_arg) { + if (is_array($ext_arg)) { + foreach($ext_arg as $ext_key => $ext_value) { + $auth_request->addExtensionArg($ext_ns, $ext_key, $ext_value); + } + } + } + // Redirect the user to the OpenID server for authentication. // Store the token for this authentication so we can verify the // response.