diff --git a/src/Providers/JWT/Lcobucci.php b/src/Providers/JWT/Lcobucci.php index 0f2c0d0f..4286c8e9 100644 --- a/src/Providers/JWT/Lcobucci.php +++ b/src/Providers/JWT/Lcobucci.php @@ -216,6 +216,11 @@ protected function getSigner() if (! array_key_exists($this->algo, $this->signers)) { throw new JWTException('The given algorithm could not be found'); } + + // for ES256, ES384 and ES512 we need add a SignatureConverter into the constructor + if( str_starts_with( $this->algo, 'ES') ){ + return $this->signers[$this->algo]::create(); + } return new $this->signers[$this->algo]; }