custom JWT security #420
Replies: 1 comment 1 reply
-
Hey, sure this is possible. Though Way to access that information is dependant to framework in use. In case of
I would say that it depends on what you are trying to build. Sure this is okay, there are cases e.g. if you are implementing a proxy where you need to get access to the authorization and other headers that are then forwared to another API down the line. But if you are doing authorization validation twice then usually doing double job is not a best way to implement things. Though in these cases most likely the authorization valiation check would have been abstracted away so it will not be visible to the actual endpoint itself. Hope this helps Cheers |
Beta Was this translation helpful? Give feedback.
-
Hi, I'm trying to implement a custom JWT security with rocket 0.5.0-rc.2, and for now, I already see the token sent as an authorization in the endpoint request. This is good, but in my endpoint, I later call another external API and I need the previous token to be sent. Is there a way to "catch" the jwt token and use it later?
That is what I have:
So, when I call this endpoint, the curl is this:
I can see that the token is there and I want to use it later on the
user_auth_refresh()
functionThe
user_auth_refresh()
function looks like this:It is possible at all? It is a good practice?
Thanks so much in advance, I have been using utoipa and I think you're doing such a good job!
Beta Was this translation helpful? Give feedback.
All reactions