jwt
jwt copied to clipboard
Implement a BearerExtractor
This is a rather common extractor; it extracts the JWT from the HTTP Authorization header, expecting it to include the "Bearer " prefix.
This patterns is rather common and this snippet is repeated in enough applications that it's probably best to just include it upstream and allow reusing it.
Good idea. May I suggest an alternative name like AuthorizationHeaderExtractor or do you think that is too long?
I have this in literally every project, haha. I'd suggest something like GetTokenFromHeader
I have this in literally every project, haha. I'd suggest something like
GetTokenFromHeader
There is already a TokenExtractor which loops through all tokens, since this is specific to a bearer token we might as well stick with the original name.