Comments (9)
Hello @duclm2609, for known algorithms (like RS256
) the fixedHeaders
are used (for performance boost), we can just add the typ:..., alg:..
forms too :) There is no need to support custom header/map at the moment (although it's not hard to do it).
EDIT: I think your issue with the java libray is that it accepts the golang one, but this golang jwt library does not accept the java's one because the order is different, right? If that's the case, then the issue is not on the createHeaderRaw
itself but it's on the decodeToken
(which calls the createHeaderRaw
, we should modify that part to be able to understand the opossite form too). Note that, normally, this is the "correct" JWT specification form, that our kataras/jwt
library uses.
from jwt.
On the header decode compatibility issue, the typ header is optional as per the specs.
I have a provider which creates JWT without the typ header, and some additional parameters (JWS). Is it possible to make the call to compareHeader optional using a flag?
from jwt.
I also met this issue when verifying the JWT token which was created by some library in other language. They added some additional keys in that header, and I must not modify the implementation in that library.
On my side, I would like to use my custom function to compare header of token, which is done by build-in compareHeader (
Line 159 in 9f23c50
Thanks for your work, it already makes my work more easier!
from jwt.
Sorry for the delay @cfeeling, @geordee. I've just pushed a commit and a new tag 0.0.9 which exports the CompareHeader
so you can modify it globally.
Merry Christmas π π π½ π€Άπ½
from jwt.
Sorry for the delay @cfeeling, @geordee. I've just pushed a commit and a new tag 0.0.9 which exports the
CompareHeader
so you can modify it globally.Merry Christmas π π½ π€Άπ½
Thanks, it is one of nice things in this holiday!
I could use it as resetting the public variable CompareHeader
right now, thats great!
Happy New Year, dear @kataras @geordee
from jwt.
Thanks @cfeeling, exactly! Happy new year πππ₯³
from jwt.
Hello @duclm2609 and @cfeeling.
I've just pushed v0.1.0
, get it with:
$ go get -u github.com/kataras/jwt@latest
which contains new more methods: SignWithHeader
and VerifyWithHeaderValidator
to support custom headers and public key validation per-token (e.g jwt key ids/amazon and e.t.c.). Please take a look at the complete example at: https://github.com/kataras/jwt/blob/main/_examples/custom-header/main.go
from jwt.
Hello @duclm2609 and @cfeeling.
I've just pushed
v0.1.0
, get it with:$ go get -u github.com/kataras/jwt@latestwhich contains new more methods:
SignWithHeader
andVerifyWithHeaderValidator
to support custom headers and public key validation per-token (e.g jwt key ids/amazon and e.t.c.). Please take a look at the complete example at: https://github.com/kataras/jwt/blob/main/_examples/custom-header/main.go
Hi @kataras , I received your message now, but I'm busy recently. I will be back and response ASAP when I was free, thanks for your work.
from jwt.
Hi @cfeeling no worries, take your time.
from jwt.
Related Issues (14)
- How to refresh jwt token? HOT 3
- jwt: unexpected token algorithm "Error" HOT 2
- "Unexpected token algorithm" error when validating CloudFlare's JWT HOT 1
- ignore expired tokens on certain routes HOT 1
- jwt: invalid token form
- Generating the wrong token when customising claims
- Fix or remove Audience Claim from standard claims HOT 2
- [BUG] jwt Claims - Invalid for individual custom struct fields HOT 2
- Unnecessary custom base64 implementation HOT 2
- Audience parsing doesn't reject unexpected items HOT 1
- JWT not rejected when audience claim present but not specified by verifying party HOT 1
- payload is not a type of JSON error
- CompareHeader function fails when key id (kid) included HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jwt.