# Signature verification failed in JWTverifier.php

**URL:** <https://community.auth0.com/t/signature-verification-failed-in-jwtverifier-php/29891>\
**Category:** Get Help\
**Created:** [August 23, 2019, 6:11pm UTC](https://community.auth0.com/t/signature-verification-failed-in-jwtverifier-php/29891 "2019-08-23T18:11:30Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![john8](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/john8/32/12921_2.png) [@john8](https://community.auth0.com/u/john8)\
**Post date:** [August 23, 2019, 6:11pm UTC](https://community.auth0.com/t/signature-verification-failed-in-jwtverifier-php/29891/1 "2019-08-23T18:11:30Z")

</div>

Uncaught Auth0\SDK\Exception\CoreException: Signature verification failed in C:\Users.…\laragon\www.…\vendor\auth0\auth0-php\src\JWTVerifier.php:226

The examples that, even though truncated, appear to look the same so I don’t understand what is going on.

**Fatal error** : Uncaught Auth0\SDK\Exception\CoreException: Signature verification failed in C:\Users...\laragon\www\reviewchecked\vendor\auth0\auth0-php\src\JWTVerifier.php:226 Stack trace: #0 C:\Users...\laragon\www\reviewchecked\vendor\auth0\auth0-php\src\Auth0.php(654): Auth0\SDK\JWTVerifier-\>verifyAndDecode(‘eyJ0eXAiOiJKV1Q…’) #1 C:\Users.…\laragon\www\reviewchecked\vendor\auth0\auth0-php\src\Auth0.php(556): Auth0\SDK\Auth0-\>setIdToken(‘eyJ0eXAiOiJKV1Q…’) #2 C:\Users.…\laragon\www\reviewchecked\vendor\auth0\auth0-php\src\Auth0.php(458): Auth0\SDK\Auth0-\>exchange() #3 C:\Users.…\laragon\www\reviewchecked\Login\index.php(19): Auth0\SDK\Auth0-\>getUser() #4 {main} thrown in **C:\Users.…\laragon\www\reviewchecked\vendor\auth0\auth0-php\src\JWTVerifier.php** on line **226**

---

<div class="post-metadata">

**Author:** ![James.Morrison](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/james.morrison/32/13507_2.png) [@James.Morrison](https://community.auth0.com/u/James.Morrison)\
**Post date:** [August 23, 2019, 9:03pm UTC](https://community.auth0.com/t/signature-verification-failed-in-jwtverifier-php/29891/2 "2019-08-23T21:03:45Z")

</div>

Hey there @john8, I wanted to share this doc we have on validating JWTs with our auth0 PHP library which looks to be what you are leveraging.

> **[PHP: Validating JWTs (JSON Web Tokens) with Auth0-PHP](https://auth0.com/docs/libraries/auth0-php/validating-jwts-with-auth0-php)**
>
> Integrate JWT (JSON Web Token) validation within your PHP application to parse, verify and validate tokens.

Please take a look and let me know if it helps you in your quest. In the mean time I will continue searching for other possible solutions.

---

<div class="post-metadata">

**Author:** ![john8](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/john8/32/12921_2.png) [@john8](https://community.auth0.com/u/john8)\
**Post date:** [August 24, 2019, 2:16pm UTC](https://community.auth0.com/t/signature-verification-failed-in-jwtverifier-php/29891/3 "2019-08-24T14:16:23Z")

</div>

James,

Thank you for getting back to me. I’m using the Auth0-PHP library so I don’t know how that is supposed to help. I actually don’t know why there arent more complaints like this. I even tried using the starter seed library and I am still getting the same error.

**Fatal error** : Uncaught Auth0\SDK\Exception\CoreException: Signature verification failed in JWTVerifier.php\*\* on line **226**

---

<div class="post-metadata">

**Author:** ![James.Morrison](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/james.morrison/32/13507_2.png) [@James.Morrison](https://community.auth0.com/u/James.Morrison)\
**Post date:** [August 27, 2019, 7:03pm UTC](https://community.auth0.com/t/signature-verification-failed-in-jwtverifier-php/29891/4 "2019-08-27T19:03:40Z")

</div>

Following up @john8, after some investigation I found that someone is exhibiting a similar issue to you within the Github issues.

> <https://github.com/auth0/auth0-PHP/issues/356>
>
> I'm assuming that the version of AUTH0-PHP is 5.4 based on the same output. I do…n't see anywhere where the version number is listed but I guess composer is pulling the latest. I even tried the starter seed library and installed its dependencies as noted on the download sample. This library worked in the past but now I keep getting the same error with JWT on line 226.
> 
> Fatal error : Uncaught Auth0\\SDK\\Exception\\CoreException: Signature verification failed in C:\\Users…\\laragon\\www\\reviewchecked\\vendor\\auth0\\auth0-php\\src\\JWTVerifier.php:226 Stack trace: #0 C:\\Users…\\laragon\\www\\reviewchecked\\vendor\\auth0\\auth0-php\\src\\Auth0.php(654): Auth0\\SDK\\JWTVerifier-\>verifyAndDecode(‘eyJ0eXAiOiJKV1Q…’) #1 C:\\Users…\\laragon\\www\\reviewchecked\\vendor\\auth0\\auth0-php\\src\\Auth0.php(556): Auth0\\SDK\\Auth0-\>setIdToken(‘eyJ0eXAiOiJKV1Q…’) #2 C:\\Users…\\laragon\\www\\reviewchecked\\vendor\\auth0\\auth0-php\\src\\Auth0.php(458): Auth0\\SDK\\Auth0-\>exchange() #3 C:\\Users…\\laragon\\www\\reviewchecked\\Login\\index.php(19): Auth0\\SDK\\Auth0-\>getUser() #4 {main} thrown in C:\\Users…\\laragon\\www\\reviewchecked\\vendor\\auth0\\auth0-php\\src\\JWTVerifier.php on line 226

As our Senior Engineer suggests in the thread, can you share the configuration you’re using when initializing the `Auth0` class removing any sensitive data. Is this a new application you’re building or is this happening with the latest version of the SDK in one that was working before? Thanks in advance!

---

<div class="post-metadata">

**Author:** ![jmakuc](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jmakuc/32/23004_2.png) [@jmakuc](https://community.auth0.com/u/jmakuc)\
**Post date:** [August 6, 2020, 3:42pm UTC](https://community.auth0.com/t/signature-verification-failed-in-jwtverifier-php/29891/5 "2020-08-06T15:42:11Z")

</div>

Hi There. I found this thread looking entries for PHP JWTVerifier. I also faced this problem with the “Signature verification failed in” message.

I found that by default the JWTVerifier class has the supported algorithms setted to HS256:

```
protected $supported_algs = ['HS256'];

```

But the default algorithm when creating an API is RS256. The problem happens if you don’t manually change the algorithm to RS256, the program fails to run either because it says a secret is required (which you don’t have for RS256) or the signature fails when overriding that config.

Setting the $supported\_algs variable to [‘RS256’] solves the problem and allows you to complete the token verification. I was stucked with this problem for a whole day, I hope it helps somebody 🙂

Best!
