You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
RuntimeException: Error while decoding to JSON: Control character error, possibly incorrectly encoded in /var/www/phpinclude/vendor_composer/lcobucci/jwt/src/Parsing/Decoder.php:36
Stack trace:
#0 /var/www/phpinclude/vendor_composer/lcobucci/jwt/src/Parser.php(130): Lcobucci\JWT\Parsing\Decoder->jsonDecode('{"...')
#1 /var/www/phpinclude/vendor_composer/lcobucci/jwt/src/Parser.php(61): Lcobucci\JWT\Parser->parseClaims('...')
I sent the token by GET parameter. When I modified the token in the address bar of my browser randomly this error occurred.
Shouldn't the $token->validate() function catch this error and returns FALSE?
@berndtja validation happens after parsing. If the library is throwing an exception during parsing is because it's unable to create a valid token object from the string.
Request Headers:
Content-Type:"application/json"
cache-control:"no-cache"
Postman-Token:"7aa53299-d109-4574-9e5c-b8e6df3e4e0a"
Authorization:"Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0sssssssaSI6IjgxOGM5ZTY0LWQyZTktNGZjYy1iZjIyLWJmOWY5MmMxYjgxMCJ9.eyJpc3MiOiJ3d3cua2VuaW1hZGFsYS5jb20iLCJqdGkiOiI4MThjOWU2NC1kMmU5LTRmY2MtYmYyMi1iZjlmOTJjMWI4MTAiLCJpYXQiOjE1OTAxNTA5OTMsIm5iZiI6MTU5MDE1MDk5MywiZXhwIjoxNTkwMTY1MzkzLCJ1aWQiOiJsb2dpbiJ9.x8mtKaeRCURZ-B7wMdI_D86ZiZDn29n1TFjckwOaJ4L7mWz3MXDDItsqOkY8mTpgmiHhc-KgrrcBFGQica_G67hxV1F63_aAIe4rr4yDlha5pK28_c5VxEjeoOhRBmBWWYeWSC61sxNiOyAsA3fjFFC3fqtdtQC3KBl-T-sGFEYvpRJfEfc70be12QCppxkQpXY93HeqsZJS2hnf9l-raJexyQeVnJxUuqzG9BdZFtI3b7zcvY2qrYdeToN6FSWGUdJIea63Wfp2hOI_NUsqMAWbTOzTxPv3KILa9RR0eDxGivzBkkc7j1BWUZ-IypY1lXxSVFKXsIv1VhONWGU7nQ"
User-Agent:"PostmanRuntime/7.6.0"
Accept:"/"
Host:"slimapi.local"
accept-encoding:"gzip, deflate"
content-length:158
Request Body:
Response Headers:
Date:"Fri, 22 May 2020 13:05:24 GMT"
Server:"Apache/2.4.41 (Ubuntu)"
Vary:"Accept-Encoding"
Content-Encoding:"gzip"
Content-Length:"455"
Keep-Alive:"timeout=5, max=100"
Connection:"Keep-Alive"
Content-Type:"text/html; charset=UTF-8"
Response Body:
Fatal error: Uncaught RuntimeException: Error while decoding to JSON: Malformed UTF-8 characters, possibly incorrectly encoded in /var/www/slimapi/vendor/lcobucci/jwt/src/Parsing/Decoder.php:36
Stack trace:
#0 /var/www/slimapi/vendor/lcobucci/jwt/src/Parser.php(112): Lcobucci\JWT\Parsing\Decoder->jsonDecode()
#1 /var/www/slimapi/vendor/lcobucci/jwt/src/Parser.php(60): Lcobucci\JWT\Parser->parseHeader()
#2 /var/www/slimapi/src/Lib/JwtAuth.php(104): Lcobucci\JWT\Parser->parse()
#3 /var/www/slimapi/src/Lib/JwtAuth.php(115): App\Lib\JwtAuth->createParsedToken()
#4 /var/www/slimapi/src/Middleware/JwtMiddleware.php(45): App\Lib\JwtAuth->validateToken()
#5 /var/www/slimapi/vendor/slim/slim/Slim/MiddlewareDispatcher.php(188): App\Middleware\JwtMiddleware->process()
#6 /var/www/slimapi/vendor/slim/slim/Slim/Middleware/BodyParsingMiddleware.php(66): class@anonymous->handle()
#7 /var in /var/www/slimapi/vendor/lcobucci/jwt/src/Parsing/Decoder.php on line 36
The text was updated successfully, but these errors were encountered: