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 am trying to use flask-jwt-extended in conjuction with your awesome Flask-Security, which in in my opinion takes care of a lot of the boilerplate away from standard authentication.
However, use cases for both Flask-Login and Flask-jwt-extended depend on us writing our own login() view to allow users to log in given a username+password, giving them back a JWT string. I can see Flask-Security ships with a nice implementation of such view that even takes into account whether it is called by AJAX or not. But it currently suffers from 2 things:
There are no hooks to allow us to add a custom JWT to the response instead of your native auth token.
I assume this would be possible using Flask-Login's user-logged-in signal, in conjunction with Flask.after_this_request and the flask.request global to, for example, attach an Authorization: Bearer header, but this seems very contrived. Additionally, if the response is a json string, there is no officially documented way to my knowledge to alter the contents of a response object in Flask
Hi!
I am trying to use flask-jwt-extended in conjuction with your awesome Flask-Security, which in in my opinion takes care of a lot of the boilerplate away from standard authentication.
However, use cases for both Flask-Login and Flask-jwt-extended depend on us writing our own login() view to allow users to log in given a username+password, giving them back a JWT string. I can see Flask-Security ships with a nice implementation of such view that even takes into account whether it is called by AJAX or not. But it currently suffers from 2 things:
I assume this would be possible using Flask-Login's
user-logged-insignal, in conjunction withFlask.after_this_requestand theflask.requestglobal to, for example, attach anAuthorization: Bearerheader, but this seems very contrived. Additionally, if theresponseis a json string, there is no officially documented way to my knowledge to alter the contents of aresponseobject in Flask