@@ -22,7 +22,6 @@ declare(strict_types=1);
2222 */
2323
2424use SimpleSAML\Module\oidc\ModuleConfig;
25- use SimpleSAML\Module\oidc\ValueAbstracts\SignatureKeyPairConfig;
2625use SimpleSAML\OpenID\Codebooks\ClaimsEnum;
2726use SimpleSAML\OpenID\Codebooks\CredentialFormatIdentifiersEnum;
2827use SimpleSAML\OpenID\Codebooks\CredentialTypesEnum;
@@ -71,35 +70,59 @@ $config = [
7170// ModuleConfig::OPTION_PKI_NEW_CERTIFICATE_FILENAME => 'new_oidc_module.crt',
7271
7372 /**
74- * Default protocol (Connect) signature algorithm and key-pair definition.
75- * This algorithm and key will be used, for example, to sign ID Token JWS,
76- * if no other algorithm is negotiated with the client.
77- */
78- ModuleConfig::DEFAULT_PROTOCOL_SIGNATURE_KEY_PAIR => [
79- 'algorithm' => \SimpleSAML\OpenID\Algorithms\SignatureAlgorithmEnum::RS256,
80- 'privateKeyFilename' => ModuleConfig::DEFAULT_PKI_PRIVATE_KEY_FILENAME,
81- 'publicKeyFilename' => ModuleConfig::DEFAULT_PKI_CERTIFICATE_FILENAME,
82- // 'privateKeyPassword' => 'private-key-password', // Optional
83- // 'keyId' => 'rsa-connect-signing-key-2026', // Optional
84- ],
85-
86- /**
87- * Additionally supported protocol (Connect) signing algorithms and
88- * key-pairs. These entries will be used in signing algorithm negotiation
89- * with the client. The order in which the entries are set is important,
90- * as the entries set first will have higher priority during negotiation.
73+ * Protocol (Connect) signature algorithm and key-pair definitions,
74+ * representing supported algorithms for signing, for example, ID Token JWS.
75+ * The order in which the entries are set is important. The entry set
76+ * first will have higher priority during signing algorithm negotiation
77+ * with the client. If the client doesn't designate desired signing
78+ * algorithm, the first algorithm in the list will be used for signing (the
79+ * first entry represents default algorithm and signing key). Note that
80+ * the OpenID Connect specification designates `RS256` as the signing
81+ * algorithm that should be used by default, so you would probably want
82+ * to use that algorithm as the default (first) one. However, you are free
83+ * to set other default (first) algorithm as needed.
84+ * You can also use this config option to advertise any (new) keys, for
85+ * example, for key-rollover scenarios. Just add those entries later in
86+ * the list, so they can be published on the OP discovery endpoint.
9187 *
92- * You can also use this config option to advertise any
93- * (new) keys, for example, for key-rollover scenarios. Just add those
94- * entries last.
88+ * The format is array of associative arrays, where each array value
89+ * consists of the following properties (keys):
90+ * - ModuleConfig::KEY_ALGORITHM - \SimpleSAML\OpenID\Algorithms\SignatureAlgorithmEnum case
91+ * representing the algorithm.
92+ * - ModuleConfig::KEY_PRIVATE_KEY_FILENAME - the name of the file
93+ * containing private key inPEM format, which is available in SSP `cert`
94+ * folder.
95+ * - ModuleConfig::KEY_PUBLIC_KEY_FILENAME - the name of the file containing
96+ * corresponding public key in PEM format, which is available in SSP `cert`
97+ * folder.
98+ * - ModuleConfig::KEY_PRIVATE_KEY_PASSWORD - private key password, if
99+ * needed.
100+ * - ModuleConfig::KEY_KEY_ID - Optional string representing key identifier.
101+ * Use if you need to manually set key identifiers to be published. If not
102+ * set, a public key thumbprint will be generated on the fly and used as a
103+ * key ID.
104+ *
105+ * Note: in v7 of the module, a new way of automatic key ID generation is
106+ * used. In previous versions, a hash of a public key file was used as a
107+ * key ID. In v7, a public key thumbprint is used. If you are migrating from
108+ * previous version of the module, and you want to keep the old signing key,
109+ * you should manually set the key ID to the previous value, so that clients
110+ * know that the key did not change.
95111 */
96- ModuleConfig::ADDITIONAL_PROTOCOL_SIGNATURE_KEY_PAIRS => [
112+ ModuleConfig::OPTION_PROTOCOL_SIGNATURE_KEY_PAIRS => [
113+ [
114+ ModuleConfig::KEY_ALGORITHM => \SimpleSAML\OpenID\Algorithms\SignatureAlgorithmEnum::RS256,
115+ ModuleConfig::KEY_PRIVATE_KEY_FILENAME => ModuleConfig::DEFAULT_PKI_PRIVATE_KEY_FILENAME,
116+ ModuleConfig::KEY_PUBLIC_KEY_FILENAME => ModuleConfig::DEFAULT_PKI_CERTIFICATE_FILENAME,
117+ // ModuleConfig::KEY_PRIVATE_KEY_PASSWORD => 'private-key-password', // Optional
118+ // ModuleConfig::KEY_KEY_ID => 'rsa-connect-signing-key-2026', // Optional
119+ ],
97120 [
98- 'algorithm' => \SimpleSAML\OpenID\Algorithms\SignatureAlgorithmEnum::ES256,
99- 'privateKeyFilename' => 'oidc_module_ec256.key',
100- 'publicKeyFilename' => 'oidc_module_ec256.pub',
101- // 'privateKeyPassword' => 'private-key-password', // Optional
102- // 'keyId' => 'ec-connect-signing-key-01', // Optional
121+ ModuleConfig::KEY_ALGORITHM => \SimpleSAML\OpenID\Algorithms\SignatureAlgorithmEnum::ES256,
122+ ModuleConfig::KEY_PRIVATE_KEY_FILENAME => 'oidc_module_ec256.key',
123+ ModuleConfig::KEY_PUBLIC_KEY_FILENAME => 'oidc_module_ec256.pub',
124+ // ModuleConfig::KEY_PRIVATE_KEY_PASSWORD => 'private-key-password', // Optional
125+ // ModuleConfig::KEY_KEY_ID => 'ec-connect-signing-key-01', // Optional
103126 ],
104127 ],
105128
0 commit comments