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
{{ message }}
Repository navigation
Support JWT extraction from cookies in jwt_authn #17424
Title: Support JWT extraction from cookies in jwt_authn
Description:
It's common for JWTs to be sent as HttpOnly cookies from a browser. jwt_authn currently supports extraction from headers and query parameters but lacks the ability to work with cookies.
It can be made to work with cookies by using a combination of these 3 filters as discussed on #7025's comment: header_to_metatdata -> metadata to header (using Lua ) -> jwt_authn
Adding first party support to extract from cookies will make doing this much easier.
Activity
theshubhamp commentedon Jul 20, 2021
Looked at the structure of
jwt_authnand I believe it can be done this way:from_cookiesto config schema that accepts cookie names as a list (similar tofrom_params)I can contribute a PR if the community thinks this would be a good addition
htuch commentedon Jul 21, 2021
Seems a reasonable feature. @qiwzhang WDYT?
tilgovi commentedon Aug 6, 2021
Came here from #7025 to say that I would find this useful and am currently using
header_to_metadata-> lua ->jwt_authn.qiwzhang commentedon Aug 11, 2021
Yes, it will be a good feature to have.
theshubhamp commentedon Aug 11, 2021
Great, I'll try it out and send a PR
jwt_authn: Support extraction of JWT from Cookies in JWT Extension (#…