Add ability to specify the token location in request headers
See original GitHub issue🚀 Feature Proposal
Currently the default, non-configurable behavior for tokens sent with headers (meaning, not in cookies) is hardcoded to look for the token in the Authorization
header with format Bearer {token}
. It should be possible to specify a custom location and format for the token in the headers. For instance, a custom header, and a custom format not necessarily involving Bearer
.
Motivation
JWT doesn’t prescribe a way to send a token to an API, so it should be possible to provide a custom location where the token is retrieved from and validated.
Example
The custom logic should override these lines of code, and could be provided as an option to the plugin via a callback which is used to extract the token from the request, for instance:
extractToken: request => token
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Authorization Bearer in Header - Custom Connector
I have unauthenticated GET methods working, but now am working on some POSTs and am running into an issue with putting "Authorization: Bearer...
Read more >Bearer token in authorization header vs query parameter
What's the best way (when desigining a REST API) to accept a access token. 1) As an authorization header. Appears to be the...
Read more >Add ability to specify webhook authentication token header ...
I propose adding the ability to send a token in an arbitrary header. Proposal. I want to integrate with a system that is...
Read more >Add auth token in request header in ember-file-upload
You can pass options as second parameter of upload method. One of possible options is headers . Something like this should work:
Read more >HTTP/1.1: Header Field Definitions
The Accept request-header field can be used to specify certain media types which are acceptable for the response. Accept headers can be used...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Makes sense, I’ll have a look at this today
An existing application that’s sending the token in a custom request header and sending it in this way to other existing microservices. We’re creating a new microservice based on fastify and we can’t change the way the token is sent to the services.