Exceptions
Exceptions 2
Lexik\Bundle\JWTAuthenticationBundle\Exception\ JWTEncodeFailureException
Show exception properties
Lexik\Bundle\JWTAuthenticationBundle\Exception\JWTEncodeFailureException {#1131 -reason: "invalid_config" -payload: array:2 [ "roles" => array:2 [ 0 => "ROLE_ADMIN" 1 => "ROLE_USER" ] "username" => "info@offlinesys.de" ] }
public function encode(array $payload, array $header = []){try {$jws = $this->jwsProvider->create($payload, $header);} catch (\InvalidArgumentException $e) {throw new JWTEncodeFailureException(JWTEncodeFailureException::INVALID_CONFIG, 'An error occurred while trying to encode the JWT token. Please verify your configuration (private key/passphrase)', $e, $payload);}if (!$jws->isSigned()) {throw new JWTEncodeFailureException(JWTEncodeFailureException::UNSIGNED_TOKEN, 'Unable to create a signed JWT from the given configuration.', null, $payload);}
in
vendor/lexik/jwt-authentication-bundle/Services/JWTManager.php
->
encode
(line 82)
{$jwtCreatedEvent = new JWTCreatedEvent($payload, $user);$this->dispatcher->dispatch($jwtCreatedEvent, Events::JWT_CREATED);if ($this->jwtEncoder instanceof HeaderAwareJWTEncoderInterface) {$jwtString = $this->jwtEncoder->encode($jwtCreatedEvent->getData(), $jwtCreatedEvent->getHeader());} else {$jwtString = $this->jwtEncoder->encode($jwtCreatedEvent->getData());}$jwtEncodedEvent = new JWTEncodedEvent($jwtString);
in
vendor/lexik/jwt-authentication-bundle/Services/JWTManager.php
->
generateJwtStringAndDispatchEvents
(line 53)
$payload = ['roles' => $user->getRoles()];$this->addUserIdentityToPayload($user, $payload);$this->payloadEnrichment->enrich($user, $payload);return $this->generateJwtStringAndDispatchEvents($user, $payload);}/*** @return string The JWT token*
}$this->loginThrottleService->registerSuccess($ip, $user);$this->loginAttemptService->log($request, $user, $email, true);$accessToken = $this->jwtManager->create($user);$refresh = $this->refreshTokenService->create($user, $deviceId, (string) $ip, $request->headers->get('User-Agent'));return $this->data(['access_token' => $accessToken,'refresh_token' => $refresh['token'],
in
vendor/symfony/http-kernel/HttpKernel.php
->
login
(line 183)
$this->dispatcher->dispatch($event, KernelEvents::CONTROLLER_ARGUMENTS);$controller = $event->getController();$arguments = $event->getArguments();// call controller$response = $controller(...$arguments);// viewif (!$response instanceof Response) {$event = new ViewEvent($this, $request, $type, $response, $event);$this->dispatcher->dispatch($event, KernelEvents::VIEW);
in
vendor/symfony/http-kernel/HttpKernel.php
->
handleRaw
(line 76)
$request->headers->set('X-Php-Ob-Level', (string) ob_get_level());$this->requestStack->push($request);$response = null;try {return $response = $this->handleRaw($request, $type);} catch (\Throwable $e) {if ($e instanceof \Error && !$this->handleAllThrowables) {throw $e;}
in
vendor/symfony/http-kernel/Kernel.php
->
handle
(line 193)
if (!$this->handlingHttpCache) {$this->resetServices = true;}try {return $this->getHttpKernel()->handle($request, $type, $catch);} finally {--$this->requestStackSize;}}
in
vendor/symfony/runtime/Runner/Symfony/HttpKernelRunner.php
->
handle
(line 35)
) {}public function run(): int{$response = $this->kernel->handle($this->request);if (Kernel::VERSION_ID >= 60400) {$response->send(false);if (\function_exists('fastcgi_finish_request') && !$this->debug) {
in
vendor/autoload_runtime.php
->
run
(line 32)
$app = $app(...$args);exit($runtime->getRunner($app)->run());
<?phpuse App\Kernel;require_once dirname(__DIR__).'/vendor/autoload_runtime.php';return function (array $context) {return new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);};
Lcobucci\JWT\Signer\ InvalidKeyProvided
final class InvalidKeyProvided extends InvalidArgumentException implements Exception{public static function cannotBeParsed(string $details): self{return new self('It was not possible to parse your key, reason:' . $details);}/*** @param non-empty-string $expectedType* @param non-empty-string $actualType
in
vendor/lcobucci/jwt/src/Signer/OpenSSL.php
::
cannotBeParsed
(line 97)
* @throws InvalidKeyProvided*/private function validateKey(OpenSSLAsymmetricKey|bool $key): OpenSSLAsymmetricKey{if (is_bool($key)) {throw InvalidKeyProvided::cannotBeParsed($this->fullOpenSSLErrorString());}$details = openssl_pkey_get_details($key);assert(is_array($details));
in
vendor/lcobucci/jwt/src/Signer/OpenSSL.php
->
validateKey
(line 68)
#[SensitiveParameter]string $pem,#[SensitiveParameter]string $passphrase,): OpenSSLAsymmetricKey {return $this->validateKey(openssl_pkey_get_private($pem, $passphrase));}/** @throws InvalidKeyProvided */final protected function verifySignature(string $expected,
in
vendor/lcobucci/jwt/src/Signer/OpenSSL.php
->
getPrivateKey
(line 50)
string $pem,#[SensitiveParameter]string $passphrase,string $payload,): string {$key = $this->getPrivateKey($pem, $passphrase);$signature = '';if (! openssl_sign($payload, $signature, $key, $this->algorithm())) {throw CannotSignPayload::errorHappened($this->fullOpenSSLErrorString());
in
vendor/lcobucci/jwt/src/Signer/Rsa.php
->
createSignature
(line 14)
{private const MINIMUM_KEY_LENGTH = 2048;final public function sign(string $payload, Key $key): string{return $this->createSignature($key->contents(), $key->passphrase(), $payload);}final public function verify(string $expected, string $payload, Key $key): bool{return $this->verifySignature($expected, $payload, $key->contents());
in
vendor/lcobucci/jwt/src/Token/Builder.php
->
sign
(line 158)
$headers['alg'] = $signer->algorithmId();$encodedHeaders = $this->encode($headers);$encodedClaims = $this->encode($this->claimFormatter->formatClaims($this->claims));$signature = $signer->sign($encodedHeaders . '.' . $encodedClaims, $key);$encodedSignature = $this->encoder->base64UrlEncode($signature);return new Plain(new DataSet($headers, $encodedHeaders),new DataSet($this->claims, $encodedClaims),
in
vendor/lexik/jwt-authentication-bundle/Services/JWSProvider/LcobucciJWSProvider.php
->
getToken
(line 159)
private function getSignedToken(Builder $jws): string{$key = InMemory::plainText($this->keyLoader->loadKey(KeyLoaderInterface::TYPE_PRIVATE), $this->signer instanceof Hmac ? '' : (string) $this->keyLoader->getPassphrase());$token = $jws->getToken($this->signer, $key);return $token->toString();}private function verify(Token $jwt): bool
in
vendor/lexik/jwt-authentication-bundle/Services/JWSProvider/LcobucciJWSProvider.php
->
getSignedToken
(line 99)
foreach ($payload as $name => $value) {$jws = $jws->withClaim($name, $value);}$token = $this->getSignedToken($jws);return new CreatedJWS((string) $token, true);}/**
in
vendor/lexik/jwt-authentication-bundle/Encoder/LcobucciJWTEncoder.php
->
create
(line 29)
* {@inheritdoc}*/public function encode(array $payload, array $header = []){try {$jws = $this->jwsProvider->create($payload, $header);} catch (\InvalidArgumentException $e) {throw new JWTEncodeFailureException(JWTEncodeFailureException::INVALID_CONFIG, 'An error occurred while trying to encode the JWT token. Please verify your configuration (private key/passphrase)', $e, $payload);}if (!$jws->isSigned()) {
in
vendor/lexik/jwt-authentication-bundle/Services/JWTManager.php
->
encode
(line 82)
{$jwtCreatedEvent = new JWTCreatedEvent($payload, $user);$this->dispatcher->dispatch($jwtCreatedEvent, Events::JWT_CREATED);if ($this->jwtEncoder instanceof HeaderAwareJWTEncoderInterface) {$jwtString = $this->jwtEncoder->encode($jwtCreatedEvent->getData(), $jwtCreatedEvent->getHeader());} else {$jwtString = $this->jwtEncoder->encode($jwtCreatedEvent->getData());}$jwtEncodedEvent = new JWTEncodedEvent($jwtString);
in
vendor/lexik/jwt-authentication-bundle/Services/JWTManager.php
->
generateJwtStringAndDispatchEvents
(line 53)
$payload = ['roles' => $user->getRoles()];$this->addUserIdentityToPayload($user, $payload);$this->payloadEnrichment->enrich($user, $payload);return $this->generateJwtStringAndDispatchEvents($user, $payload);}/*** @return string The JWT token*
}$this->loginThrottleService->registerSuccess($ip, $user);$this->loginAttemptService->log($request, $user, $email, true);$accessToken = $this->jwtManager->create($user);$refresh = $this->refreshTokenService->create($user, $deviceId, (string) $ip, $request->headers->get('User-Agent'));return $this->data(['access_token' => $accessToken,'refresh_token' => $refresh['token'],
in
vendor/symfony/http-kernel/HttpKernel.php
->
login
(line 183)
$this->dispatcher->dispatch($event, KernelEvents::CONTROLLER_ARGUMENTS);$controller = $event->getController();$arguments = $event->getArguments();// call controller$response = $controller(...$arguments);// viewif (!$response instanceof Response) {$event = new ViewEvent($this, $request, $type, $response, $event);$this->dispatcher->dispatch($event, KernelEvents::VIEW);
in
vendor/symfony/http-kernel/HttpKernel.php
->
handleRaw
(line 76)
$request->headers->set('X-Php-Ob-Level', (string) ob_get_level());$this->requestStack->push($request);$response = null;try {return $response = $this->handleRaw($request, $type);} catch (\Throwable $e) {if ($e instanceof \Error && !$this->handleAllThrowables) {throw $e;}
in
vendor/symfony/http-kernel/Kernel.php
->
handle
(line 193)
if (!$this->handlingHttpCache) {$this->resetServices = true;}try {return $this->getHttpKernel()->handle($request, $type, $catch);} finally {--$this->requestStackSize;}}
in
vendor/symfony/runtime/Runner/Symfony/HttpKernelRunner.php
->
handle
(line 35)
) {}public function run(): int{$response = $this->kernel->handle($this->request);if (Kernel::VERSION_ID >= 60400) {$response->send(false);if (\function_exists('fastcgi_finish_request') && !$this->debug) {
in
vendor/autoload_runtime.php
->
run
(line 32)
$app = $app(...$args);exit($runtime->getRunner($app)->run());
<?phpuse App\Kernel;require_once dirname(__DIR__).'/vendor/autoload_runtime.php';return function (array $context) {return new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);};
Logs
| Level | Channel | Message |
|---|---|---|
| INFO 22:58:36 | deprecation |
User Deprecated: Class "Doctrine\ORM\Proxy\Autoloader" is deprecated. Use native lazy objects instead. (Autoloader.php:74 called by DoctrineBundle.php:136, https://github.com/doctrine/orm/pull/12005, package doctrine/orm) {
"exception": {}
}
|
| INFO 22:58:36 | request |
Matched route "_profiler". {
"route": "_profiler",
"route_parameters": {
"_route": "_profiler",
"_controller": "web_profiler.controller.profiler::panelAction",
"token": "158d87"
},
"request_uri": "https://skylineit.de/_profiler/158d87?panel=exception&type=request",
"method": "GET"
}
|
Stack Traces 2
|
[2/2]
JWTEncodeFailureException
|
|---|
Lexik\Bundle\JWTAuthenticationBundle\Exception\JWTEncodeFailureException:
An error occurred while trying to encode the JWT token. Please verify your configuration (private key/passphrase)
at vendor/lexik/jwt-authentication-bundle/Encoder/LcobucciJWTEncoder.php:31
at Lexik\Bundle\JWTAuthenticationBundle\Encoder\LcobucciJWTEncoder->encode(array('roles' => array('ROLE_ADMIN', 'ROLE_USER'), 'username' => 'info@offlinesys.de'), array())
(vendor/lexik/jwt-authentication-bundle/Services/JWTManager.php:82)
at Lexik\Bundle\JWTAuthenticationBundle\Services\JWTManager->generateJwtStringAndDispatchEvents(object(User), array('roles' => array('ROLE_ADMIN', 'ROLE_USER'), 'username' => 'info@offlinesys.de'))
(vendor/lexik/jwt-authentication-bundle/Services/JWTManager.php:53)
at Lexik\Bundle\JWTAuthenticationBundle\Services\JWTManager->create(object(User))
(src/Controller/Api/ApiAuthController.php:196)
at App\Controller\Api\ApiAuthController->login(object(Request), object(UserPasswordHasher))
(vendor/symfony/http-kernel/HttpKernel.php:183)
at Symfony\Component\HttpKernel\HttpKernel->handleRaw(object(Request), 1)
(vendor/symfony/http-kernel/HttpKernel.php:76)
at Symfony\Component\HttpKernel\HttpKernel->handle(object(Request), 1, true)
(vendor/symfony/http-kernel/Kernel.php:193)
at Symfony\Component\HttpKernel\Kernel->handle(object(Request))
(vendor/symfony/runtime/Runner/Symfony/HttpKernelRunner.php:35)
at Symfony\Component\Runtime\Runner\Symfony\HttpKernelRunner->run()
(vendor/autoload_runtime.php:32)
at require_once('/var/www/website/vendor/autoload_runtime.php')
(public/index.php:5)
|
|
[1/2]
InvalidKeyProvided
|
|---|
Lcobucci\JWT\Signer\InvalidKeyProvided:
It was not possible to parse your key, reason:
* error:1E08010C:DECODER routines::unsupported
at vendor/lcobucci/jwt/src/Signer/InvalidKeyProvided.php:13
at Lcobucci\JWT\Signer\InvalidKeyProvided::cannotBeParsed('* error:1E08010C:DECODER routines::unsupported')
(vendor/lcobucci/jwt/src/Signer/OpenSSL.php:97)
at Lcobucci\JWT\Signer\OpenSSL->validateKey(false)
(vendor/lcobucci/jwt/src/Signer/OpenSSL.php:68)
at Lcobucci\JWT\Signer\OpenSSL->getPrivateKey(object(SensitiveParameterValue), object(SensitiveParameterValue))
(vendor/lcobucci/jwt/src/Signer/OpenSSL.php:50)
at Lcobucci\JWT\Signer\OpenSSL->createSignature(object(SensitiveParameterValue), object(SensitiveParameterValue), 'eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpYXQiOjE3NzU0MTYyNzYsImV4cCI6MTc3NTQxNzE3Niwicm9sZXMiOlsiUk9MRV9BRE1JTiIsIlJPTEVfVVNFUiJdLCJ1c2VybmFtZSI6ImluZm9Ab2ZmbGluZXN5cy5kZSJ9')
(vendor/lcobucci/jwt/src/Signer/Rsa.php:14)
at Lcobucci\JWT\Signer\Rsa->sign('eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpYXQiOjE3NzU0MTYyNzYsImV4cCI6MTc3NTQxNzE3Niwicm9sZXMiOlsiUk9MRV9BRE1JTiIsIlJPTEVfVVNFUiJdLCJ1c2VybmFtZSI6ImluZm9Ab2ZmbGluZXN5cy5kZSJ9', object(InMemory))
(vendor/lcobucci/jwt/src/Token/Builder.php:158)
at Lcobucci\JWT\Token\Builder->getToken(object(Sha256), object(InMemory))
(vendor/lexik/jwt-authentication-bundle/Services/JWSProvider/LcobucciJWSProvider.php:159)
at Lexik\Bundle\JWTAuthenticationBundle\Services\JWSProvider\LcobucciJWSProvider->getSignedToken(object(Builder))
(vendor/lexik/jwt-authentication-bundle/Services/JWSProvider/LcobucciJWSProvider.php:99)
at Lexik\Bundle\JWTAuthenticationBundle\Services\JWSProvider\LcobucciJWSProvider->create(array('roles' => array('ROLE_ADMIN', 'ROLE_USER'), 'username' => 'info@offlinesys.de'), array())
(vendor/lexik/jwt-authentication-bundle/Encoder/LcobucciJWTEncoder.php:29)
at Lexik\Bundle\JWTAuthenticationBundle\Encoder\LcobucciJWTEncoder->encode(array('roles' => array('ROLE_ADMIN', 'ROLE_USER'), 'username' => 'info@offlinesys.de'), array())
(vendor/lexik/jwt-authentication-bundle/Services/JWTManager.php:82)
at Lexik\Bundle\JWTAuthenticationBundle\Services\JWTManager->generateJwtStringAndDispatchEvents(object(User), array('roles' => array('ROLE_ADMIN', 'ROLE_USER'), 'username' => 'info@offlinesys.de'))
(vendor/lexik/jwt-authentication-bundle/Services/JWTManager.php:53)
at Lexik\Bundle\JWTAuthenticationBundle\Services\JWTManager->create(object(User))
(src/Controller/Api/ApiAuthController.php:196)
at App\Controller\Api\ApiAuthController->login(object(Request), object(UserPasswordHasher))
(vendor/symfony/http-kernel/HttpKernel.php:183)
at Symfony\Component\HttpKernel\HttpKernel->handleRaw(object(Request), 1)
(vendor/symfony/http-kernel/HttpKernel.php:76)
at Symfony\Component\HttpKernel\HttpKernel->handle(object(Request), 1, true)
(vendor/symfony/http-kernel/Kernel.php:193)
at Symfony\Component\HttpKernel\Kernel->handle(object(Request))
(vendor/symfony/runtime/Runner/Symfony/HttpKernelRunner.php:35)
at Symfony\Component\Runtime\Runner\Symfony\HttpKernelRunner->run()
(vendor/autoload_runtime.php:32)
at require_once('/var/www/website/vendor/autoload_runtime.php')
(public/index.php:5)
|