Skip to content

Commit

Permalink
Fix coding style
Browse files Browse the repository at this point in the history
  • Loading branch information
tvdijen committed Sep 26, 2022
1 parent 0311b57 commit ec6661f
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/Auth/Source/Radius.php
Expand Up @@ -171,16 +171,16 @@ protected function login(string $username, string $password): array

if ($response === false) {
$errorCode = $radius->getErrorCode();
switch($errorCode) {
switch ($errorCode) {
case $radius::TYPE_ACCESS_REJECT:
throw new Error\Error('WRONGUSERPASS');
case $radius::TYPE_ACCESS_CHALLENGE:
throw new Exception('Radius authentication error: Challenge requested, but not supported.');
default:
throw new Exception(sprintf(
'Error during radius authentication; %s (%d)',
$radius->getErrorMessage(),
$errorCode
$radius->getErrorMessage(),
$errorCode
));
}
}
Expand All @@ -202,8 +202,11 @@ protected function login(string $username, string $password): array
foreach ($radius->getReceivedAttributes() as $content) {
if ($content[0] == 26) { // is a Vendor-Specific attribute
$vsa = $radius->decodeVendorSpecificContent($content[1]);
if ($vsa[0][0] === $this->vendor && $vsa[0][1] === $this->vendorType) { // matches configured Vendor and Type
$decomposed = explode("=", $vsa[0][2], 2); // SAML attributes expected in a URN=value, so split at first =

// matches configured Vendor and Type
if ($vsa[0][0] === $this->vendor && $vsa[0][1] === $this->vendorType) {
// SAML attributes expected in a URN=value, so split at first =
$decomposed = explode("=", $vsa[0][2], 2);
$attributes[$decomposed[0]][] = $decomposed[1];
}
}
Expand Down

0 comments on commit ec6661f

Please sign in to comment.