clerk / clerk-sdk-go

Access the Clerk Backend API from Go
MIT License
94 stars 21 forks source link

`missing jwt kid header claim` with custom JWT Template #323

Open timreibe opened 2 months ago

timreibe commented 2 months ago

Hi everyone,

I have a custom JWT template set in the dashboard for token generation. When I try to verify the token, I get an error: missing jwt kid header claim.

I checked the tokens on jwt.io and yes, they don't have a kid in header. Is this an issue with Clerk's custom JWT Templates, or with this Go SDK?

Token Example

eyJhbGciOiJIUzI1NiIsImNhdCI6ImNsX0I3ZDRQRDIyMkFBQSIsInR5cCI6IkpXVCJ9.eyJhcHBfbWV0YWRhdGEiOnt9LCJhdWQiOiJhdXRoZW50aWNhdGVkIiwiZXhwIjoxNzI1ODc5ODg0LCJpYXQiOjE3MjU4Nzk4NTQsImlzcyI6Imh0dHBzOi8vaW1tZW5zZS1zbG90aC01MS5jbGVyay5hY2NvdW50cy5kZXYiLCJqdGkiOiI2NDJkMjYwOTkxNTBkNTQ0NmQ0YyIsIm5iZiI6MTcyNTg3OTg0OSwicGhvbmUiOiIrMTU1NTU1NTAxMDAiLCJyb2xlIjoiYXV0aGVudGljYXRlZCIsInN1YiI6InVzZXJfMmxwYkVBUERCcUNpY0lZMEVLeGtSZU5lZGRVIiwidXNlcl9tZXRhZGF0YSI6e319.GLY3OKYdZhPgj1S9G0ztjc_lje4Xfym2ncwMjQHr7UE

Code Example

This is the call I make:

claims, err := client.VerifyToken(jwtToken, verifyTokenOptions...)
image