Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flask login (no database)

Tags:

python

rest

flask

I'm trying to implement the following views in flask:

  1. /index
         * shows a form with username and password entries
         * upon submission, redirects to 2

  2. /params
         * shows another form with more entries
         * is only viewable if they provided a username and password for 1
         * upon submission, redirects to 3

  3. /upload
         * does magic() with the fields entered from 1 & 2
         * is only viewable if they filled in 1 & 2


Every tutorial I have seen assumes that you use a database. The username and password from 1 are not checked against any database. They are used for ntlm authentication only...

Can this be done? Or am I misusing flask?

like image 283
nodel Avatar asked Mar 12 '26 05:03

nodel


1 Answers

As you mention NTLM authentication, I assume you're running inside a Windows network. If that is the case, I'm not sure why you'd need a form where users can enter username and password.

NTLM and Kerberos use the principal of the Windows session to authenticate the user with services running inside the same domain. The user logs in once to Windows and that identity is auto-magically used to authenticate the user when calling services.

Flask supports this using the Flask-Kerberos module

like image 184
MvdD Avatar answered Mar 14 '26 03:03

MvdD