Skip to content

Commit

Permalink
fix: AttributeConsumingServiceIndex proxy selection
Browse files Browse the repository at this point in the history
  • Loading branch information
damikael committed Sep 28, 2023
2 parents ce2ee9d + e9f7976 commit 150e5c0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"config": {
"version": "3.17.0",
"version": "3.17.2",
"allow-plugins": {
"simplesamlphp/composer-module-installer": true
}
Expand Down
6 changes: 3 additions & 3 deletions setup/sdk/proxy.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
const TOKEN_PUBLIC_CERT = "{{SDKHOME}}/cert/spid-sp.crt";
const DEFAULT_SPID_LEVEL = 2;
const DEFAULT_CIE_LEVEL = 3;
const DEFAULT_ATCS_INDEX = 0;
const DEFAULT_ATCS_INDEX = null; // set to null to retrieve it from metadata
const DEFAULT_EIDAS_ATCS_INDEX = 100;
const DEFAULT_SECRET = "";
const DEFAULT_TOKEN_EXPIRATION_TIME = 1200;
Expand Down Expand Up @@ -108,8 +108,8 @@
} else {
$spidcie_level = $clients[$client_id]['level'];
$atcs_index = $clients[$client_id]['atcs_index'];
if($spidcie_level==null || !in_array($spidcie_level, [1,2,3])) $spidcie_level = $isCIE? DEFAULT_CIE_LEVEL : DEFAULT_SPID_LEVEL;
if($atcs_index==null || !is_numeric($atcs_index)) $atcs_index = DEFAULT_ATCS_INDEX;
if($spidcie_level===null || !in_array($spidcie_level, [1,2,3])) $spidcie_level = $isCIE? DEFAULT_CIE_LEVEL : DEFAULT_SPID_LEVEL;
if($atcs_index===null || !is_numeric($atcs_index)) $atcs_index = DEFAULT_ATCS_INDEX;
if($idp=="EIDAS" || $idp=="EIDAS QA") $atcs_index = DEFAULT_EIDAS_ATCS_INDEX;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -718,7 +718,7 @@ private function startSSO2(Configuration $idpMetadata, array $state): void
$b->setDestination($dst['Location']);

/* SPID CUSTOM AttributeConsumingServiceIndex on Request */
if(!empty($state['saml:AttributeConsumingServiceIndex'])) {
if($state['saml:AttributeConsumingServiceIndex']!==null && $state['saml:AttributeConsumingServiceIndex']!=='') {
$ar->setAttributeConsumingServiceIndex($state['saml:AttributeConsumingServiceIndex']);
}

Expand Down

0 comments on commit 150e5c0

Please sign in to comment.