You are tasked to develop a Flask application that requires user authentication. How would you implement user authentication in a secure manner?
- Implement custom authentication from scratch without any external libraries.
- Store user credentials in plain text in the database.
- Use a well-established authentication library like Flask-Login, Flask-Security, or Flask-Principal.
- Use JavaScript for authentication.
To implement secure user authentication in a Flask application, it's advisable to use established authentication libraries that have been thoroughly tested for security vulnerabilities. Storing passwords in plain text (Option 2) is a security risk, and implementing custom authentication (Option 3) is error-prone. Using JavaScript (Option 4) for authentication is not recommended for security reasons.
Loading...
Related Quiz
- How would you create an instance of a metaclass in Python?
- Which Python conditional statement allows for the checking of multiple conditions sequentially until one is found to be true?
- Which of the following best describes the behavior of the continue statement inside a loop?
- In Flask, the ____ object is used to store data that is accessible from all parts of an application.
- How does a metaclass differ from a class in Python?