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
I'd like to extend jwt-auth plugin to save the authenticated JWT in the request context, so that I can easily use it in a plugin which executes after (lower priority), such as a custom ACL. This way I don't have to retrieve it again from the request query parameters, cookies or headers.
Custom plugin example (my-acl.lua):
function_M.rewrite(conf, ctx)
-- [...]localjwt_token=ctx.jwt_objifnotjwt_tokenthen-- Technically this can only happen when the JWT plugin didn't run for this request, or the priority was lowercore.log.warn("\n\nToken object not found in ctx.\n\n")
return401, {message="Missing JWT token in request"}
end-- [...]end
The text was updated successfully, but these errors were encountered:
mikyll
added a commit
to mikyll/apisix
that referenced
this issue
May 23, 2024
Description
I'd like to extend jwt-auth plugin to save the authenticated JWT in the request context, so that I can easily use it in a plugin which executes after (lower priority), such as a custom ACL. This way I don't have to retrieve it again from the request query parameters, cookies or headers.
Custom plugin example (
my-acl.lua
):The text was updated successfully, but these errors were encountered: