Skip to content

Commit 9a4e9e3

Browse files
committed
WIP
1 parent 27cab9b commit 9a4e9e3

27 files changed

Lines changed: 318 additions & 204 deletions

config/module_oidc.php.dist

Lines changed: 92 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,8 @@ $config = [
3737
*/
3838
// ModuleConfig::OPTION_ISSUER => 'https://op.example.org',
3939

40-
4140
/**
42-
* Protocol (Connect) signature algorithm and key-pair definitions,
41+
* Connect protocol signature algorithm and key-pair definitions,
4342
* representing supported algorithms for signing, for example, ID Token JWS.
4443
* The order in which the entries are set is important. The entry set
4544
* first will have higher priority during signing algorithm negotiation
@@ -74,22 +73,24 @@ $config = [
7473
* Note: in v7 of the module, a new way of automatic key ID generation is
7574
* used. In previous versions, a hash of a public key file was used as a
7675
* key ID. In v7, a public key thumbprint is used. If you are migrating from
77-
* previous version of the module, and you want to keep the old signing key,
78-
* you should manually set the key ID to the previous value, so that clients
79-
* know that the key did not change.
76+
* a previous version of the module, and you want to keep the old signing
77+
* key, you should manually set the key ID to the previous value
78+
* so that clients know that the key did not change.
8079
*/
81-
ModuleConfig::OPTION_PROTOCOL_SIGNATURE_KEY_PAIRS => [
80+
ModuleConfig::OPTION_CONNECT_SIGNATURE_KEY_PAIRS => [
8281
[
8382
ModuleConfig::KEY_ALGORITHM => \SimpleSAML\OpenID\Algorithms\SignatureAlgorithmEnum::RS256,
84-
ModuleConfig::KEY_PRIVATE_KEY_FILENAME => ModuleConfig::DEFAULT_PKI_PRIVATE_KEY_FILENAME,
85-
ModuleConfig::KEY_PUBLIC_KEY_FILENAME => ModuleConfig::DEFAULT_PKI_CERTIFICATE_FILENAME,
83+
ModuleConfig::KEY_PRIVATE_KEY_FILENAME => 'oidc_module_connect_rsa_01.key',
84+
ModuleConfig::KEY_PUBLIC_KEY_FILENAME => 'oidc_module_connect_rsa_01.pub',
8685
// ModuleConfig::KEY_PRIVATE_KEY_PASSWORD => 'private-key-password', // Optional
8786
// ModuleConfig::KEY_KEY_ID => 'rsa-connect-signing-key-2026', // Optional
8887
],
88+
// Example for additionally supported ES256 algorithm with EC keys.
89+
// Delete it if not needed:
8990
[
9091
ModuleConfig::KEY_ALGORITHM => \SimpleSAML\OpenID\Algorithms\SignatureAlgorithmEnum::ES256,
91-
ModuleConfig::KEY_PRIVATE_KEY_FILENAME => 'oidc_module_ec256.key',
92-
ModuleConfig::KEY_PUBLIC_KEY_FILENAME => 'oidc_module_ec256.pub',
92+
ModuleConfig::KEY_PRIVATE_KEY_FILENAME => 'oidc_module_connect_ec_p256_01.key',
93+
ModuleConfig::KEY_PUBLIC_KEY_FILENAME => 'oidc_module_connect_ec_p256_01.pub',
9394
// ModuleConfig::KEY_PRIVATE_KEY_PASSWORD => 'private-key-password', // Optional
9495
// ModuleConfig::KEY_KEY_ID => 'ec-connect-signing-key-01', // Optional
9596
],
@@ -439,12 +440,12 @@ $config = [
439440
],
440441

441442
/**
442-
* Pagination options, for example, on client listing page.
443+
* Pagination options, for example, on the client listing page.
443444
*/
444445
ModuleConfig::OPTION_ADMIN_UI_PAGINATION_ITEMS_PER_PAGE => 20,
445446

446447
/***************************************************************************
447-
* (optional) OpenID Federation related options. If these are not set,
448+
* (optional) OpenID Federation-related options. If these are not set,
448449
* OpenID Federation capabilities will be disabled.
449450
**************************************************************************/
450451

@@ -453,6 +454,31 @@ $config = [
453454
*/
454455
ModuleConfig::OPTION_FEDERATION_ENABLED => false,
455456

457+
/**
458+
* Federation signature algorithm and key-pair definitions, representing
459+
* supported algorithms for signing, for example, Entity Statements.
460+
* The first algorithm in the list will be used for signing (the
461+
* first entry represents the default algorithm and signing key).
462+
* You can also use this config option to advertise any (new) keys, for
463+
* example, for key-rollover scenarios. Add those entries later in
464+
* the list, so they can be published in Federation JWKS.
465+
*
466+
* Note that these keys SHOULD NOT be the same as the ones used in the
467+
* protocol (Connect) itself.
468+
*
469+
* The format is the same as for the protocol (Connect) signature key pairs
470+
* (option ModuleConfig::OPTION_PROTOCOL_SIGNATURE_KEY_PAIRS)
471+
*/
472+
ModuleConfig::OPTION_FEDERATION_SIGNATURE_KEY_PAIRS => [
473+
[
474+
ModuleConfig::KEY_ALGORITHM => \SimpleSAML\OpenID\Algorithms\SignatureAlgorithmEnum::RS256,
475+
ModuleConfig::KEY_PRIVATE_KEY_FILENAME => 'oidc_module_federation_rsa_01.key',
476+
ModuleConfig::KEY_PUBLIC_KEY_FILENAME => 'oidc_module_federation_rsa_01.pub',
477+
// ModuleConfig::KEY_PRIVATE_KEY_PASSWORD => 'private-key-password', // Optional
478+
// ModuleConfig::KEY_KEY_ID => 'rsa-federation-signing-key-01', // Optional
479+
],
480+
],
481+
456482
/**
457483
* Trust Anchors which are valid for this entity. The key represents the
458484
* Trust Anchor Entity ID, while the value can be the Trust Anchor's JWKS
@@ -502,19 +528,22 @@ $config = [
502528
// 'trust-mark-type' => 'trust-mark-issuer-id',
503529
],
504530

505-
// (optional) Federation participation limit by Trust Marks. This is an
506-
// array with the following format:
507-
// [
508-
// 'trust-anchor-id' => [
509-
// 'limit-id' => [
510-
// 'trust-mark-type',
511-
// 'trust-mark-type-2',
512-
// ],
513-
// ],
514-
// ],
515-
// Check example below on how this can be used. If federation participation
516-
// limit is configured for particular Trust Anchor ID, at least one
517-
// combination of "limit ID" => "trust mark list" should be defined.
531+
/**
532+
* (optional) Federation participation limit by Trust Marks. This is an
533+
* array with the following format:
534+
* [
535+
* 'trust-anchor-id' => [
536+
* 'limit-id' => [
537+
* 'trust-mark-type',
538+
* 'trust-mark-type-2',
539+
* ],
540+
* ],
541+
* ],
542+
* Check the example below on how this can be used. If a federation
543+
* participation limit is configured for a particular Trust Anchor ID, at
544+
* least one combination of "limit ID" => "trust mark list" should be
545+
* defined.
546+
*/
518547
ModuleConfig::OPTION_FEDERATION_PARTICIPATION_LIMIT_BY_TRUST_MARKS => [
519548
// We are limiting federation participation using Trust Marks for
520549
// 'https://ta.example.org/'.
@@ -578,32 +607,6 @@ $config = [
578607
*/
579608
ModuleConfig::OPTION_FEDERATION_CACHE_MAX_DURATION_FOR_FETCHED => 'PT6H', // 6 hours
580609

581-
582-
/**
583-
* Federation signature algorithm and key-pair definitions, representing
584-
* supported algorithms for signing, for example, Entity Statements.
585-
* The first algorithm in the list will be used for signing (the
586-
* first entry represents default algorithm and signing key).
587-
* You can also use this config option to advertise any (new) keys, for
588-
* example, for key-rollover scenarios. Just add those entries later in
589-
* the list, so they can be published in Federation JWKS.
590-
*
591-
* Note that these keys SHOULD NOT be the same as the ones used in the
592-
* protocol (Connect) itself.
593-
*
594-
* The format is the same as for the protocol (Connect) signature key pairs
595-
* (option ModuleConfig::OPTION_PROTOCOL_SIGNATURE_KEY_PAIRS)
596-
*/
597-
ModuleConfig::OPTION_FEDERATION_SIGNATURE_KEY_PAIRS => [
598-
[
599-
ModuleConfig::KEY_ALGORITHM => \SimpleSAML\OpenID\Algorithms\SignatureAlgorithmEnum::ES256,
600-
ModuleConfig::KEY_PRIVATE_KEY_FILENAME => ModuleConfig::DEFAULT_PKI_FEDERATION_PRIVATE_KEY_FILENAME,
601-
ModuleConfig::KEY_PUBLIC_KEY_FILENAME => ModuleConfig::DEFAULT_PKI_FEDERATION_CERTIFICATE_FILENAME,
602-
// ModuleConfig::KEY_PRIVATE_KEY_PASSWORD => 'private-key-password', // Optional
603-
// ModuleConfig::KEY_KEY_ID => 'ec-connect-signing-key-01', // Optional
604-
],
605-
],
606-
607610
/**
608611
* Federation entity statement duration which determines the Expiration Time
609612
* (exp) claim set in entity statement JWSs published by this OP. If not
@@ -649,13 +652,38 @@ $config = [
649652
* Enable or disable verifiable credentials capabilities. Default is
650653
* disabled (false).
651654
*/
652-
ModuleConfig::OPTION_VERIFIABLE_CREDENTIAL_ENABLED => false,
655+
ModuleConfig::OPTION_VCI_ENABLED => false,
656+
657+
/**
658+
* Verifiable Credential signature algorithm and key-pair definitions,
659+
* representing supported algorithms for signing verifiable credentials.
660+
* The first algorithm in the list will be used for signing (the
661+
* first entry represents the default algorithm and signing key).
662+
* You can also use this config option to advertise any (new) keys, for
663+
* example, for key-rollover scenarios. Add those entries later in
664+
* the list, so they can be published in appropriate JWKS.
665+
*
666+
* Note that these keys SHOULD NOT be the same as the ones used in the
667+
* protocol (Connect) itself.
668+
*
669+
* The format is the same as for the protocol (Connect) signature key pairs
670+
* (option ModuleConfig::OPTION_PROTOCOL_SIGNATURE_KEY_PAIRS)
671+
*/
672+
ModuleConfig::OPTION_VCI_SIGNATURE_KEY_PAIRS => [
673+
[
674+
ModuleConfig::KEY_ALGORITHM => \SimpleSAML\OpenID\Algorithms\SignatureAlgorithmEnum::ES256,
675+
ModuleConfig::KEY_PRIVATE_KEY_FILENAME => 'oidc_module_vci_ec_p256_01.key',
676+
ModuleConfig::KEY_PUBLIC_KEY_FILENAME => 'oidc_module_vci_ec_p256_01.pub',
677+
// ModuleConfig::KEY_PRIVATE_KEY_PASSWORD => 'private-key-password', // Optional
678+
// ModuleConfig::KEY_KEY_ID => 'ec-vci-signing-key-01', // Optional
679+
],
680+
],
653681

654682
/**
655683
* Allow or disallow non-registered clients to request verifiable
656684
* credentials. Default is disallowed (false).
657685
*/
658-
ModuleConfig::OPTION_ALLOW_NON_REGISTERED_CLIENTS_FOR_VCI => false,
686+
ModuleConfig::OPTION_VCI_ALLOW_NON_REGISTERED_CLIENTS => false,
659687

660688
/**
661689
* Allowed redirect URI prefixes for non-registered clients. By default, this is set to
@@ -667,7 +695,7 @@ $config = [
667695
* 'https://example.org/redirect2',
668696
* ]
669697
*/
670-
ModuleConfig::OPTION_ALLOWED_REDIRECT_URI_PREFIXES_FOR_NON_REGISTERED_CLIENTS_FOR_VCI => [
698+
ModuleConfig::OPTION_VCI_ALLOWED_REDIRECT_URI_PREFIXES_FOR_NON_REGISTERED_CLIENTS => [
671699
'openid-credential-offer://',
672700
],
673701

@@ -677,7 +705,7 @@ $config = [
677705
* https://openid.net/specs/openid-4-verifiable-credential-issuance-1_0.html#credential-issuer-parameters.
678706
* Check the example below on how this can be used.
679707
*/
680-
ModuleConfig::OPTION_CREDENTIAL_CONFIGURATIONS_SUPPORTED => [
708+
ModuleConfig::OPTION_VCI_CREDENTIAL_CONFIGURATIONS_SUPPORTED => [
681709
// Sample for 'jwt_vc_json' format with notes about required and
682710
// optional fields.
683711
'ResearchAndScholarshipCredentialJwtVcJson' => [
@@ -945,7 +973,7 @@ $config = [
945973
* ],
946974
* ],
947975
*/
948-
ModuleConfig::OPTION_USER_ATTRIBUTE_TO_CREDENTIAL_CLAIM_PATH_MAP => [
976+
ModuleConfig::OPTION_VCI_USER_ATTRIBUTE_TO_CREDENTIAL_CLAIM_PATH_MAP => [
949977
'ResearchAndScholarshipCredentialJwtVcJson' => [
950978
['eduPersonPrincipalName' => [ClaimsEnum::Credential_Subject->value, 'eduPersonPrincipalName']],
951979
['eduPersonTargetedID' => [ClaimsEnum::Credential_Subject->value, 'eduPersonTargetedID']],
@@ -966,12 +994,19 @@ $config = [
966994
],
967995
],
968996

997+
/**
998+
* (optional) Issuer State TTL (validity duration), with the given example.
999+
* If not set, falls back to Authorization Code TTL. For duration format
1000+
* info, check https://www.php.net/manual/en/dateinterval.construct.php
1001+
*/
1002+
ModuleConfig::OPTION_VCI_ISSUER_STATE_TTL => 'PT10M', // 10 minutes
1003+
9691004
/**
9701005
* Map of authentication sources and user's email attribute names. This
9711006
* enables you to define a specific attribute name which contains the
9721007
* user's email address, per authentication source. This is used, for
9731008
* example, to send Transaction Code in the case of pre-authorized
974-
* codes for verifiable credential issuance. If not set, the default
1009+
* codes for Verifiable Credential Issuance. If not set, the default
9751010
* user's email attribute name will be used (see the option below).
9761011
*
9771012
* Format is: 'authentication-source-id' => 'email-attribute-name'.
@@ -986,13 +1021,6 @@ $config = [
9861021
*/
9871022
ModuleConfig::OPTION_DEFAULT_USERS_EMAIL_ATTRIBUTE_NAME => 'mail',
9881023

989-
/**
990-
* (optional) Issuer State TTL (validity duration), with the given example.
991-
* If not set, falls back to Authorization Code TTL. For duration format
992-
* info, check https://www.php.net/manual/en/dateinterval.construct.php
993-
*/
994-
ModuleConfig::OPTION_ISSUER_STATE_TTL => 'PT10M', // 10 minutes
995-
9961024

9971025
/***************************************************************************
9981026
* (optional) API-related options.

docker/ssp/module_oidc.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
ModuleConfig::OPTION_TOKEN_REFRESH_TOKEN_TTL => 'P1M',
2222
ModuleConfig::OPTION_TOKEN_ACCESS_TOKEN_TTL => 'PT1H',
2323

24-
ModuleConfig::OPTION_PROTOCOL_SIGNATURE_KEY_PAIRS => [
24+
ModuleConfig::OPTION_CONNECT_SIGNATURE_KEY_PAIRS => [
2525
[
2626
ModuleConfig::KEY_ALGORITHM => \SimpleSAML\OpenID\Algorithms\SignatureAlgorithmEnum::RS256,
2727
ModuleConfig::KEY_PRIVATE_KEY_FILENAME => ModuleConfig::DEFAULT_PKI_PRIVATE_KEY_FILENAME,

docs/1-oidc.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ Supported flows:
1313

1414
## Note on OpenID Federation (OIDFed)
1515

16-
OpenID Federation support is in draft, as is the
17-
[specification](https://openid.net/specs/openid-federation-1_0). You can
16+
OpenID Federation support is in draft phase. You can
1817
expect breaking changes in future releases related to OIDFed
1918
capabilities. OIDFed can be enabled or disabled in the module
2019
configuration.

0 commit comments

Comments
 (0)