diff --git a/modules/exampleattributeserver/www/attributeserver.php b/modules/exampleattributeserver/www/attributeserver.php index 9bdbe415a1ff0a52d2c7fe64701b1bc08550da5b..84aad77dd1204475d4a9d1b908e7c9c32904bb01 100644 --- a/modules/exampleattributeserver/www/attributeserver.php +++ b/modules/exampleattributeserver/www/attributeserver.php @@ -10,10 +10,13 @@ if (!($query instanceof \SAML2\AttributeQuery)) { $idpEntityId = $metadata->getMetaDataCurrentEntityID('saml20-idp-hosted'); - -$spEntityId = $query->getIssuer(); -if ($spEntityId === null) { +$issuer = $query->getIssuer(); +if ($issuer === null) { throw new \SimpleSAML\Error\BadRequest('Missing <saml:Issuer> in <samlp:AttributeQuery>.'); +} elseif (is_string($issuer)) { + $spEntityId = $issuer; +} else { + $spEntityId = $issuer->getValue(); } $idpMetadata = $metadata->getMetaDataConfig($idpEntityId, 'saml20-idp-hosted'); @@ -41,6 +44,7 @@ if (count($returnAttributes) === 0) { $returnAttributes = []; } else { foreach ($returnAttributes as $name => $values) { + /** @var array $values */ if (!array_key_exists($name, $attributes)) { // We don't have this attribute unset($returnAttributes[$name]); diff --git a/modules/exampleauth/lib/Auth/Process/RedirectTest.php b/modules/exampleauth/lib/Auth/Process/RedirectTest.php index 13ff82dbd2e92a09d64943c2b2d938a09f7f3537..e72c5459e197b7c03e3ec547206f4d5a224461e8 100644 --- a/modules/exampleauth/lib/Auth/Process/RedirectTest.php +++ b/modules/exampleauth/lib/Auth/Process/RedirectTest.php @@ -6,13 +6,13 @@ namespace SimpleSAML\Module\exampleautth\Auth\Process; * A simple processing filter for testing that redirection works as it should. * */ - class RedirectTest extends \SimpleSAML\Auth\ProcessingFilter { /** * Initialize processing of the redirect test. * * @param array &$state The state we should update. + * @return void */ public function process(&$state) { diff --git a/modules/exampleauth/lib/Auth/Source/External.php b/modules/exampleauth/lib/Auth/Source/External.php index fef113edb9ed6a4fe6375a8baf614ea072bb1162..409b4ea42b8f87ff02fd3023925844ef6f328249 100644 --- a/modules/exampleauth/lib/Auth/Source/External.php +++ b/modules/exampleauth/lib/Auth/Source/External.php @@ -22,7 +22,6 @@ namespace SimpleSAML\Module\exampleauth\Auth\Source; * * @package SimpleSAMLphp */ - class External extends \SimpleSAML\Auth\Source { /** @@ -47,10 +46,11 @@ class External extends \SimpleSAML\Auth\Source // Do any other configuration we need here } + /** * Retrieve attributes for the user. * - * @return array|NULL The user's attributes, or NULL if the user isn't authenticated. + * @return array|null The user's attributes, or NULL if the user isn't authenticated. */ private function getUser() { @@ -91,10 +91,12 @@ class External extends \SimpleSAML\Auth\Source return $attributes; } + /** * Log in using an external authentication helper. * * @param array &$state Information about the current authentication. + * @return void */ public function authenticate(&$state) { @@ -172,6 +174,7 @@ class External extends \SimpleSAML\Auth\Source assert(false); } + /** * Resume authentication process. * @@ -179,6 +182,9 @@ class External extends \SimpleSAML\Auth\Source * entered his or her credentials. * * @param array &$state The authentication state. + * @return void + * @throws \SimpleSAML\Error\BadRequest + * @throws \SimpleSAML\Error\Exception */ public static function resume() { @@ -248,11 +254,13 @@ class External extends \SimpleSAML\Auth\Source assert(false); } + /** * This function is called when the user start a logout operation, for example * by logging out of a SP that supports single logout. * * @param array &$state The logout state array. + * @return void */ public function logout(&$state) { diff --git a/modules/exampleauth/lib/Auth/Source/StaticSource.php b/modules/exampleauth/lib/Auth/Source/StaticSource.php index d81dd325638fe2c2e1f3e64d45ca329310115c54..607a2e4962c94518253d0df461372177e3d33149 100644 --- a/modules/exampleauth/lib/Auth/Source/StaticSource.php +++ b/modules/exampleauth/lib/Auth/Source/StaticSource.php @@ -11,7 +11,6 @@ namespace SimpleSAML\Module\exampleauth\Auth\Source; * @author Olav Morken, UNINETT AS. * @package SimpleSAMLphp */ - class StaticSource extends \SimpleSAML\Auth\Source { /** @@ -42,10 +41,12 @@ class StaticSource extends \SimpleSAML\Auth\Source } } + /** * Log in using static attributes. * * @param array &$state Information about the current authentication. + * @return void */ public function authenticate(&$state) {