Skip to content

Commit

Permalink
Ssupport JWT Library and SF 7.0 (#551)
Browse files Browse the repository at this point in the history
Symfony 7 and web-token/jwt-library 3.3
  • Loading branch information
Spomky authored Feb 23, 2024
1 parent dfec02e commit 283b936
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 15 deletions.
10 changes: 2 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"psr/http-factory": "^1.0",
"psr/log": "^1.0|^2.0|^3.0",
"spomky-labs/cbor-php": "^3.0",
"symfony/uid": "^6.1",
"symfony/uid": "^6.1|^7.0",
"web-auth/cose-lib": "^4.2.3",
"web-auth/metadata-service": "self.version"
},
Expand All @@ -47,13 +47,7 @@
},
"suggest": {
"psr/log-implementation": "Recommended to receive logs from the library",
"web-token/jwt-key-mgmt": "Mandatory for the AndroidSafetyNet Attestation Statement support",
"web-token/jwt-signature-algorithm-rsa": "Mandatory for the AndroidSafetyNet Attestation Statement support",
"web-token/jwt-signature-algorithm-ecdsa": "Recommended for the AndroidSafetyNet Attestation Statement support",
"web-token/jwt-signature-algorithm-eddsa": "Recommended for the AndroidSafetyNet Attestation Statement support",
"web-token/jwt-library": "Mandatory for the AndroidSafetyNet Attestation Statement support",
"symfony/event-dispatcher": "Recommended to use dispatched events"
},
"require-dev": {
"symfony/event-dispatcher": "^6.1"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,9 @@ public function __construct(
'The parameter "$clock" will be required in 5.0.0. Please set a clock instance.'
);
}
if (! class_exists(RS256::class)) {
if (! class_exists(RS256::class) || ! class_exists(JWKFactory::class)) {
throw UnsupportedFeatureException::create(
'The algorithm RS256 is missing. Did you forget to install the package web-token/jwt-signature-algorithm-rsa?'
);
}
if (! class_exists(JWKFactory::class)) {
throw UnsupportedFeatureException::create(
'The class Jose\Component\KeyManagement\JWKFactory is missing. Did you forget to install the package web-token/jwt-key-mgmt?'
'The algorithm RS256 is missing. Did you forget to install the package web-token/jwt-library?'
);
}
$this->jwsSerializer = new CompactSerializer();
Expand Down

0 comments on commit 283b936

Please sign in to comment.