[Flask] Flask-Security authentication in JS

Federico Delgado Doyle fededelgado at outlook.com
Thu Sep 3 01:28:25 CEST 2015


Hi Morgan,
I don't know about Flask-Security. But cookies should transmit regardless if the browser sent a post or get  or a javascript http request caused it.
Have you actually seen that the cookie is not traveling when using jquery ajax or whatever you use? 
Cheers,
Federico

Date: Wed, 2 Sep 2015 17:40:31 +0530
From: connollymorg at gmail.com
To: flask at python.org
Subject: [Flask] Flask-Security authentication in JS

I have a Flask app that uses Flask-Security for authentication, which is storing authentication details in cookies on the client side. Currently, it is a static app rendered using Jinja templates, but now I want to implement some features which require access to protected resources dynamically via JavaScript.
If I send a request using JavaScript to a URL, the cookies won't be transmitted. If I want to transmit the username/password with each request, I will have to pass it to Jinja in cleartext. 
I'm at a total loss here, and I do not know what to do. Can somebody point me in the right direction?
Cheers

_______________________________________________
Flask mailing list
Flask at python.org
https://mail.python.org/mailman/listinfo/flask 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/flask/attachments/20150902/64e05cdb/attachment-0001.html>


More information about the Flask mailing list