Json Web Token verification
After setting up my worker's route I got a message say I need to verify my JWT. I did this after setting up my same origin domain settings. I don't under don't understand what the JWT is Authorizing in this case. I also don't understand where to paste the code in the attached file. I initially pasted it in my worker's script but I got the errors found in attachment #1. Furter, where do I paste the "AUD" and "JWK" strings?
2 Replies
On a simple explanation, JWT ir is basically the ideia of using temporary cryptid credentials for authentication instead of raw credentials, you send a first request if you login, and the system and returns a credential (JWT), so you can authenticatte without risking losing your credentials
I don't which cloudflare service you're are using, but if you a only deploying a worker, you should not need more than a wrangler init or login, if your a setup in at the dashboard, you don't need anything except for being logged in
Also, there are some considerations that you should look in your code:
1- js/typescript doesn't allow multiple defaults exports on a file you should use only one per file, if you want to isolates each endpoint you can easily do it with hono js
2- I do think you didn't added the Jose package at your at your package.json, the IDE is showing this error because it didn't find that package
If your are trying to hit some endpoint, maybe it returning this error because you are not sending the JWT credentials on header of the request??
@Gab I'm lost!!! 😫
