jwt icon indicating copy to clipboard operation
jwt copied to clipboard

"Unexpected token algorithm" error when validating CloudFlare's JWT

Open petersondmg opened this issue 1 year ago • 1 comments

Hello, I'm trying to validate Cloudflare Zero Trust JWT, but I'm getting the error "jwt: unexpected token algorithm". Looking at the code, I think the problem is related to this line the compares the header, since the JWT from CF doesn't have the "typ" field.

The line: https://github.com/kataras/jwt/blob/d03e03aaf19da85fc083eccc404d8f102e1c1641/token.go#L169

Cloudflare doc: https://developers.cloudflare.com/cloudflare-one/identity/authorization-cookie/validating-json/

Thank you.

petersondmg avatar Oct 10 '22 23:10 petersondmg