55use Defuse \Crypto \Key ;
66use Exception ;
77use Lcobucci \JWT \Configuration ;
8- use Lcobucci \JWT \Signer \Hmac \Sha256 ;
98use Lcobucci \JWT \Signer \Key \InMemory ;
109use Lcobucci \JWT \Validation \Constraint \IdentifiedBy ;
1110use Lcobucci \JWT \Validation \Constraint \IssuedBy ;
1211use ShinyDeploy \Core \Crypto \KeyCrypto ;
1312use ShinyDeploy \Core \Crypto \PasswordCrypto ;
13+ use ShinyDeploy \Core \Crypto \Sha256Signer ;
1414use ShinyDeploy \Exceptions \AuthException ;
1515use ShinyDeploy \Exceptions \CryptographyException ;
1616use ShinyDeploy \Exceptions \DatabaseException ;
@@ -29,7 +29,7 @@ class Auth extends DatabaseDomain
2929 public function generateToken (string $ username , string $ userEncryptionKey , string $ clientId ): string
3030 {
3131 try {
32- $ signer = new Sha256 ();
32+ $ signer = new Sha256Signer ();
3333 $ key = InMemory::plainText ($ this ->config ->get ('auth.secret ' ));
3434 $ config = Configuration::forSymmetricSigner ($ signer , $ key );
3535 $ now = new \DateTimeImmutable ();
@@ -62,7 +62,7 @@ public function generateToken(string $username, string $userEncryptionKey, strin
6262 public function validateToken (string $ token , string $ clientId ): bool
6363 {
6464 try {
65- $ signer = new Sha256 ();
65+ $ signer = new Sha256Signer ();
6666 $ key = InMemory::plainText ($ this ->config ->get ('auth.secret ' ));
6767 $ config = Configuration::forSymmetricSigner ($ signer , $ key );
6868 $ parsedToken = $ config ->parser ()->parse ($ token );
@@ -223,7 +223,7 @@ public function getEncryptionKeyFromToken(string $token): string
223223 }
224224
225225 try {
226- $ signer = new Sha256 ();
226+ $ signer = new Sha256Signer ();
227227 $ key = InMemory::plainText ($ this ->config ->get ('auth.secret ' ));
228228 $ config = Configuration::forSymmetricSigner ($ signer , $ key );
229229 $ parsedToken = $ config ->parser ()->parse ($ token );
0 commit comments