Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Flask login help
#1
I have a simple client app that accesses a flask web service to get data from a database and then write to a database. I make three calls to the web service: 2 to get data and populate the UI and 1 to write order info when the user completes an order. The web service is in the background and handles the data.
I want to add some basic security to the flask web service. My thought was to use flask-login to have the client pass user credentials when it connected and have the connection rejected if incorrect credentials are used. I was thinking very simple and doesn't have to be bulletproof.
I have read up on flask-login and I see examples on setting up authentication on the flask side, but I still have some questions. I am using requests to send the get and post requests from the client. I have URLs mapped in flask to resource classes to handle those requests. What I don't know is where I put the login stuff in flask since each get or post request maps to a different class. So if I pass credentials with the request from the client, how do I handle the verification of the credential and have the request map to the class that will process the request?
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  [Flask]After login page is not redirecting me to dashboard shockwave 0 2,659 May-07-2020, 05:22 PM
Last Post: shockwave
  Python /Flask Login with LDAP Auth pythonnubie 4 8,534 Apr-16-2018, 03:14 PM
Last Post: nilamo

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020