warden-jwt_auth
warden-jwt_auth copied to clipboard
Decoding User when fetched from another service
Will this library work for the use case when the service that uses this library doesn't have access to the users table directly? For example if the JWT is authenticated could find_for_authentication be overwritten to make a call to another service from which the User data is fetched to set on warden?
My understanding of warden may be a little lacking but from what I understand it doesn't care much about the session and is happy with just a user id for session information.
Thanks!
Hi @toomanyjoes ,
you end up defining jwt_subject at the user instance level, and that's what you will get as the sub payload when you decode a token. So, if you can use it to fetch your User then, yes, you can override find_for_jwt_authentication to perform the call.