Skip to content

Commit e5839cd

Browse files
committed
Fix default values in WebToken services when encryption disabled
1 parent b20c4ae commit e5839cd

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

Resources/config/web_token_issuance.xml

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
<argument type="service" id="Jose\Bundle\JoseFramework\Services\JWEBuilderFactory" on-invalid="null" />
1212
<argument /> <!-- Signature algorithm -->
1313
<argument /> <!-- Signature key -->
14-
<argument /> <!-- Key encryption algorithm -->
15-
<argument /> <!-- Content encryption algorithm -->
16-
<argument /> <!-- Encryption key -->
14+
<argument>null</argument> <!-- Key encryption algorithm -->
15+
<argument>null</argument> <!-- Content encryption algorithm -->
16+
<argument>null</argument> <!-- Encryption key -->
1717
</service>
1818
</services>
1919
</container>

Resources/config/web_token_verification.xml

+4-4
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@
1010
<argument type="service" id="Jose\Bundle\JoseFramework\Services\JWELoaderFactory" on-invalid="null" />
1111
<argument type="service" id="Jose\Bundle\JoseFramework\Services\ClaimCheckerManagerFactory" />
1212
<argument type="collection" /> <!-- Claim checkers -->
13-
<argument type="collection"/> <!-- JWS header checkers -->
14-
<argument type="collection"/> <!-- Mandatory claims -->
13+
<argument type="collection" /> <!-- JWS header checkers -->
14+
<argument type="collection" /> <!-- Mandatory claims -->
1515
<argument type="collection" /> <!-- Allowed signature algorithms -->
1616
<argument /> <!-- Signature keyset -->
17-
<argument on-invalid="null" /> <!-- Continue on decryption failure -->
17+
<argument>false</argument> <!-- Continue on decryption failure -->
1818
<argument type="collection" /> <!-- JWE header checkers -->
1919
<argument type="collection" /> <!-- Allowed key encryption algorithms -->
2020
<argument type="collection" /> <!-- Allowed content encryption algorithms -->
21-
<argument on-invalid="null" /> <!-- Encryption keyset -->
21+
<argument>null</argument> <!-- Encryption keyset -->
2222
</service>
2323
<service id="lexik_jwt_authentication.web_token.iat_validator" class="Jose\Component\Checker\IssuedAtChecker" public="false">
2424
<argument>%lexik_jwt_authentication.clock_skew%</argument>

Services/WebToken/AccessTokenLoader.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public function __construct(
4646
?string $encryptionKeyset
4747
) {
4848
$this->jwsLoader = $jwsLoaderFactory->create(['jws_compact'], $signatureAlgorithms, $jwsHeaderChecker);
49-
if ($jweLoaderFactory !== null && $keyEncryptionAlgorithms !== null && $contentEncryptionAlgorithms !== null && $jweHeaderChecker !== null) {
49+
if ($jweLoaderFactory !== null && $keyEncryptionAlgorithms !== [] && $contentEncryptionAlgorithms !== [] && $jweHeaderChecker !== []) {
5050
$this->jweLoader = $jweLoaderFactory->create(['jwe_compact'], array_merge($keyEncryptionAlgorithms, $contentEncryptionAlgorithms), null, null, $jweHeaderChecker);
5151
$this->continueOnDecryptionFailure = $continueOnDecryptionFailure;
5252
}

0 commit comments

Comments
 (0)