Skip to content

Commit 2a62691

Browse files
committed
Remove is_federated client property
1 parent fce4118 commit 2a62691

14 files changed

Lines changed: 25 additions & 78 deletions

File tree

docker/conformance.sql

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ INSERT INTO oidc_migration_versions VALUES('20250917163000');
3030
INSERT INTO oidc_migration_versions VALUES('20251021000001');
3131
INSERT INTO oidc_migration_versions VALUES('20251021000002');
3232
INSERT INTO oidc_migration_versions VALUES('20260109000001');
33+
INSERT INTO oidc_migration_versions VALUES('20260218163000');
3334
CREATE TABLE oidc_user (
3435
id VARCHAR(191) PRIMARY KEY NOT NULL,
3536
claims TEXT,
@@ -59,17 +60,16 @@ CREATE TABLE oidc_client (
5960
updated_at TIMESTAMP NULL DEFAULT NULL,
6061
created_at TIMESTAMP NULL DEFAULT NULL,
6162
expires_at TIMESTAMP NULL DEFAULT NULL,
62-
is_federated BOOLEAN NOT NULL DEFAULT false,
6363
is_generic BOOLEAN NOT NULL DEFAULT false,
6464
extra_metadata TEXT NULL
6565
);
6666
-- Used 'httpd' host for back-channel logout url (https://httpd:8443/test/a/simplesamlphp-module-oidc/backchannel_logout)
6767
-- since this is the hostname of conformance server while running in container environment
68-
INSERT INTO oidc_client VALUES('_55a99a1d298da921cb27d700d4604352e51171ebc4','_8967dd97d07cc59db7055e84ac00e79005157c1132','Conformance Client 1',replace('Client 1 for Conformance Testing https://openid.net/certification/connect_op_testing/\n','\n',char(10)),'example-userpass','["https:\/\/localhost.emobix.co.uk:8443\/test\/a\/simplesamlphp-module-oidc\/callback","https:\/\/www.certification.openid.net\/test\/a\/simplesamlphp-module-oidc\/callback"]','["openid","profile","email","address","phone","offline_access"]',1,1,NULL,'["https:\/\/localhost.emobix.co.uk:8443\/test\/a\/simplesamlphp-module-oidc\/post_logout_redirect"]','https://httpd:8443/test/a/simplesamlphp-module-oidc/backchannel_logout',NULL,NULL, NULL, NULL, NULL, NULL, 'manual', NULL, NULL, NULL, false, false, NULL);
69-
INSERT INTO oidc_client VALUES('_34efb61060172a11d62101bc804db789f8f9100b0e','_91a4607a1c10ba801268929b961b3f6c067ff82d21','Conformance Client 2','','example-userpass','["https:\/\/localhost.emobix.co.uk:8443\/test\/a\/simplesamlphp-module-oidc\/callback","https:\/\/www.certification.openid.net\/test\/a\/simplesamlphp-module-oidc\/callback"]','["openid","profile","email","offline_access"]',1,1,NULL,NULL,NULL,NULL,NULL, NULL, NULL, NULL, NULL, 'manual', NULL, NULL, NULL, false, false, NULL);
70-
INSERT INTO oidc_client VALUES('_0afb7d18e54b2de8205a93e38ca119e62ee321d031','_944e73bbeec7850d32b68f1b5c780562c955967e4e','Conformance Client 3','Client for client_secret_post','example-userpass','["https:\/\/localhost.emobix.co.uk:8443\/test\/a\/simplesamlphp-module-oidc\/callback","https:\/\/www.certification.openid.net\/test\/a\/simplesamlphp-module-oidc\/callback"]','["openid","profile","email"]',1,1,NULL,NULL,NULL,NULL,NULL, NULL, NULL, NULL, NULL, 'manual', NULL, NULL, NULL, false, false, NULL);
71-
INSERT INTO oidc_client VALUES('_8957eda35234902ba8343c0cdacac040310f17dfca','_322d16999f9da8b5abc9e9c0c08e853f60f4dc4804','RP-Initiated Logout Client','Client for testing RP-Initiated Logout','example-userpass','["https:\/\/localhost.emobix.co.uk:8443\/test\/a\/simplesamlphp-module-oidc\/callback","https:\/\/www.certification.openid.net\/test\/a\/simplesamlphp-module-oidc\/callback"]','["openid","profile","email","address","phone"]',1,1,NULL,'["https:\/\/localhost.emobix.co.uk:8443\/test\/a\/simplesamlphp-module-oidc\/post_logout_redirect"]',NULL,NULL,NULL, NULL, NULL, NULL, NULL, 'manual', NULL, NULL, NULL, false, false, NULL);
72-
INSERT INTO oidc_client VALUES('_9fe2f7589ece1b71f5ef75a91847d71bc5125ec2a6','_3c0beb20194179c01d7796c6836f62801e9ed4b368','Back-Channel Logout Client','Client for testing Back-Channel Logout','example-userpass','["https:\/\/localhost.emobix.co.uk:8443\/test\/a\/simplesamlphp-module-oidc\/callback","https:\/\/www.certification.openid.net\/test\/a\/simplesamlphp-module-oidc\/callback"]','["openid","profile","email","address","phone"]',1,1,NULL,'["https:\/\/localhost.emobix.co.uk:8443\/test\/a\/simplesamlphp-module-oidc\/post_logout_redirect"]','https://httpd:8443/test/a/simplesamlphp-module-oidc/backchannel_logout',NULL,NULL, NULL, NULL, NULL, NULL, 'manual', NULL, NULL, NULL, false, false, NULL);
68+
INSERT INTO oidc_client VALUES('_55a99a1d298da921cb27d700d4604352e51171ebc4','_8967dd97d07cc59db7055e84ac00e79005157c1132','Conformance Client 1',replace('Client 1 for Conformance Testing https://openid.net/certification/connect_op_testing/\n','\n',char(10)),'example-userpass','["https:\/\/localhost.emobix.co.uk:8443\/test\/a\/simplesamlphp-module-oidc\/callback","https:\/\/www.certification.openid.net\/test\/a\/simplesamlphp-module-oidc\/callback"]','["openid","profile","email","address","phone","offline_access"]',1,1,NULL,'["https:\/\/localhost.emobix.co.uk:8443\/test\/a\/simplesamlphp-module-oidc\/post_logout_redirect"]','https://httpd:8443/test/a/simplesamlphp-module-oidc/backchannel_logout',NULL,NULL, NULL, NULL, NULL, NULL, 'manual', NULL, NULL, NULL, false, NULL);
69+
INSERT INTO oidc_client VALUES('_34efb61060172a11d62101bc804db789f8f9100b0e','_91a4607a1c10ba801268929b961b3f6c067ff82d21','Conformance Client 2','','example-userpass','["https:\/\/localhost.emobix.co.uk:8443\/test\/a\/simplesamlphp-module-oidc\/callback","https:\/\/www.certification.openid.net\/test\/a\/simplesamlphp-module-oidc\/callback"]','["openid","profile","email","offline_access"]',1,1,NULL,NULL,NULL,NULL,NULL, NULL, NULL, NULL, NULL, 'manual', NULL, NULL, NULL, false, NULL);
70+
INSERT INTO oidc_client VALUES('_0afb7d18e54b2de8205a93e38ca119e62ee321d031','_944e73bbeec7850d32b68f1b5c780562c955967e4e','Conformance Client 3','Client for client_secret_post','example-userpass','["https:\/\/localhost.emobix.co.uk:8443\/test\/a\/simplesamlphp-module-oidc\/callback","https:\/\/www.certification.openid.net\/test\/a\/simplesamlphp-module-oidc\/callback"]','["openid","profile","email"]',1,1,NULL,NULL,NULL,NULL,NULL, NULL, NULL, NULL, NULL, 'manual', NULL, NULL, NULL, false, NULL);
71+
INSERT INTO oidc_client VALUES('_8957eda35234902ba8343c0cdacac040310f17dfca','_322d16999f9da8b5abc9e9c0c08e853f60f4dc4804','RP-Initiated Logout Client','Client for testing RP-Initiated Logout','example-userpass','["https:\/\/localhost.emobix.co.uk:8443\/test\/a\/simplesamlphp-module-oidc\/callback","https:\/\/www.certification.openid.net\/test\/a\/simplesamlphp-module-oidc\/callback"]','["openid","profile","email","address","phone"]',1,1,NULL,'["https:\/\/localhost.emobix.co.uk:8443\/test\/a\/simplesamlphp-module-oidc\/post_logout_redirect"]',NULL,NULL,NULL, NULL, NULL, NULL, NULL, 'manual', NULL, NULL, NULL, false, NULL);
72+
INSERT INTO oidc_client VALUES('_9fe2f7589ece1b71f5ef75a91847d71bc5125ec2a6','_3c0beb20194179c01d7796c6836f62801e9ed4b368','Back-Channel Logout Client','Client for testing Back-Channel Logout','example-userpass','["https:\/\/localhost.emobix.co.uk:8443\/test\/a\/simplesamlphp-module-oidc\/callback","https:\/\/www.certification.openid.net\/test\/a\/simplesamlphp-module-oidc\/callback"]','["openid","profile","email","address","phone"]',1,1,NULL,'["https:\/\/localhost.emobix.co.uk:8443\/test\/a\/simplesamlphp-module-oidc\/post_logout_redirect"]','https://httpd:8443/test/a/simplesamlphp-module-oidc/backchannel_logout',NULL,NULL, NULL, NULL, NULL, NULL, 'manual', NULL, NULL, NULL, false, NULL);
7373
CREATE TABLE oidc_access_token (
7474
id VARCHAR(191) PRIMARY KEY NOT NULL,
7575
scopes TEXT,

src/Controllers/Admin/ClientController.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,6 @@ protected function buildClientEntityFromFormData(
348348
$jwksUri = empty($data[ClientEntity::KEY_JWKS_URI]) ? null : (string)$data[ClientEntity::KEY_JWKS_URI];
349349
$signedJwksUri = empty($data[ClientEntity::KEY_SIGNED_JWKS_URI]) ?
350350
null : (string)$data[ClientEntity::KEY_SIGNED_JWKS_URI];
351-
$isFederated = (bool)$data[ClientEntity::KEY_IS_FEDERATED];
352351

353352
$idTokenSignedResponseAlg = isset($data[ClaimsEnum::IdTokenSignedResponseAlg->value]) &&
354353
is_string($data[ClaimsEnum::IdTokenSignedResponseAlg->value]) ?
@@ -382,7 +381,6 @@ protected function buildClientEntityFromFormData(
382381
$updatedAt,
383382
$createdAt,
384383
$expiresAt,
385-
$isFederated,
386384
$isGeneric,
387385
$extraMetadata,
388386
);

src/Entities/ClientEntity.php

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ class ClientEntity implements ClientEntityInterface
5151
public const KEY_UPDATED_AT = 'updated_at';
5252
public const KEY_CREATED_AT = 'created_at';
5353
public const KEY_EXPIRES_AT = 'expires_at';
54-
public const KEY_IS_FEDERATED = 'is_federated';
5554
public const KEY_IS_GENERIC = 'is_generic';
5655
public const KEY_EXTRA_METADATA = 'extra_metadata';
5756

@@ -95,7 +94,6 @@ class ClientEntity implements ClientEntityInterface
9594
private ?DateTimeImmutable $updatedAt;
9695
private ?DateTimeImmutable $createdAt;
9796
private ?DateTimeImmutable $expiresAt;
98-
private bool $isFederated;
9997
private bool $isGeneric;
10098
private ?array $extraMetadata;
10199

@@ -130,7 +128,6 @@ public function __construct(
130128
?DateTimeImmutable $updatedAt = null,
131129
?DateTimeImmutable $createdAt = null,
132130
?DateTimeImmutable $expiresAt = null,
133-
bool $isFederated = false,
134131
bool $isGeneric = false,
135132
?array $extraMetadata = null,
136133
) {
@@ -156,7 +153,6 @@ public function __construct(
156153
$this->updatedAt = $updatedAt;
157154
$this->createdAt = $createdAt;
158155
$this->expiresAt = $expiresAt;
159-
$this->isFederated = $isFederated;
160156
$this->isGeneric = $isGeneric;
161157
$this->extraMetadata = $extraMetadata;
162158
}
@@ -196,7 +192,6 @@ public function getState(): array
196192
self::KEY_UPDATED_AT => $this->getUpdatedAt()?->format('Y-m-d H:i:s'),
197193
self::KEY_CREATED_AT => $this->getCreatedAt()?->format('Y-m-d H:i:s'),
198194
self::KEY_EXPIRES_AT => $this->getExpiresAt()?->format('Y-m-d H:i:s'),
199-
self::KEY_IS_FEDERATED => $this->isFederated(),
200195
self::KEY_IS_GENERIC => $this->isGeneric(),
201196
self::KEY_EXTRA_METADATA => is_null($this->extraMetadata) ?
202197
null :
@@ -229,7 +224,6 @@ public function toArray(): array
229224
self::KEY_UPDATED_AT => $this->updatedAt,
230225
self::KEY_CREATED_AT => $this->createdAt,
231226
self::KEY_EXPIRES_AT => $this->expiresAt,
232-
self::KEY_IS_FEDERATED => $this->isFederated,
233227
self::KEY_IS_GENERIC => $this->isGeneric,
234228

235229
// Extra metadata
@@ -368,11 +362,6 @@ public function isExpired(): bool
368362
return $this->expiresAt !== null && $this->expiresAt < new DateTimeImmutable();
369363
}
370364

371-
public function isFederated(): bool
372-
{
373-
return $this->isFederated;
374-
}
375-
376365
public function isGeneric(): bool
377366
{
378367
return $this->isGeneric;

src/Entities/Interfaces/ClientEntityInterface.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ public function getUpdatedAt(): ?DateTimeImmutable;
7878
public function getCreatedAt(): ?DateTimeImmutable;
7979
public function getExpiresAt(): ?DateTimeImmutable;
8080
public function isExpired(): bool;
81-
public function isFederated(): bool;
8281
public function isGeneric(): bool;
8382

8483
public function getExtraMetadata(): array;

src/Factories/Entities/ClientEntityFactory.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ public function fromData(
6161
?DateTimeImmutable $updatedAt = null,
6262
?DateTimeImmutable $createdAt = null,
6363
?DateTimeImmutable $expiresAt = null,
64-
bool $isFederated = false,
6564
bool $isGeneric = false,
6665
?array $extraMetadata = null,
6766
): ClientEntityInterface {
@@ -88,7 +87,6 @@ public function fromData(
8887
$updatedAt,
8988
$createdAt,
9089
$expiresAt,
91-
$isFederated,
9290
$isGeneric,
9391
$extraMetadata,
9492
);
@@ -189,7 +187,6 @@ public function fromRegistrationData(
189187

190188
// $expiresAt = $expiresAt;
191189

192-
$isFederated = $existingClient?->isFederated() ?? false;
193190
$isGeneric = $existingClient?->isGeneric() ?? false;
194191

195192
$extraMetadata = $existingClient?->getExtraMetadata() ?? [];
@@ -229,7 +226,6 @@ public function fromRegistrationData(
229226
$updatedAt,
230227
$createdAt,
231228
$expiresAt,
232-
$isFederated,
233229
$isGeneric,
234230
$extraMetadata,
235231
);
@@ -360,7 +356,6 @@ public function fromState(array $state): ClientEntityInterface
360356
$expiresAt = empty($state[ClientEntity::KEY_EXPIRES_AT]) ? null :
361357
$this->helpers->dateTime()->getUtc((string)$state[ClientEntity::KEY_EXPIRES_AT]);
362358

363-
$isFederated = (bool)$state[ClientEntity::KEY_IS_FEDERATED];
364359
$isGeneric = (bool)$state[ClientEntity::KEY_IS_GENERIC];
365360

366361
/** @var ?mixed[] $extraMetadata */
@@ -391,7 +386,6 @@ public function fromState(array $state): ClientEntityInterface
391386
$updatedAt,
392387
$createdAt,
393388
$expiresAt,
394-
$isFederated,
395389
$isGeneric,
396390
$extraMetadata,
397391
);

src/Forms/ClientForm.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -417,9 +417,6 @@ protected function buildForm(): void
417417
$this->addText('signed_jwks_uri', 'Signed JWKS URI')
418418
->setHtmlAttribute('class', 'full-width');
419419

420-
$this->addCheckbox('is_federated', '{oidc:client:is_federated}')
421-
->setHtmlAttribute('class', 'full-width');
422-
423420
// TODO mivanci Properly fetch the list of supported algos
424421
$this->addSelect('id_token_signed_response_alg', Translate::noop('ID Token Signing Algorithm'))
425422
->setHtmlAttribute('class', 'full-width')

src/Repositories/ClientRepository.php

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,6 @@ public function findFederatedByEntityIdentifier(
199199
if (
200200
is_null($clientEntity->getEntityIdentifier()) ||
201201
(! $clientEntity->isEnabled()) ||
202-
(! $clientEntity->isFederated()) ||
203202
(!is_array($clientEntity->getFederationJwks())) ||
204203
$clientEntity->isExpired()
205204
) {
@@ -270,12 +269,10 @@ public function findAllFederated(?string $owner = null): array
270269
WHERE
271270
entity_identifier IS NOT NULL AND
272271
federation_jwks IS NOT NULL AND
273-
is_enabled = :is_enabled AND
274-
is_federated = :is_federated
272+
is_enabled = :is_enabled
275273
EOS,
276274
[
277275
'is_enabled' => [true, PDO::PARAM_BOOL],
278-
'is_federated' => [true, PDO::PARAM_BOOL],
279276
],
280277
$owner,
281278
);
@@ -361,7 +358,6 @@ public function add(ClientEntityInterface $client): void
361358
updated_at,
362359
created_at,
363360
expires_at,
364-
is_federated,
365361
is_generic,
366362
extra_metadata
367363
)
@@ -388,7 +384,6 @@ public function add(ClientEntityInterface $client): void
388384
:updated_at,
389385
:created_at,
390386
:expires_at,
391-
:is_federated,
392387
:is_generic,
393388
:extra_metadata
394389
)
@@ -462,7 +457,6 @@ public function update(ClientEntityInterface $client, ?string $owner = null): vo
462457
updated_at = :updated_at,
463458
created_at = :created_at,
464459
expires_at = :expires_at,
465-
is_federated = :is_federated,
466460
is_generic = :is_generic,
467461
extra_metadata = :extra_metadata
468462
WHERE id = :id
@@ -557,12 +551,10 @@ protected function preparePdoState(array $state): array
557551
{
558552
$isEnabled = (bool)($state[ClientEntity::KEY_IS_ENABLED] ?? false);
559553
$isConfidential = (bool)($state[ClientEntity::KEY_IS_CONFIDENTIAL] ?? false);
560-
$isFederated = (bool)($state[ClientEntity::KEY_IS_FEDERATED] ?? false);
561554
$isGeneric = (bool)($state[ClientEntity::KEY_IS_GENERIC] ?? false);
562555

563556
$state[ClientEntity::KEY_IS_ENABLED] = [$isEnabled, PDO::PARAM_BOOL];
564557
$state[ClientEntity::KEY_IS_CONFIDENTIAL] = [$isConfidential, PDO::PARAM_BOOL];
565-
$state[ClientEntity::KEY_IS_FEDERATED] = [$isFederated, PDO::PARAM_BOOL];
566558
$state[ClientEntity::KEY_IS_GENERIC] = [$isGeneric, PDO::PARAM_BOOL];
567559

568560
return $state;

src/Services/DatabaseMigration.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,11 @@ public function migrate(): void
214214
$this->version20260109000001();
215215
$this->database->write("INSERT INTO $versionsTablename (version) VALUES ('20260109000001')");
216216
}
217+
218+
if (!in_array('20260218163000', $versions, true)) {
219+
$this->version20260218163000();
220+
$this->database->write("INSERT INTO $versionsTablename (version) VALUES ('20260218163000')");
221+
}
217222
}
218223

219224
private function versionsTableName(): string
@@ -723,6 +728,17 @@ private function version20260109000001(): void
723728
,);
724729
}
725730

731+
732+
private function version20260218163000(): void
733+
{
734+
$clientTableName = $this->database->applyPrefix(ClientRepository::TABLE_NAME);
735+
$this->database->write(<<< EOT
736+
ALTER TABLE {$clientTableName}
737+
DROP COLUMN is_federated;
738+
EOT
739+
,);
740+
}
741+
726742
/**
727743
* @param string[] $columnNames
728744
*/

templates/clients/includes/form.twig

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -152,27 +152,6 @@
152152

153153
<br>
154154
<h4>{{ 'OpenID Federation Related Properties'|trans }}</h4>
155-
<span class="pure-form-message">
156-
{% trans %}In order for an entity to participate in federation contexts (for example, to be listed as subordinate to this OP), it must have an Entity Identifier and Federation JWKS set. {% endtrans %}
157-
</span>
158-
<label for="">{{ 'Is Federated'|trans }}</label>
159-
<label for="radio-option-federated-yes" class="pure-radio">
160-
<input type="radio"
161-
name="is_federated"
162-
id="radio-option-federated-yes"
163-
{% if form.is_federated.value %}checked=""{% endif %}
164-
value="1" /> {{ 'Yes'|trans }}
165-
</label>
166-
<label for="radio-option-federated-no" class="pure-radio">
167-
<input type="radio"
168-
name="is_federated"
169-
id="radio-option-federated-no"
170-
{% if not form.is_federated.value %}checked=""{% endif %}
171-
value="0" /> {{ 'No'|trans }}
172-
</label>
173-
<span class="pure-form-message">
174-
{% trans %}Choose if the client is allowed to participate in federation context or not.{% endtrans %}
175-
</span>
176155

177156
<label for="frm-entity_identifier">{{ 'Entity Identifier'|trans }}</label>
178157
{{ form.entity_identifier.control | raw }}

templates/clients/show.twig

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -234,14 +234,6 @@
234234
<col class="">
235235
</colgroup>
236236
<tbody>
237-
<tr>
238-
<td class="client-col col-property">
239-
{{ 'Is Federated'|trans }}
240-
</td>
241-
<td>
242-
{{ (client.isFederated ? 'Yes' : 'No')|trans }}
243-
</td>
244-
</tr>
245237
<tr>
246238
<td class="client-col col-property">
247239
{{ 'Entity Identifier'|trans }}

0 commit comments

Comments
 (0)