Proper way for user authentication with angularjs and flask
Asked Answered
Q

2

13

I'm currently working my way through Web development with flask. I want to build a webapp with flask as backend and angular.js at the frontend. The Json part is straight forward, and my first steps work out well. But now I got stuck with User Authentication. I read a lot but found out, that WTFForms works not as well with angular (without the CSFR Token), so i can not use something like flask-security.

What is a proper way or maybe the best pratice for implementing User authentication with Angular und Flask? (Maybe someone knows a good example app I can learn from by example)

Quintie answered 7/2, 2014 at 18:1 Comment(1)
Take a look in this repository. github.com/weinbergdavid/python-flask-securityHeddie
M
52

I have written several tutorials on RESTful APIs with Flask, all with examples that are ready to use:

http://blog.miguelgrinberg.com/category/REST

The tutorials are:

I hope they are useful.

Mcgregor answered 7/2, 2014 at 19:1 Comment(2)
+1 to Miguel and his blog, thanks for the huge effort you put in on Flask knowledge sharing.Metathesize
I'll go with token based auth - Miguel did great job on his blog.Doing
A
0

You can use flask-security together with Angular. You can even get CSRF support. I simply disabled WTFForms support and used the Flask backend only as REST API. I wrote a tutorial how to do this here. Source code is also available.

Archean answered 24/8, 2020 at 12:35 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.