Skip to content
Snippets Groups Projects
Commit 56eb4ac8 authored by Olav Morken's avatar Olav Morken
Browse files

openid: Add support for custom extension args.

Thanks to Andjelko Horvat for providing this patch!

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@2693 44740490-163a-0410-bde0-09ae8108e29a
parent 5c7f689b
No related branches found
No related tags found
No related merge requests found
...@@ -109,6 +109,13 @@ $config = array( ...@@ -109,6 +109,13 @@ $config = array(
//'http://axschema.org/contact/country/home', //'http://axschema.org/contact/country/home',
//'http://axschema.org/pref/language', //'http://axschema.org/pref/language',
), ),
// custom extension arguments
'extension.args' => array(
//'http://specs.openid.net/extensions/ui/1.0' => array(
// 'mode' => 'popup',
// 'icon' => 'true',
//),
),
), ),
*/ */
......
...@@ -56,6 +56,11 @@ class sspmod_openid_Auth_Source_OpenIDConsumer extends SimpleSAML_Auth_Source { ...@@ -56,6 +56,11 @@ class sspmod_openid_Auth_Source_OpenIDConsumer extends SimpleSAML_Auth_Source {
*/ */
private $validateSReg; private $validateSReg;
/**
* List of custom extension args
*/
private $extensionArgs;
/** /**
* Constructor for this authentication source. * Constructor for this authentication source.
* *
...@@ -80,6 +85,8 @@ class sspmod_openid_Auth_Source_OpenIDConsumer extends SimpleSAML_Auth_Source { ...@@ -80,6 +85,8 @@ class sspmod_openid_Auth_Source_OpenIDConsumer extends SimpleSAML_Auth_Source {
$this->requiredAXAttributes = $cfgParse->getArray('attributes.ax_required', array()); $this->requiredAXAttributes = $cfgParse->getArray('attributes.ax_required', array());
$this->validateSReg = $cfgParse->getBoolean('sreg.validate',TRUE); $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 { ...@@ -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. // Redirect the user to the OpenID server for authentication.
// Store the token for this authentication so we can verify the // Store the token for this authentication so we can verify the
// response. // response.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment