From cb9add6eac5294bd01368fe7acf5224b06c28ad0 Mon Sep 17 00:00:00 2001 From: Christophe Maudoux Date: Wed, 1 May 2019 13:09:26 +0200 Subject: [PATCH] Fix warning message --- .../lib/Lemonldap/NG/Portal/Lib/OpenIDConnect.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Lib/OpenIDConnect.pm b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Lib/OpenIDConnect.pm index a3cefa0c7..528b0c2c0 100644 --- a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Lib/OpenIDConnect.pm +++ b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Lib/OpenIDConnect.pm @@ -1168,17 +1168,17 @@ sub createJWT { my $digest; - if ( $alg eq "HS256" ) { + if ( $alg eq "HS256" && $client_secret ) { $digest = hmac_sha256_base64( $jwt_header . "." . $jwt_payload, $client_secret ); } - if ( $alg eq "HS384" ) { + if ( $alg eq "HS384" && $client_secret ) { $digest = hmac_sha384_base64( $jwt_header . "." . $jwt_payload, $client_secret ); } - if ( $alg eq "HS512" ) { + if ( $alg eq "HS512" && $client_secret ) { $digest = hmac_sha512_base64( $jwt_header . "." . $jwt_payload, $client_secret ); }