Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion 3rdparty/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
},
"require": {
"onelogin/php-saml": "^4.0",
"firebase/php-jwt": "^4.0"
"firebase/php-jwt": "^6.4"
}
}
30 changes: 23 additions & 7 deletions 3rdparty/composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions lib/Controller/SAMLController.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
namespace OCA\User_SAML\Controller;

use Firebase\JWT\JWT;
use Firebase\JWT\Key;
use OC\Core\Controller\ClientFlowLoginController;
use OC\Core\Controller\ClientFlowLoginV2Controller;
use OCA\User_SAML\Exceptions\NoUserFoundException;
Expand Down Expand Up @@ -664,10 +665,11 @@ private function getDirectLoginUrl($redirectUrl) {
return $directUrl;
}

private function isValidJwt($jwt) {

private function isValidJwt($jwt): bool {
try {
$key = $this->config->getSystemValue('gss.jwt.key', '');
JWT::decode($jwt, $key, ['HS256']);
JWT::decode($jwt, new Key($key, 'HS256'));
} catch (\Exception $e) {
return false;
}
Expand Down