# Missing a alg header

**URL:** <https://community.auth0.com/t/missing-a-alg-header/121702>\
**Category:** Get Help\
**Tags:** apis, application\
**Created:** [November 27, 2023, 3:30pm UTC](https://community.auth0.com/t/missing-a-alg-header/121702 "2023-11-27T15:30:42Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![acampbell](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@acampbell](https://community.auth0.com/u/acampbell)\
**Post date:** [November 27, 2023, 3:30pm UTC](https://community.auth0.com/t/missing-a-alg-header/121702/1 "2023-11-27T15:30:42Z")

</div>

I am on day three working with auth0 and jwt and php. After combing through the documentation and samples, I have the beginnings of a validator. After new SdkConfiguration and new Auth0, the decode command fails with “missing a alg header”, though [jwt.io](http://jwt.io) shows “alg, typ, kid” in the header.

“failed to decode/validate token: Auth0\SDK\Exception\InvalidTokenException: Provided token is missing a alg header in C:\inetpub\wwwroot\vendor\auth0\auth0-php\src\Exception\InvalidTokenException.php:237  
Stack trace:  
#0 C:\inetpub\wwwroot\vendor\auth0\auth0-php\src\Token\Verifier.php(65): Auth0\SDK\Exception\InvalidTokenException::missingAlgHeader()  
#1 C:\inetpub\wwwroot\vendor\auth0\auth0-php\src\Token\Verifier.php(50): Auth0\SDK\Token\Verifier-\>verify()  
#2 C:\inetpub\wwwroot\vendor\auth0\auth0-php\src\Token\Parser.php(269): Auth0\SDK\Token\Verifier-\>\_\_construct()  
#3 C:\inetpub\wwwroot\vendor\auth0\auth0-php\src\Token.php(290): Auth0\SDK\Token\Parser-\>verify()  
#4 C:\inetpub\wwwroot\vendor\auth0\auth0-php\src\Auth0.php(134): Auth0\SDK\Token-\>verify()  
#5 C:\inetpub\wwwroot\validate.php(78): Auth0\SDK\Auth0-\>decode()  
#6 {main}”

Did I forget to set an option?

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [November 29, 2023, 8:24pm UTC](https://community.auth0.com/t/missing-a-alg-header/121702/3 "2023-11-29T20:24:51Z")

</div>

Hi @acampbell,

Welcome to the Auth0 Community!

It sounds like you are requesting an opaque token. See this FAQ for more info:

[https://community.auth0.com/t/why-is-my-access-token-not-a-jwt-opaque-token/31028](https://community.auth0.com/t/why-is-my-access-token-not-a-jwt-opaque-token/31028)

Please let me know if you have any questions.

---

<div class="post-metadata">

**Author:** ![acampbell](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@acampbell](https://community.auth0.com/u/acampbell)\
**Post date:** [November 30, 2023, 7:39pm UTC](https://community.auth0.com/t/missing-a-alg-header/121702/4 "2023-11-30T19:39:46Z")

</div>

Thanks for the reply, @dan.woda. I guess that I did not provide enough information. I am testing against a token received from an application at auth0. This setup will be for validating machine-to-machine traffic.

I changed to new SdkConfiguration then new Token, and the exception message changed to one about aud claim mismatch. It is expecting the application’s clientId but found an URL. I opened a support ticket with auth0.

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [November 30, 2023, 7:59pm UTC](https://community.auth0.com/t/missing-a-alg-header/121702/5 "2023-11-30T19:59:22Z")

</div>

No problem. If you end up needing more assistance can you please share what SDK and version you are using, some code samples, and an example token with sensitive data removed.

Thanks

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [December 14, 2023, 7:59pm UTC](https://community.auth0.com/t/missing-a-alg-header/121702/6 "2023-12-14T19:59:49Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
