Skip to content
Snippets Groups Projects
Commit cd4cb9d4 authored by Thijs Kinkhorst's avatar Thijs Kinkhorst
Browse files

Fix changed capitalization of entityID

parent 79b09bb4
Branches
Tags
No related merge requests found
...@@ -199,10 +199,10 @@ class Federation ...@@ -199,10 +199,10 @@ class Federation
$metadataBase = Module::getModuleURL('saml/idp/metadata'); $metadataBase = Module::getModuleURL('saml/idp/metadata');
if (count($idps) > 1) { if (count($idps) > 1) {
foreach ($idps as $index => $idp) { foreach ($idps as $index => $idp) {
$idp['url'] = $metadataBase . '?idpentityid=' . urlencode($idp['entityid']); $idp['url'] = $metadataBase . '?idpentityid=' . urlencode($idp['entityID']);
$idp['metadata-set'] = 'saml20-idp-hosted'; $idp['metadata-set'] = 'saml20-idp-hosted';
$idp['metadata-index'] = $index; $idp['metadata-index'] = $index;
$idp['metadata_array'] = SAML2_IdP::getHostedMetadata($idp['entityid']); $idp['metadata_array'] = SAML2_IdP::getHostedMetadata($idp['entityID']);
$saml2entities[] = $idp; $saml2entities[] = $idp;
} }
} else { } else {
...@@ -214,14 +214,14 @@ class Federation ...@@ -214,14 +214,14 @@ class Federation
} }
foreach ($saml2entities as $index => $entity) { foreach ($saml2entities as $index => $entity) {
Assert::validURI($entity['entityid']); Assert::validURI($entity['entityID']);
Assert::maxLength( Assert::maxLength(
$entity['entityid'], $entity['entityID'],
C::SAML2INT_ENTITYID_MAX_LENGTH, C::SAML2INT_ENTITYID_MAX_LENGTH,
sprintf('The entityID cannot be longer than %d characters.', C::SAML2INT_ENTITYID_MAX_LENGTH) sprintf('The entityID cannot be longer than %d characters.', C::SAML2INT_ENTITYID_MAX_LENGTH)
); );
$builder = new SAMLBuilder($entity['entityid']); $builder = new SAMLBuilder($entity['entityID']);
$builder->addMetadataIdP20($entity['metadata_array']); $builder->addMetadataIdP20($entity['metadata_array']);
$builder->addOrganizationInfo($entity['metadata_array']); $builder->addOrganizationInfo($entity['metadata_array']);
...@@ -245,10 +245,10 @@ class Federation ...@@ -245,10 +245,10 @@ class Federation
if (count($idps) > 1) { if (count($idps) > 1) {
foreach ($idps as $index => $idp) { foreach ($idps as $index => $idp) {
$idp['url'] = Module::getModuleURL('adfs/idp/metadata/?idpentityid=' . $idp['url'] = Module::getModuleURL('adfs/idp/metadata/?idpentityid=' .
urlencode($idp['entityid'])); urlencode($idp['entityID']));
$idp['metadata-set'] = 'adfs-idp-hosted'; $idp['metadata-set'] = 'adfs-idp-hosted';
$idp['metadata-index'] = $index; $idp['metadata-index'] = $index;
$idp['metadata_array'] = ADFS_IdP::getHostedMetadata($idp['entityid']); $idp['metadata_array'] = ADFS_IdP::getHostedMetadata($idp['entityID']);
$adfsentities[] = $idp; $adfsentities[] = $idp;
} }
} else { } else {
...@@ -260,14 +260,14 @@ class Federation ...@@ -260,14 +260,14 @@ class Federation
} }
foreach ($adfsentities as $index => $entity) { foreach ($adfsentities as $index => $entity) {
Assert::validURI($entity['entityid']); Assert::validURI($entity['entityID']);
Assert::maxLength( Assert::maxLength(
$entity['entityid'], $entity['entityID'],
C::SAML2INT_ENTITYID_MAX_LENGTH, C::SAML2INT_ENTITYID_MAX_LENGTH,
sprintf('The entityID cannot be longer than %d characters.', C::SAML2INT_ENTITYID_MAX_LENGTH) sprintf('The entityID cannot be longer than %d characters.', C::SAML2INT_ENTITYID_MAX_LENGTH)
); );
$builder = new SAMLBuilder($entity['entityid']); $builder = new SAMLBuilder($entity['entityID']);
$builder->addSecurityTokenServiceType($entity['metadata_array']); $builder->addSecurityTokenServiceType($entity['metadata_array']);
$builder->addOrganizationInfo($entity['metadata_array']); $builder->addOrganizationInfo($entity['metadata_array']);
if (isset($entity['metadata_array']['contacts'])) { if (isset($entity['metadata_array']['contacts'])) {
...@@ -360,7 +360,7 @@ class Federation ...@@ -360,7 +360,7 @@ class Federation
// sanitize the resulting array // sanitize the resulting array
unset($metadata['UIInfo']); unset($metadata['UIInfo']);
unset($metadata['metadata-set']); unset($metadata['metadata-set']);
unset($metadata['entityid']); unset($metadata['entityID']);
// sanitize the attributes array to remove friendly names // sanitize the attributes array to remove friendly names
if (isset($metadata['attributes']) && is_array($metadata['attributes'])) { if (isset($metadata['attributes']) && is_array($metadata['attributes'])) {
...@@ -372,7 +372,7 @@ class Federation ...@@ -372,7 +372,7 @@ class Federation
$entities[] = [ $entities[] = [
'authid' => $source->getAuthId(), 'authid' => $source->getAuthId(),
'entityid' => $source->getEntityId(), 'entityID' => $source->getEntityId(),
'type' => 'saml20-sp-hosted', 'type' => 'saml20-sp-hosted',
'url' => $source->getMetadataURL(), 'url' => $source->getMetadataURL(),
'name' => $name, 'name' => $name,
...@@ -424,7 +424,7 @@ class Federation ...@@ -424,7 +424,7 @@ class Federation
]; ];
} }
// transpose from $entities[entityid][type] to $output[type][entityid] // transpose from $entities[entityID][type] to $output[type][entityID]
$arrayUtils = new Utils\Arrays(); $arrayUtils = new Utils\Arrays();
$output = $arrayUtils->transpose($entities); $output = $arrayUtils->transpose($entities);
...@@ -527,13 +527,13 @@ class Federation ...@@ -527,13 +527,13 @@ class Federation
{ {
$this->authUtils->requireAdmin(); $this->authUtils->requireAdmin();
$entityId = $request->query->get('entityid'); $entityId = $request->query->get('entityID');
$set = $request->query->get('set'); $set = $request->query->get('set');
$metadata = $this->mdHandler->getMetaData($entityId, $set); $metadata = $this->mdHandler->getMetaData($entityId, $set);
$t = new Template($this->config, 'admin:show_metadata.twig'); $t = new Template($this->config, 'admin:show_metadata.twig');
$t->data['entityid'] = $entityId; $t->data['entityID'] = $entityId;
$t->data['metadata'] = VarExporter::export($metadata); $t->data['metadata'] = VarExporter::export($metadata);
return $t; return $t;
} }
......
...@@ -22,13 +22,13 @@ ...@@ -22,13 +22,13 @@
<dl> <dl>
<dt>{{ set|entityDisplayName }}</dt> <dt>{{ set|entityDisplayName }}</dt>
<dd>EntityID: <code>{{ set.entityid }}</code></dd> <dd>EntityID: <code>{{ set.entityID }}</code></dd>
{%- if set.deprecated is defined and set.deprecated %} {%- if set.deprecated is defined and set.deprecated %}
<dd><span class="entity-deprecated">{{ 'Deprecated'|trans }}</span></dd> <dd><span class="entity-deprecated">{{ 'Deprecated'|trans }}</span></dd>
{%- endif %} {%- endif %}
{% set index = attribute(set, 'metadata-index')|default(false) %} {% set index = attribute(set, 'metadata-index')|default(false) %}
{%- if index and set.entityid != index %} {%- if index and set.entityID != index %}
<dd>Index: <code>{{ index }}</code></dd> <dd>Index: <code>{{ index }}</code></dd>
{%- endif %} {%- endif %}
...@@ -67,7 +67,7 @@ ...@@ -67,7 +67,7 @@
title="{% trans %}Copy to clipboard{% endtrans %}"><span class="fa fa-copy"></span></a> title="{% trans %}Copy to clipboard{% endtrans %}"><span class="fa fa-copy"></span></a>
</div> </div>
<div id="php-{{ key }}" class="code-box-content php"> <div id="php-{{ key }}" class="code-box-content php">
{#- #}$metadata['{{ set.entityid }}'] = {{ set.metadata_array }};{# -#} {#- #}$metadata['{{ set.entityID }}'] = {{ set.metadata_array }};{# -#}
</div> </div>
</dd> </dd>
{%- for cert in set.certificates %} {%- for cert in set.certificates %}
...@@ -102,9 +102,9 @@ ...@@ -102,9 +102,9 @@
<fieldset class="fancyfieldset"> <fieldset class="fancyfieldset">
<legend>{{ mdtype[key]|trans }}</legend> <legend>{{ mdtype[key]|trans }}</legend>
<ul> <ul>
{% for entityid, entity in set %} {% for entityID, entity in set %}
<li><a href="{{ moduleURL('admin/federation/show?entityid=' ~ (entity.entityid|url_encode) ~ '&set=' ~ key) }}"> <li><a href="{{ moduleURL('admin/federation/show?entityid=' ~ (entity.entityID|url_encode) ~ '&set=' ~ key) }}">
{{- entity | entityDisplayName -}} {{- entity | entityDisplayName -}}
</a> </a>
{% if entity.expire is defined %} {% if entity.expire is defined %}
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
title="{% trans %}Copy to clipboard{% endtrans %}"><span class="fa fa-copy"></span></a> title="{% trans %}Copy to clipboard{% endtrans %}"><span class="fa fa-copy"></span></a>
</div> </div>
<div id="metadata" class="code-box-content php"> <div id="metadata" class="code-box-content php">
{#- #}$metadata["{{ entityid }}"] => {{ metadata|escape }};{# -#} {#- #}$metadata["{{ entityID }}"] => {{ metadata|escape }};{# -#}
</div> </div>
</div> </div>
<div class="center"> <div class="center">
......
...@@ -111,7 +111,7 @@ class StatisticsWithAttribute extends Auth\ProcessingFilter ...@@ -111,7 +111,7 @@ class StatisticsWithAttribute extends Auth\ProcessingFilter
if (isset($state[$direction]['core:statistics-id'])) { if (isset($state[$direction]['core:statistics-id'])) {
return $state[$direction]['core:statistics-id']; return $state[$direction]['core:statistics-id'];
} else { } else {
return $state[$direction]['entityid']; return $state[$direction]['entityID'];
} }
} }
return 'NA'; return 'NA';
......
...@@ -58,7 +58,7 @@ class SAML2 ...@@ -58,7 +58,7 @@ class SAML2
Assert::notNull($state['saml:ConsumerURL']); Assert::notNull($state['saml:ConsumerURL']);
$spMetadata = $state["SPMetadata"]; $spMetadata = $state["SPMetadata"];
$spEntityId = $spMetadata['entityid']; $spEntityId = $spMetadata['entityID'];
$spMetadata = Configuration::loadFromArray( $spMetadata = Configuration::loadFromArray(
$spMetadata, $spMetadata,
'$metadata[' . var_export($spEntityId, true) . ']' '$metadata[' . var_export($spEntityId, true) . ']'
...@@ -105,7 +105,7 @@ class SAML2 ...@@ -105,7 +105,7 @@ class SAML2
$statsData = [ $statsData = [
'spEntityID' => $spEntityId, 'spEntityID' => $spEntityId,
'idpEntityID' => $idpMetadata->getString('entityid'), 'idpEntityID' => $idpMetadata->getString('entityID'),
'protocol' => 'saml2', 'protocol' => 'saml2',
]; ];
if (isset($state['saml:AuthnRequestReceivedAt'])) { if (isset($state['saml:AuthnRequestReceivedAt'])) {
...@@ -134,7 +134,7 @@ class SAML2 ...@@ -134,7 +134,7 @@ class SAML2
Assert::notNull($state['saml:ConsumerURL']); Assert::notNull($state['saml:ConsumerURL']);
$spMetadata = $state["SPMetadata"]; $spMetadata = $state["SPMetadata"];
$spEntityId = $spMetadata['entityid']; $spEntityId = $spMetadata['entityID'];
$spMetadata = Configuration::loadFromArray( $spMetadata = Configuration::loadFromArray(
$spMetadata, $spMetadata,
'$metadata[' . var_export($spEntityId, true) . ']' '$metadata[' . var_export($spEntityId, true) . ']'
...@@ -168,7 +168,7 @@ class SAML2 ...@@ -168,7 +168,7 @@ class SAML2
$statsData = [ $statsData = [
'spEntityID' => $spEntityId, 'spEntityID' => $spEntityId,
'idpEntityID' => $idpMetadata->getString('entityid'), 'idpEntityID' => $idpMetadata->getString('entityID'),
'protocol' => 'saml2', 'protocol' => 'saml2',
'error' => $status, 'error' => $status,
]; ];
...@@ -440,7 +440,7 @@ class SAML2 ...@@ -440,7 +440,7 @@ class SAML2
Stats::log('saml:idp:AuthnRequest', [ Stats::log('saml:idp:AuthnRequest', [
'spEntityID' => $spEntityId, 'spEntityID' => $spEntityId,
'idpEntityID' => $idpMetadata->getString('entityid'), 'idpEntityID' => $idpMetadata->getString('entityID'),
'forceAuthn' => $forceAuthn, 'forceAuthn' => $forceAuthn,
'isPassive' => $isPassive, 'isPassive' => $isPassive,
'protocol' => 'saml2', 'protocol' => 'saml2',
...@@ -531,7 +531,7 @@ class SAML2 ...@@ -531,7 +531,7 @@ class SAML2
Stats::log('saml:idp:LogoutRequest:sent', [ Stats::log('saml:idp:LogoutRequest:sent', [
'spEntityID' => $association['saml:entityID'], 'spEntityID' => $association['saml:entityID'],
'idpEntityID' => $idpMetadata->getString('entityid'), 'idpEntityID' => $idpMetadata->getString('entityID'),
]); ]);
/** @var array $dst */ /** @var array $dst */
...@@ -586,7 +586,7 @@ class SAML2 ...@@ -586,7 +586,7 @@ class SAML2
Stats::log('saml:idp:LogoutResponse:sent', [ Stats::log('saml:idp:LogoutResponse:sent', [
'spEntityID' => $spEntityId, 'spEntityID' => $spEntityId,
'idpEntityID' => $idpMetadata->getString('entityid'), 'idpEntityID' => $idpMetadata->getString('entityID'),
'partial' => $partial 'partial' => $partial
]); ]);
...@@ -639,7 +639,7 @@ class SAML2 ...@@ -639,7 +639,7 @@ class SAML2
Logger::info('Received SAML 2.0 LogoutResponse from: ' . var_export($spEntityId, true)); Logger::info('Received SAML 2.0 LogoutResponse from: ' . var_export($spEntityId, true));
$statsData = [ $statsData = [
'spEntityID' => $spEntityId, 'spEntityID' => $spEntityId,
'idpEntityID' => $idpMetadata->getString('entityid'), 'idpEntityID' => $idpMetadata->getString('entityID'),
]; ];
if (!$message->isSuccess()) { if (!$message->isSuccess()) {
$statsData['error'] = $message->getStatus(); $statsData['error'] = $message->getStatus();
...@@ -662,11 +662,11 @@ class SAML2 ...@@ -662,11 +662,11 @@ class SAML2
Logger::info('Received SAML 2.0 LogoutRequest from: ' . var_export($spEntityId, true)); Logger::info('Received SAML 2.0 LogoutRequest from: ' . var_export($spEntityId, true));
Stats::log('saml:idp:LogoutRequest:recv', [ Stats::log('saml:idp:LogoutRequest:recv', [
'spEntityID' => $spEntityId, 'spEntityID' => $spEntityId,
'idpEntityID' => $idpMetadata->getString('entityid'), 'idpEntityID' => $idpMetadata->getString('entityID'),
]); ]);
$spStatsId = $spMetadata->getOptionalString('core:statistics-id', $spEntityId); $spStatsId = $spMetadata->getOptionalString('core:statistics-id', $spEntityId);
Logger::stats('saml20-idp-SLO spinit ' . $spStatsId . ' ' . $idpMetadata->getString('entityid')); Logger::stats('saml20-idp-SLO spinit ' . $spStatsId . ' ' . $idpMetadata->getString('entityID'));
$state = [ $state = [
'Responder' => ['\SimpleSAML\Module\saml\IdP\SAML2', 'sendLogoutResponse'], 'Responder' => ['\SimpleSAML\Module\saml\IdP\SAML2', 'sendLogoutResponse'],
...@@ -796,7 +796,7 @@ class SAML2 ...@@ -796,7 +796,7 @@ class SAML2
$metadata = [ $metadata = [
'metadata-set' => 'saml20-idp-hosted', 'metadata-set' => 'saml20-idp-hosted',
'entityid' => $entityid, 'entityID' => $entityid,
'SingleSignOnService' => $sso, 'SingleSignOnService' => $sso,
'SingleLogoutService' => $slo, 'SingleLogoutService' => $slo,
'NameIDFormat' => $config->getOptionalArrayizeString('NameIDFormat', [Constants::NAMEID_TRANSIENT]), 'NameIDFormat' => $config->getOptionalArrayizeString('NameIDFormat', [Constants::NAMEID_TRANSIENT]),
...@@ -1111,11 +1111,11 @@ class SAML2 ...@@ -1111,11 +1111,11 @@ class SAML2
} }
$issuer = new Issuer(); $issuer = new Issuer();
$issuer->setValue($idpMetadata->getString('entityid')); $issuer->setValue($idpMetadata->getString('entityID'));
$issuer->setFormat(Constants::NAMEID_ENTITY); $issuer->setFormat(Constants::NAMEID_ENTITY);
$a->setIssuer($issuer); $a->setIssuer($issuer);
$audience = array_merge([$spMetadata->getString('entityid')], $spMetadata->getOptionalArray('audience', [])); $audience = array_merge([$spMetadata->getString('entityID')], $spMetadata->getOptionalArray('audience', []));
$a->setValidAudiences($audience); $a->setValidAudiences($audience);
$a->setNotBefore($now - 30); $a->setNotBefore($now - 30);
...@@ -1241,7 +1241,7 @@ class SAML2 ...@@ -1241,7 +1241,7 @@ class SAML2
$spNameQualifier = $spMetadata->getOptionalString('SPNameQualifier', null); $spNameQualifier = $spMetadata->getOptionalString('SPNameQualifier', null);
if ($spNameQualifier === null) { if ($spNameQualifier === null) {
$spNameQualifier = $spMetadata->getString('entityid'); $spNameQualifier = $spMetadata->getString('entityID');
} }
$nameId = new NameID(); $nameId = new NameID();
...@@ -1324,7 +1324,7 @@ class SAML2 ...@@ -1324,7 +1324,7 @@ class SAML2
$key->loadKey($pemKey); $key->loadKey($pemKey);
} else { } else {
throw new Error\ConfigurationError( throw new Error\ConfigurationError(
'Missing encryption key for entity `' . $spMetadata->getString('entityid') . '`', 'Missing encryption key for entity `' . $spMetadata->getString('entityID') . '`',
$spMetadata->getString('metadata-set') . '.php', $spMetadata->getString('metadata-set') . '.php',
null null
); );
...@@ -1397,7 +1397,7 @@ class SAML2 ...@@ -1397,7 +1397,7 @@ class SAML2
$r = new Response(); $r = new Response();
$issuer = new Issuer(); $issuer = new Issuer();
$issuer->setValue($idpMetadata->getString('entityid')); $issuer->setValue($idpMetadata->getString('entityID'));
$issuer->setFormat(Constants::NAMEID_ENTITY); $issuer->setFormat(Constants::NAMEID_ENTITY);
$r->setIssuer($issuer); $r->setIssuer($issuer);
$r->setDestination($consumerURL); $r->setDestination($consumerURL);
......
...@@ -328,7 +328,7 @@ class MetaDataStorageHandler implements ClearableState ...@@ -328,7 +328,7 @@ class MetaDataStorageHandler implements ClearableState
$metadata['metadata-index'] = $entityId; $metadata['metadata-index'] = $entityId;
$metadata['metadata-set'] = $set; $metadata['metadata-set'] = $set;
Assert::keyExists($metadata, 'entityid'); Assert::keyExists($metadata, 'entityID');
return $metadata; return $metadata;
} }
} }
...@@ -377,12 +377,12 @@ class MetaDataStorageHandler implements ClearableState ...@@ -377,12 +377,12 @@ class MetaDataStorageHandler implements ClearableState
$result = array_merge($srcList, $result); $result = array_merge($srcList, $result);
} }
foreach ($result as $remote_provider) { foreach ($result as $remote_provider) {
if (sha1($remote_provider['entityid']) == $sha1) { if (sha1($remote_provider['entityID']) == $sha1) {
$remote_provider['metadata-set'] = $set; $remote_provider['metadata-set'] = $set;
return Configuration::loadFromArray( return Configuration::loadFromArray(
$remote_provider, $remote_provider,
$set . '/' . var_export($remote_provider['entityid'], true) $set . '/' . var_export($remote_provider['entityID'], true)
); );
} }
} }
......
...@@ -159,7 +159,7 @@ abstract class MetaDataStorageSource ...@@ -159,7 +159,7 @@ abstract class MetaDataStorageSource
if ($hostPath === $entry['host']) { if ($hostPath === $entry['host']) {
if ($type === 'entityid') { if ($type === 'entityid') {
return $entry['entityid']; return $entry['entityID'];
} else { } else {
return $index; return $index;
} }
...@@ -214,7 +214,7 @@ abstract class MetaDataStorageSource ...@@ -214,7 +214,7 @@ abstract class MetaDataStorageSource
foreach ($cidrHints as $hint_entry) { foreach ($cidrHints as $hint_entry) {
if ($netUtils->ipCIDRcheck($hint_entry, $ip)) { if ($netUtils->ipCIDRcheck($hint_entry, $ip)) {
if ($type === 'entityid') { if ($type === 'entityid') {
return $entry['entityid']; return $entry['entityID'];
} else { } else {
return $index; return $index;
} }
...@@ -314,7 +314,7 @@ abstract class MetaDataStorageSource ...@@ -314,7 +314,7 @@ abstract class MetaDataStorageSource
return $index; return $index;
} }
if ($entry['entityid'] === $entityId) { if ($entry['entityID'] === $entityId) {
if ($entry['host'] === '__DEFAULT__' || $entry['host'] === $currentHost) { if ($entry['host'] === '__DEFAULT__' || $entry['host'] === $currentHost) {
return $index; return $index;
} }
......
...@@ -661,7 +661,7 @@ class Template extends Response ...@@ -661,7 +661,7 @@ class Template extends Response
return $data['OrganizationName'][$language]; return $data['OrganizationName'][$language];
} }
} }
return $data['entityid']; return $data['entityID'];
} }
/** /**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment