In this project, you will learn what the authentication process means and implement a Basic Authentication on a simple API.
In the industry, you should not implement your own Basic authentication system and use a module or framework that doing it for you (like in Python-Flask: Flask-HTTPAuth). Here, for the learning purpose, we will walk through each step of this mechanism to understand it by doing.
At the end of this project, you are expected to be able to explain to anyone, without the help of Google:
- What authentication means
- What Base64 is
- How to encode a string in Base64
- What Basic authentication means
- How to send the Authorization header
Python Scripts
- All your files will be interpreted/compiled on
Ubuntu 18.04 LTSusingpython3(version 3.7) - All your files should end with a new line
- The first line of all your files should be exactly
#!/usr/bin/env python3 - A
README.mdfile, at the root of the folder of the project, is mandatory - Your code should use the
pycodestylestyle (version 2.5) - All your files must be executable
- The length of your files will be tested using
wc - All your modules should have a documentation (
python3 -c 'print(__import__("my_module").__doc__)') - All your classes should have a documentation (
python3 -c 'print(__import__("my_module").MyClass.__doc__)') - All your functions (inside and outside a class) should have a documentation (
python3 -c 'print(__import__("my_module").my_function.__doc__)' andpython3 -c 'print(__import__("my_module").MyClass.my_function.__doc__)') - A documentation is not a simple word, it’s a real sentence explaining what’s the purpose of the module, class or method (the length of it will be verified)