You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
As discussed here #657 it may be better to pass the key token for signed in users in the header instead of a URL query parameter.
Additional context
This is not a large security risk as the URL isn't typically visible or stored in history or cache. It's possible both a query parameter and header can be used simultaneously, making this change backwards compatible.
Reacted by Davide Roffo, babang1da, braj065, Frans Stofberg, Luke Hutchison and Felix Brandtner
How do we add the header parameter in serverpod flutter app while calling the endpoint? We would like to add JWT token received while login for signed in users in header to authenticate on server side similar what is mentioned above.
Reacted by kemalinnowise, Frans Stofberg and Heath Dunlop
I would also like to know what the client (flutter) side code looks like to send the header. I'm not finding anything related in the docs.
For me this is a deal breaker as our infrastructure has all apis behind an api gateway / reverse proxy that requires a bearer token in the headers.
Without this I cannot make any calls from my ui to backend as the proxy will reject the call
Not exactly... those refer to the format of the auth key. Here the issue is the location of the token. IE Header vs Body
using "Authorization" header is standard practice and would be ideal
Activity
damienissa commentedon Feb 17, 2023
@vlidholt Hi. Can I commit to it?
vlidholt commentedon Feb 18, 2023
@damienissa Yes, as long as it is backwards compatible, this would be a great addition! :)
wstrange commentedon Mar 9, 2023
Proxies and/or load balancers might log the URL. This isn't hair on fire, but it probably should be addressed in the next release.
vlidholt commentedon Mar 14, 2023
Good point @wstrange
yahu1031 commentedon Apr 8, 2023
@davideroffo Currently, I'm able to pass the token in headers. When you consume in the server part, we need to use the session.
sample code
CC: @vlidholt
perumalrollfi commentedon May 22, 2023
How do we add the header parameter in serverpod flutter app while calling the endpoint? We would like to add JWT token received while login for signed in users in header to authenticate on server side similar what is mentioned above.
fstof commentedon Aug 16, 2023
I would also like to know what the client (flutter) side code looks like to send the header. I'm not finding anything related in the docs.
For me this is a deal breaker as our infrastructure has all apis behind an api gateway / reverse proxy that requires a bearer token in the headers.
Without this I cannot make any calls from my ui to backend as the proxy will reject the call
vlidholt commentedon Aug 21, 2023
@fstof, adding custom headers would be a nice feature.
fstof commentedon Aug 21, 2023
@vlidholt I have a PR I'm just cleaning up if you don't mind...
I'm thinking similar to
AuthenticationKeyManagerwe can add a "headerManager" that can be passed in on client creation... and the abstract class...
feat: Add custom header manager see serverpod#663
feat: Add custom header manager see serverpod#663
fstof commentedon Sep 12, 2023
So any takers on #1298 @vlidholt , @Isakdl ?
Not exactly sure what the issue is on the web implementation of my PR
Would really appreciate some input here
vlidholt commentedon Sep 13, 2023
Sorry for the delay here. Will take a look shortly!
lukehutch commentedon Jan 31, 2024
Related to JWT support requests: #1698, #1720.
fstof commentedon Jan 31, 2024
Not exactly... those refer to the format of the auth key. Here the issue is the location of the token. IE Header vs Body
using "Authorization" header is standard practice and would be ideal
lukehutch commentedon Feb 1, 2024
@fstof Right, but what I'm saying is that the token itself should be a JWT. Yes, it should be stored in a header.
[-]Move key-token to header instead of URL[/-][+]Move key-token to header instead of body[/+]